Browse Source

Removed brackets in output of until formulas

tempestpy_adaptions
Lanchid 12 years ago
parent
commit
bfce1a5655
  1. 4
      src/formula/BoundedUntil.h
  2. 4
      src/formula/Until.h
  3. 4
      test/parser/PrctlParserTest.cpp

4
src/formula/BoundedUntil.h

@ -148,13 +148,11 @@ public:
* @returns a string representation of the formula
*/
virtual std::string toString() const {
std::string result = "(";
result += left->toString();
std::string result = left->toString();
result += " U<=";
result += std::to_string(bound);
result += " ";
result += right->toString();
result += ")";
return result;
}

4
src/formula/Until.h

@ -125,11 +125,9 @@ public:
* @returns a string representation of the formula
*/
virtual std::string toString() const {
std::string result = "(";
result += left->toString();
std::string result = left->toString();
result += " U ";
result += right->toString();
result += ")";
return result;
}

4
test/parser/PrctlParserTest.cpp

@ -77,7 +77,7 @@ TEST(PrctlParserTest, parseRewardFormulaTest) {
ASSERT_EQ(storm::formula::BoundOperator<double>::GREATER_EQUAL, op->getComparisonOperator());
ASSERT_EQ(15.0, op->getBound());
ASSERT_EQ(prctlFileParser->getFormula()->toString(), "R >= 15.000000 [(a U !b)]");
ASSERT_EQ(prctlFileParser->getFormula()->toString(), "R >= 15.000000 [a U !b]");
delete prctlFileParser->getFormula();
delete prctlFileParser;
@ -92,7 +92,7 @@ TEST(PrctlParserTest, parseRewardNoBoundFormulaTest) {
ASSERT_NE(prctlFileParser->getFormula(), nullptr);
ASSERT_EQ(prctlFileParser->getFormula()->toString(), "R = ? [(a U<=4 (b & !c))]");
ASSERT_EQ(prctlFileParser->getFormula()->toString(), "R = ? [a U<=4 (b & !c)]");
delete prctlFileParser->getFormula();
delete prctlFileParser;

Loading…
Cancel
Save