From 9bc8bb2ca8204fbc0e2928f9c8e61935c37b57e0 Mon Sep 17 00:00:00 2001 From: Lanchid Date: Mon, 8 Apr 2013 16:35:16 +0200 Subject: [PATCH] Some code style and documentation --- src/parser/PrctlFileParser.cpp | 7 ++++++- src/parser/PrctlParser.h | 6 ++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/parser/PrctlFileParser.cpp b/src/parser/PrctlFileParser.cpp index 90721ee8f..117c80a82 100644 --- a/src/parser/PrctlFileParser.cpp +++ b/src/parser/PrctlFileParser.cpp @@ -17,7 +17,7 @@ namespace storm { namespace parser { PrctlFileParser::PrctlFileParser(std::string filename, storm::models::Dtmc& dtmc, enum libraries library) { - + //Here ,the model checker which uses the correct library is created and a reference stored in the pointer modelChecker: storm::modelchecker::SparseDtmcPrctlModelChecker* modelChecker = nullptr; switch(library) { //case EIGEN: @@ -30,11 +30,14 @@ PrctlFileParser::PrctlFileParser(std::string filename, storm::models::Dtmc(dtmc); break; } + + //Now, the check function (which works on abstract model checkers) can parse the formulas and invoke the model checker: check(filename, modelChecker); delete modelChecker; } PrctlFileParser::PrctlFileParser(std::string filename, storm::models::Mdp& mdp, enum libraries library) { + //Here ,the model checker which uses the correct library is created and a reference stored in the pointer modelChecker: storm::modelchecker::SparseMdpPrctlModelChecker* modelChecker = nullptr; switch(library) { //case EIGEN: @@ -46,6 +49,8 @@ PrctlFileParser::PrctlFileParser(std::string filename, storm::models::Mdp(mdp); break; } + + //Now, the check function (which works on abstract model checkers) can parse the formulas and invoke the model checker: check(filename, modelChecker); delete modelChecker; } diff --git a/src/parser/PrctlParser.h b/src/parser/PrctlParser.h index 7f97d4293..a564a4fd6 100644 --- a/src/parser/PrctlParser.h +++ b/src/parser/PrctlParser.h @@ -18,8 +18,7 @@ namespace parser { * This class creates a PctlFormula object which can be accessed through the getFormula() method (of base * class PrctlParser). However, it will not delete this object. */ -class PrctlParser : Parser -{ +class PrctlParser : Parser { public: /*! * Reads a PRCTL formula from its string representation and parses it into a formula tree, consisting of @@ -35,8 +34,7 @@ class PrctlParser : Parser /*! * @return a pointer to the parsed formula object */ - storm::formula::AbstractFormula* getFormula() - { + storm::formula::AbstractFormula* getFormula() { return this->formula; }