Browse Source

added checks for multiplicative factor parsing

tempestpy_adaptions
Stefan Pranger 4 years ago
parent
commit
fa47742a14
  1. 5
      src/storm-parsers/parser/FormulaParserGrammar.cpp
  2. 1
      src/storm-parsers/parser/FormulaParserGrammar.h

5
src/storm-parsers/parser/FormulaParserGrammar.cpp

@ -149,8 +149,11 @@ namespace storm {
qi::lit("Optimal")[qi::_val = storm::logic::ShieldingType::Optimal]); qi::lit("Optimal")[qi::_val = storm::logic::ShieldingType::Optimal]);
shieldingType.name("shielding type"); shieldingType.name("shielding type");
multiplicativeFactor = qi::double_[qi::_pass = (qi::_1 >= 0) & (qi::_1 <= 1.0), qi::_val = qi::_1 ];
multiplicativeFactor.name("multiplicative factor between 0 and 1");
shieldComparison = ((qi::lit("lambda")[qi::_a = storm::logic::ShieldComparison::Relative] | shieldComparison = ((qi::lit("lambda")[qi::_a = storm::logic::ShieldComparison::Relative] |
qi::lit("gamma")[qi::_a = storm::logic::ShieldComparison::Absolute]) > qi::lit("=") > qi::double_)[qi::_val = phoenix::bind(&FormulaParserGrammar::createShieldComparisonStruct, phoenix::ref(*this), qi::_a, qi::_1)];
qi::lit("gamma")[qi::_a = storm::logic::ShieldComparison::Absolute]) > qi::lit("=") > multiplicativeFactor)[qi::_val = phoenix::bind(&FormulaParserGrammar::createShieldComparisonStruct, phoenix::ref(*this), qi::_a, qi::_1)];
shieldComparison.name("shield comparison type"); shieldComparison.name("shield comparison type");
stateFormula = (orStateFormula | multiFormula | quantileFormula | gameFormula); stateFormula = (orStateFormula | multiFormula | quantileFormula | gameFormula);

1
src/storm-parsers/parser/FormulaParserGrammar.h

@ -207,6 +207,7 @@ namespace storm {
qi::rule<Iterator, storm::logic::ShieldExpression, Skipper> shieldExpression; qi::rule<Iterator, storm::logic::ShieldExpression, Skipper> shieldExpression;
qi::rule<Iterator, storm::logic::ShieldingType, Skipper> shieldingType; qi::rule<Iterator, storm::logic::ShieldingType, Skipper> shieldingType;
qi::rule<Iterator, double, Skipper> multiplicativeFactor;
qi::rule<Iterator, std::pair<storm::logic::ShieldComparison, double>, qi::locals<storm::logic::ShieldComparison>, Skipper> shieldComparison; qi::rule<Iterator, std::pair<storm::logic::ShieldComparison, double>, qi::locals<storm::logic::ShieldComparison>, Skipper> shieldComparison;
// Parser that is used to recognize doubles only (as opposed to Spirit's double_ parser). // Parser that is used to recognize doubles only (as opposed to Spirit's double_ parser).

Loading…
Cancel
Save