From bfce1a5655bc24b3840b9b8d77766bbc12f35dc1 Mon Sep 17 00:00:00 2001 From: Lanchid Date: Thu, 7 Feb 2013 16:05:46 +0100 Subject: [PATCH] Removed brackets in output of until formulas --- src/formula/BoundedUntil.h | 4 +--- src/formula/Until.h | 4 +--- test/parser/PrctlParserTest.cpp | 4 ++-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/formula/BoundedUntil.h b/src/formula/BoundedUntil.h index e00acac74..cf222c588 100644 --- a/src/formula/BoundedUntil.h +++ b/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; } diff --git a/src/formula/Until.h b/src/formula/Until.h index 82ac05c9d..543a4febd 100644 --- a/src/formula/Until.h +++ b/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; } diff --git a/test/parser/PrctlParserTest.cpp b/test/parser/PrctlParserTest.cpp index 02d9ddc43..35db62575 100644 --- a/test/parser/PrctlParserTest.cpp +++ b/test/parser/PrctlParserTest.cpp @@ -77,7 +77,7 @@ TEST(PrctlParserTest, parseRewardFormulaTest) { ASSERT_EQ(storm::formula::BoundOperator::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;