From e8f1c7c9abfe083d9ec710fe7049eec3c806dd2a Mon Sep 17 00:00:00 2001 From: dehnert Date: Tue, 15 Oct 2013 15:09:19 +0200 Subject: [PATCH] Fix to grammar to allow for empty probability in updates. Former-commit-id: d13a5297a9503b8a467be8eb463a28dddf092f42 --- src/parser/prismparser/PrismGrammar.cpp | 2 +- src/storm.cpp | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/parser/prismparser/PrismGrammar.cpp b/src/parser/prismparser/PrismGrammar.cpp index 90b590341..e1182c751 100644 --- a/src/parser/prismparser/PrismGrammar.cpp +++ b/src/parser/prismparser/PrismGrammar.cpp @@ -179,7 +179,7 @@ namespace storm { assignmentDefinition.name("assignment"); assignmentDefinitionList = assignmentDefinition(qi::_r1, qi::_r2) % "&"; assignmentDefinitionList.name("assignment list"); - updateDefinition = ((ConstDoubleExpressionGrammar::instance(this->state) | qi::attr(phoenix::construct>(phoenix::new_(1)))) > qi::lit(":")[phoenix::clear(phoenix::ref(this->state->assignedBooleanVariables_)), phoenix::clear(phoenix::ref(this->state->assignedIntegerVariables_))] > assignmentDefinitionList(qi::_a, qi::_b))[qi::_val = phoenix::bind(&PrismGrammar::createUpdate, this, qi::_1, qi::_a, qi::_b)]; + updateDefinition = ((ConstDoubleExpressionGrammar::instance(this->state) | qi::attr(phoenix::construct>(phoenix::new_(1)))) >> qi::lit(":")[phoenix::clear(phoenix::ref(this->state->assignedBooleanVariables_)), phoenix::clear(phoenix::ref(this->state->assignedIntegerVariables_))] > assignmentDefinitionList(qi::_a, qi::_b))[qi::_val = phoenix::bind(&PrismGrammar::createUpdate, this, qi::_1, qi::_a, qi::_b)]; updateDefinition.name("update"); updateListDefinition = +updateDefinition % "+"; updateListDefinition.name("update list"); diff --git a/src/storm.cpp b/src/storm.cpp index e68fc4b9e..6005961f1 100644 --- a/src/storm.cpp +++ b/src/storm.cpp @@ -355,14 +355,14 @@ int main(const int argc, const char* argv[]) { // Enable the following lines to test the SMTMinimalCommandSetGenerator. if (model->getType() == storm::models::MDP) { std::shared_ptr> labeledMdp = model->as>(); -// storm::storage::BitVector const& finishedStates = labeledMdp->getLabeledStates("finished"); -// storm::storage::BitVector const& allCoinsEqual1States = labeledMdp->getLabeledStates("all_coins_equal_1"); -// storm::storage::BitVector targetStates = finishedStates & allCoinsEqual1States; -// std::set labels = storm::counterexamples::SMTMinimalCommandSetGenerator::getMinimalCommandSet(program, constants, *labeledMdp, storm::storage::BitVector(labeledMdp->getNumberOfStates(), true), targetStates, 0.4, true); + storm::storage::BitVector const& finishedStates = labeledMdp->getLabeledStates("finished"); + storm::storage::BitVector const& allCoinsEqual1States = labeledMdp->getLabeledStates("all_coins_equal_1"); + storm::storage::BitVector targetStates = finishedStates & allCoinsEqual1States; + std::set labels = storm::counterexamples::SMTMinimalCommandSetGenerator::getMinimalCommandSet(program, constants, *labeledMdp, storm::storage::BitVector(labeledMdp->getNumberOfStates(), true), targetStates, 0.4, true); - storm::storage::BitVector const& collisionStates = labeledMdp->getLabeledStates("collision_max_backoff"); - storm::storage::BitVector const& deliveredStates = labeledMdp->getLabeledStates("all_delivered"); - std::set labels = storm::counterexamples::MILPMinimalLabelSetGenerator::getMinimalLabelSet(*labeledMdp, ~collisionStates, deliveredStates, 0.5, true, true); +// storm::storage::BitVector const& collisionStates = labeledMdp->getLabeledStates("collision_max_backoff"); +// storm::storage::BitVector const& deliveredStates = labeledMdp->getLabeledStates("all_delivered"); +// std::set labels = storm::counterexamples::MILPMinimalLabelSetGenerator::getMinimalLabelSet(*labeledMdp, ~collisionStates, deliveredStates, 0.5, true, true); } }