Browse Source

removed unnecessary testcases (e.g. there are no atomic label formulas in game formulas since they must have a coalition of players and an operator)

tempestpy_adaptions
Lukas Posch 3 years ago
committed by Stefan Pranger
parent
commit
5452240944
  1. 66
      src/test/storm/parser/GameFormulaParserTest.cpp

66
src/test/storm/parser/GameFormulaParserTest.cpp

@ -3,72 +3,6 @@
#include "storm/logic/FragmentSpecification.h" #include "storm/logic/FragmentSpecification.h"
#include "storm/storage/expressions/ExpressionManager.h" #include "storm/storage/expressions/ExpressionManager.h"
TEST(GameFormulaParserTest, LabelTest) {
storm::parser::FormulaParser formulaParser;
std::string input = "<<p1>> Pmax=? [F \"label\"]";
std::shared_ptr<storm::logic::Formula const> gameFormula(nullptr);
ASSERT_NO_THROW(gameFormula = formulaParser.parseSingleFormulaFromString(input));
EXPECT_TRUE(gameFormula->isStateFormula());
EXPECT_TRUE(gameFormula->isUnaryStateFormula());
EXPECT_TRUE(gameFormula->isGameFormula());
}
TEST(GameFormulaParserTest, ComplexLabelTest) {
storm::parser::FormulaParser formulaParser;
std::string input = "<<p1,p2>> Pmin=? [X !(\"a\" & \"b\") | \"a\" & !\"c\"]";
std::shared_ptr<storm::logic::Formula const> gameFormula(nullptr);
ASSERT_NO_THROW(gameFormula = formulaParser.parseSingleFormulaFromString(input));
EXPECT_TRUE(gameFormula->isStateFormula());
EXPECT_TRUE(gameFormula->isUnaryStateFormula());
EXPECT_TRUE(gameFormula->isGameFormula());
}
TEST(GameFormulaParserTest, ExpressionTest) {
std::shared_ptr<storm::expressions::ExpressionManager> manager(new storm::expressions::ExpressionManager());
manager->declareBooleanVariable("x");
manager->declareIntegerVariable("y");
storm::parser::FormulaParser formulaParser(manager);
std::string input = "<<p1, p2, p3>> Pmin=? [G !(x | y > 3)]";
std::shared_ptr<storm::logic::Formula const> gameFormula(nullptr);
ASSERT_NO_THROW(gameFormula = formulaParser.parseSingleFormulaFromString(input));
EXPECT_TRUE(gameFormula->isStateFormula());
EXPECT_TRUE(gameFormula->isUnaryStateFormula());
EXPECT_TRUE(gameFormula->isGameFormula());
}
TEST(GameFormulaParserTest, LabelAndExpressionTest) {
std::shared_ptr<storm::expressions::ExpressionManager> manager(new storm::expressions::ExpressionManager());
manager->declareBooleanVariable("x");
manager->declareIntegerVariable("y");
storm::parser::FormulaParser formulaParser(manager);
std::string input = "<<p1, p2, p3>> Pmax=? [\"b\" U !\"a\" | x | y > 3]";
std::shared_ptr<storm::logic::Formula const> gameFormula(nullptr);
ASSERT_NO_THROW(gameFormula = formulaParser.parseSingleFormulaFromString(input));
EXPECT_TRUE(gameFormula->isStateFormula());
EXPECT_TRUE(gameFormula->isUnaryStateFormula());
EXPECT_TRUE(gameFormula->isGameFormula());
input = "<<p1, p2, p3>> Pmax=? [x | y > 3 | !\"a\" U \"b\"]";
ASSERT_NO_THROW(gameFormula = formulaParser.parseSingleFormulaFromString(input));
EXPECT_TRUE(gameFormula->isStateFormula());
EXPECT_TRUE(gameFormula->isUnaryStateFormula());
EXPECT_TRUE(gameFormula->isGameFormula());
}
TEST(GameFormulaParserTest, OnePlayerCoalitionTest) { TEST(GameFormulaParserTest, OnePlayerCoalitionTest) {
storm::parser::FormulaParser formulaParser; storm::parser::FormulaParser formulaParser;

Loading…
Cancel
Save