From 5be52118bab53011337819e5b94197a062b05902 Mon Sep 17 00:00:00 2001 From: PBerger Date: Wed, 12 Jun 2013 21:05:32 +0200 Subject: [PATCH] Fixed issues with the refactored parser interface and move semantics Former-commit-id: e92111749e5e715da7e51ccaf004dc4b6a241714 --- src/storm.cpp | 6 ++---- test/performance/graph/GraphTest.cpp | 12 ++++++------ 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/storm.cpp b/src/storm.cpp index f98464ab4..dec23fffc 100644 --- a/src/storm.cpp +++ b/src/storm.cpp @@ -241,8 +241,7 @@ void checkPrctlFormulae(storm::modelchecker::prctl::AbstractModelChecker storm::settings::Settings* s = storm::settings::instance(); if (s->isSet("prctl")) { LOG4CPLUS_INFO(logger, "Parsing prctl file: " << s->getString("prctl") << "."); - storm::parser::PrctlFileParser fileParser; - std::list*> formulaList = fileParser.parseFormulas(s->getString("prctl")); + std::list*> formulaList = storm::parser::PrctlFileParser(s->getString("prctl")); for (auto formula : formulaList) { modelchecker.check(*formula); @@ -317,8 +316,7 @@ int main(const int argc, const char* argv[]) { } } else if (s->isSet("symbolic")) { std::string arg = s->getString("symbolic"); - storm::parser::PrismParser parser; - storm::adapters::ExplicitModelAdapter adapter(parser.parseFile(arg)); + storm::adapters::ExplicitModelAdapter adapter(storm::parser::PrismParserFromFile(arg)); std::shared_ptr> model = adapter.getModel(); model->printModelInformationToStream(std::cout); } diff --git a/test/performance/graph/GraphTest.cpp b/test/performance/graph/GraphTest.cpp index 5f56136b3..6d634de28 100644 --- a/test/performance/graph/GraphTest.cpp +++ b/test/performance/graph/GraphTest.cpp @@ -104,13 +104,13 @@ TEST(GraphTest, PerformSCCDecompositionAndGetDependencyGraph) { std::shared_ptr> dtmc2 = parser2.getModel>(); LOG4CPLUS_WARN(logger, "Computing SCC decomposition of synchronous_leader/leader6_8..."); - sccDecomposition = storm::utility::graph::performSccDecomposition(*dtmc2); + sccDecomposition = std::move(storm::utility::graph::performSccDecomposition(*dtmc2)); LOG4CPLUS_WARN(logger, "Done."); ASSERT_EQ(sccDecomposition.size(), 1279673u); LOG4CPLUS_WARN(logger, "Extracting SCC dependency graph of synchronous_leader/leader6_8..."); - sccDependencyGraph = dtmc2->extractPartitionDependencyGraph(sccDecomposition); + sccDependencyGraph = std::move(dtmc2->extractPartitionDependencyGraph(sccDecomposition)); LOG4CPLUS_WARN(logger, "Done."); ASSERT_EQ(sccDependencyGraph.getNonZeroEntryCount(), 1535367u); @@ -121,13 +121,13 @@ TEST(GraphTest, PerformSCCDecompositionAndGetDependencyGraph) { std::shared_ptr> mdp = parser3.getModel>(); LOG4CPLUS_WARN(logger, "Computing SCC decomposition of asynchronous_leader/leader6..."); - sccDecomposition = storm::utility::graph::performSccDecomposition(*mdp); + sccDecomposition = std::move(storm::utility::graph::performSccDecomposition(*mdp)); LOG4CPLUS_WARN(logger, "Done."); ASSERT_EQ(sccDecomposition.size(), 214675); LOG4CPLUS_WARN(logger, "Extracting SCC dependency graph of asynchronous_leader/leader6..."); - sccDependencyGraph = mdp->extractPartitionDependencyGraph(sccDecomposition); + sccDependencyGraph = std::move(mdp->extractPartitionDependencyGraph(sccDecomposition)); LOG4CPLUS_WARN(logger, "Done."); ASSERT_EQ(sccDependencyGraph.getNonZeroEntryCount(), 684093u); @@ -138,13 +138,13 @@ TEST(GraphTest, PerformSCCDecompositionAndGetDependencyGraph) { std::shared_ptr> mdp2 = parser4.getModel>(); LOG4CPLUS_WARN(logger, "Computing SCC decomposition of consensus/coin4_6..."); - sccDecomposition = storm::utility::graph::performSccDecomposition(*mdp2); + sccDecomposition = std::move(storm::utility::graph::performSccDecomposition(*mdp2)); LOG4CPLUS_WARN(logger, "Done."); ASSERT_EQ(sccDecomposition.size(), 63611u); LOG4CPLUS_WARN(logger, "Extracting SCC dependency graph of consensus/coin4_6..."); - sccDependencyGraph = mdp2->extractPartitionDependencyGraph(sccDecomposition); + sccDependencyGraph = std::move(mdp2->extractPartitionDependencyGraph(sccDecomposition)); LOG4CPLUS_WARN(logger, "Done."); ASSERT_EQ(sccDependencyGraph.getNonZeroEntryCount(), 213400u);