diff --git a/src/formula/And.h b/src/formula/And.h index d8078cd15..90e53de2b 100644 --- a/src/formula/And.h +++ b/src/formula/And.h @@ -129,7 +129,7 @@ public: virtual std::string toString() const { std::string result = "("; result += left->toString(); - result += " && "; + result += " & "; result += right->toString(); result += ")"; return result; diff --git a/src/formula/Or.h b/src/formula/Or.h index e7dd117e5..52cc1d8a8 100644 --- a/src/formula/Or.h +++ b/src/formula/Or.h @@ -127,7 +127,7 @@ public: virtual std::string toString() const { std::string result = "("; result += left->toString(); - result += " || "; + result += " | "; result += right->toString(); result += ")"; return result; diff --git a/test/parser/PrctlParserTest.cpp b/test/parser/PrctlParserTest.cpp index 5a2dd3cf2..163a9265e 100644 --- a/test/parser/PrctlParserTest.cpp +++ b/test/parser/PrctlParserTest.cpp @@ -12,15 +12,16 @@ #include "src/parser/PrctlFileParser.h" TEST(PrctlParserTest, parseApOnlyTest) { + std::string ap = "P"; storm::parser::PrctlParser* prctlParser = nullptr; ASSERT_NO_THROW( - prctlParser = new storm::parser::PrctlParser("P"); + prctlParser = new storm::parser::PrctlParser(ap); ); ASSERT_NE(prctlParser->getFormula(), nullptr); - ASSERT_EQ(prctlParser->getFormula()->toString(), "P"); + ASSERT_EQ(ap, prctlParser->getFormula()->toString()); delete prctlParser->getFormula(); delete prctlParser; @@ -36,7 +37,7 @@ TEST(PrctlParserTest, parsePropositionalFormulaTest) { ASSERT_NE(prctlFileParser->getFormula(), nullptr); - ASSERT_EQ(prctlFileParser->getFormula()->toString(), "(!(a && b) || (a && !c))"); + ASSERT_EQ(prctlFileParser->getFormula()->toString(), "(!(a & b) | (a & !c))"); delete prctlFileParser->getFormula(); delete prctlFileParser; @@ -91,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; @@ -123,7 +124,7 @@ TEST(PrctlParserTest, parseComplexFormulaTest) { ASSERT_NE(prctlFileParser->getFormula(), nullptr); - ASSERT_EQ(prctlFileParser->getFormula()->toString(), "(P <= 0.500000 [F a] && (R > 15.000000 [G P > 0.900000 [F<=7 (a && b)]] || !P < 0.400000 [G !b]))"); + ASSERT_EQ(prctlFileParser->getFormula()->toString(), "(P <= 0.500000 [F a] & (R > 15.000000 [G P > 0.900000 [F<=7 (a & b)]] | !P < 0.400000 [G !b]))"); delete prctlFileParser->getFormula(); delete prctlFileParser; diff --git a/test/parser/prctl_files/complexFormula.prctl b/test/parser/prctl_files/complexFormula.prctl index fef75f247..f564f64cb 100644 --- a/test/parser/prctl_files/complexFormula.prctl +++ b/test/parser/prctl_files/complexFormula.prctl @@ -1 +1 @@ -(P<=0.5 [ F a ] & (R > 15 [ G P>0.9 [F<=7 a & b] ] | !P < 0.4 [ G !b ])) \ No newline at end of file +P<=0.5 [ F a ] & (R > 15 [ G P>0.9 [F<=7 a & b] ] | !P < 0.4 [ G !b ]) \ No newline at end of file