Browse Source

made multi(..) path formulas pass the fragment check

tempestpy_adaptions
TimQu 7 years ago
parent
commit
a16eee4982
  1. 2
      src/storm/logic/FragmentChecker.cpp
  2. 3
      src/storm/logic/FragmentSpecification.cpp
  3. 2
      src/storm/parser/FormulaParserGrammar.cpp

2
src/storm/logic/FragmentChecker.cpp

@ -202,7 +202,7 @@ namespace storm {
bool result = inherited.getSpecification().areProbabilityOperatorsAllowed();
result = result && (!f.hasQualitativeResult() || inherited.getSpecification().areQualitativeOperatorResultsAllowed());
result = result && (!f.hasQuantitativeResult() || inherited.getSpecification().areQuantitativeOperatorResultsAllowed());
result = result && (f.getSubformula().isProbabilityPathFormula() || f.getSubformula().isConditionalProbabilityFormula());
result = result && (f.getSubformula().isProbabilityPathFormula() || f.getSubformula().isConditionalProbabilityFormula() || f.getSubformula().isMultiObjectiveFormula());
if (!inherited.getSpecification().areNestedOperatorsAllowed()) {
result = result && boost::any_cast<bool>(f.getSubformula().accept(*this, InheritedInformation(inherited.getSpecification().copy().setOperatorsAllowed(false))));
} else {

3
src/storm/logic/FragmentSpecification.cpp

@ -89,7 +89,8 @@ namespace storm {
multiObjective.setMultiObjectiveFormulasAllowed(true);
multiObjective.setMultiObjectiveFormulaAtTopLevelRequired(true);
multiObjective.setOperatorsAtTopLevelOfMultiObjectiveFormulasRequired(true);
multiObjective.setNestedMultiObjectiveFormulasAllowed(true);
multiObjective.setOperatorsAtTopLevelOfMultiObjectiveFormulasRequired(false);
multiObjective.setProbabilityOperatorsAllowed(true);
multiObjective.setUntilFormulasAllowed(true);
multiObjective.setGloballyFormulasAllowed(true);

2
src/storm/parser/FormulaParserGrammar.cpp

@ -113,7 +113,7 @@ namespace storm {
orStateFormula = andStateFormula[qi::_val = qi::_1] >> *(qi::lit("|") >> andStateFormula)[qi::_val = phoenix::bind(&FormulaParserGrammar::createBinaryBooleanStateFormula, phoenix::ref(*this), qi::_val, qi::_1, storm::logic::BinaryBooleanStateFormula::OperatorType::Or)];
orStateFormula.name("or state formula");
multiObjectiveFormula = (qi::lit("multi") > qi::lit("(") >> (stateFormula % qi::lit(",")) >> qi::lit(")"))[qi::_val = phoenix::bind(&FormulaParserGrammar::createMultiObjectiveFormula, phoenix::ref(*this), qi::_1)];
multiObjectiveFormula = (qi::lit("multi") > qi::lit("(") >> ((pathFormula(storm::logic::FormulaContext::Probability) | stateFormula) % qi::lit(",")) >> qi::lit(")"))[qi::_val = phoenix::bind(&FormulaParserGrammar::createMultiObjectiveFormula, phoenix::ref(*this), qi::_1)];
multiObjectiveFormula.name("Multi-objective formula");
stateFormula = (orStateFormula | multiObjectiveFormula);

Loading…
Cancel
Save