Browse Source

Merge remote-tracking branch 'remotes/origin/menu_games' into sylvanRationalFunctions

# Conflicts:
#	test/functional/storage/PrismProgramTest.cpp


Former-commit-id: d7802745d9
tempestpy_adaptions
PBerger 8 years ago
parent
commit
a1f8382af6
  1. 24
      test/functional/abstraction/PrismMenuGameTest.cpp
  2. 44
      test/functional/storage/PrismProgramTest.cpp

24
test/functional/abstraction/PrismMenuGameTest.cpp

@ -396,7 +396,7 @@ TEST(PrismMenuGame, CrowdsFullAbstractionTest_Sylvan) {
TEST(PrismMenuGame, TwoDiceAbstractionTest_Cudd) { TEST(PrismMenuGame, TwoDiceAbstractionTest_Cudd) {
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm"); storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm");
program = program.substituteConstants(); program = program.substituteConstants();
program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
program = program.flattenModules(std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>());
std::vector<storm::expressions::Expression> initialPredicates; std::vector<storm::expressions::Expression> initialPredicates;
storm::expressions::ExpressionManager& manager = program.getManager(); storm::expressions::ExpressionManager& manager = program.getManager();
@ -416,7 +416,7 @@ TEST(PrismMenuGame, TwoDiceAbstractionTest_Cudd) {
TEST(PrismMenuGame, TwoDiceAbstractionTest_Sylvan) { TEST(PrismMenuGame, TwoDiceAbstractionTest_Sylvan) {
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm"); storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm");
program = program.substituteConstants(); program = program.substituteConstants();
program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
program = program.flattenModules(std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>());
std::vector<storm::expressions::Expression> initialPredicates; std::vector<storm::expressions::Expression> initialPredicates;
storm::expressions::ExpressionManager& manager = program.getManager(); storm::expressions::ExpressionManager& manager = program.getManager();
@ -436,7 +436,7 @@ TEST(PrismMenuGame, TwoDiceAbstractionTest_Sylvan) {
TEST(PrismMenuGame, TwoDiceAbstractionAndRefinementTest_Cudd) { TEST(PrismMenuGame, TwoDiceAbstractionAndRefinementTest_Cudd) {
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm"); storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm");
program = program.substituteConstants(); program = program.substituteConstants();
program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
program = program.flattenModules(std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>());
std::vector<storm::expressions::Expression> initialPredicates; std::vector<storm::expressions::Expression> initialPredicates;
storm::expressions::ExpressionManager& manager = program.getManager(); storm::expressions::ExpressionManager& manager = program.getManager();
@ -458,7 +458,7 @@ TEST(PrismMenuGame, TwoDiceAbstractionAndRefinementTest_Cudd) {
TEST(PrismMenuGame, TwoDiceAbstractionAndRefinementTest_Sylvan) { TEST(PrismMenuGame, TwoDiceAbstractionAndRefinementTest_Sylvan) {
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm"); storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm");
program = program.substituteConstants(); program = program.substituteConstants();
program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
program = program.flattenModules(std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>());
std::vector<storm::expressions::Expression> initialPredicates; std::vector<storm::expressions::Expression> initialPredicates;
storm::expressions::ExpressionManager& manager = program.getManager(); storm::expressions::ExpressionManager& manager = program.getManager();
@ -480,7 +480,7 @@ TEST(PrismMenuGame, TwoDiceAbstractionAndRefinementTest_Sylvan) {
TEST(PrismMenuGame, TwoDiceFullAbstractionTest_Cudd) { TEST(PrismMenuGame, TwoDiceFullAbstractionTest_Cudd) {
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm"); storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm");
program = program.substituteConstants(); program = program.substituteConstants();
program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
program = program.flattenModules(std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>());
std::vector<storm::expressions::Expression> initialPredicates; std::vector<storm::expressions::Expression> initialPredicates;
storm::expressions::ExpressionManager& manager = program.getManager(); storm::expressions::ExpressionManager& manager = program.getManager();
@ -531,7 +531,7 @@ TEST(PrismMenuGame, TwoDiceFullAbstractionTest_Cudd) {
TEST(PrismMenuGame, TwoDiceFullAbstractionTest_Sylvan) { TEST(PrismMenuGame, TwoDiceFullAbstractionTest_Sylvan) {
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm"); storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm");
program = program.substituteConstants(); program = program.substituteConstants();
program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
program = program.flattenModules(std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>());
std::vector<storm::expressions::Expression> initialPredicates; std::vector<storm::expressions::Expression> initialPredicates;
storm::expressions::ExpressionManager& manager = program.getManager(); storm::expressions::ExpressionManager& manager = program.getManager();
@ -582,7 +582,7 @@ TEST(PrismMenuGame, TwoDiceFullAbstractionTest_Sylvan) {
TEST(PrismMenuGame, WlanAbstractionTest_Cudd) { TEST(PrismMenuGame, WlanAbstractionTest_Cudd) {
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm"); storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm");
program = program.substituteConstants(); program = program.substituteConstants();
program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
program = program.flattenModules(std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>());
std::vector<storm::expressions::Expression> initialPredicates; std::vector<storm::expressions::Expression> initialPredicates;
storm::expressions::ExpressionManager& manager = program.getManager(); storm::expressions::ExpressionManager& manager = program.getManager();
@ -603,7 +603,7 @@ TEST(PrismMenuGame, WlanAbstractionTest_Cudd) {
TEST(PrismMenuGame, WlanAbstractionTest_Sylvan) { TEST(PrismMenuGame, WlanAbstractionTest_Sylvan) {
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm"); storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm");
program = program.substituteConstants(); program = program.substituteConstants();
program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
program = program.flattenModules(std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>());
std::vector<storm::expressions::Expression> initialPredicates; std::vector<storm::expressions::Expression> initialPredicates;
storm::expressions::ExpressionManager& manager = program.getManager(); storm::expressions::ExpressionManager& manager = program.getManager();
@ -624,7 +624,7 @@ TEST(PrismMenuGame, WlanAbstractionTest_Sylvan) {
TEST(PrismMenuGame, WlanAbstractionAndRefinementTest_Cudd) { TEST(PrismMenuGame, WlanAbstractionAndRefinementTest_Cudd) {
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm"); storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm");
program = program.substituteConstants(); program = program.substituteConstants();
program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
program = program.flattenModules(std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>());
std::vector<storm::expressions::Expression> initialPredicates; std::vector<storm::expressions::Expression> initialPredicates;
storm::expressions::ExpressionManager& manager = program.getManager(); storm::expressions::ExpressionManager& manager = program.getManager();
@ -647,7 +647,7 @@ TEST(PrismMenuGame, WlanAbstractionAndRefinementTest_Cudd) {
TEST(PrismMenuGame, WlanAbstractionAndRefinementTest_Sylvan) { TEST(PrismMenuGame, WlanAbstractionAndRefinementTest_Sylvan) {
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm"); storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm");
program = program.substituteConstants(); program = program.substituteConstants();
program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
program = program.flattenModules(std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>());
std::vector<storm::expressions::Expression> initialPredicates; std::vector<storm::expressions::Expression> initialPredicates;
storm::expressions::ExpressionManager& manager = program.getManager(); storm::expressions::ExpressionManager& manager = program.getManager();
@ -670,7 +670,7 @@ TEST(PrismMenuGame, WlanAbstractionAndRefinementTest_Sylvan) {
TEST(PrismMenuGame, WlanFullAbstractionTest_Cudd) { TEST(PrismMenuGame, WlanFullAbstractionTest_Cudd) {
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm"); storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm");
program = program.substituteConstants(); program = program.substituteConstants();
program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
program = program.flattenModules(std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>());
std::vector<storm::expressions::Expression> initialPredicates; std::vector<storm::expressions::Expression> initialPredicates;
storm::expressions::ExpressionManager& manager = program.getManager(); storm::expressions::ExpressionManager& manager = program.getManager();
@ -789,7 +789,7 @@ TEST(PrismMenuGame, WlanFullAbstractionTest_Cudd) {
TEST(PrismMenuGame, WlanFullAbstractionTest_Sylvan) { TEST(PrismMenuGame, WlanFullAbstractionTest_Sylvan) {
storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm"); storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm");
program = program.substituteConstants(); program = program.substituteConstants();
program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
program = program.flattenModules(std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>());
std::vector<storm::expressions::Expression> initialPredicates; std::vector<storm::expressions::Expression> initialPredicates;
storm::expressions::ExpressionManager& manager = program.getManager(); storm::expressions::ExpressionManager& manager = program.getManager();

44
test/functional/storage/PrismProgramTest.cpp

@ -8,20 +8,44 @@
#ifdef STORM_HAVE_MSAT #ifdef STORM_HAVE_MSAT
TEST(PrismProgramTest, FlattenModules) { TEST(PrismProgramTest, FlattenModules) {
storm::prism::Program result;
ASSERT_NO_THROW(result = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/leader3.nm"));
storm::prism::Program program;
ASSERT_NO_THROW(program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/leader3.nm"));
std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory(new storm::utility::solver::MathsatSmtSolverFactory());
std::shared_ptr<storm::utility::solver::SmtSolverFactory> smtSolverFactory = std::make_shared<storm::utility::solver::MathsatSmtSolverFactory>();
ASSERT_NO_THROW(result = result.flattenModules(smtSolverFactory));
EXPECT_EQ(1, result.getNumberOfModules());
EXPECT_EQ(74, result.getModule(0).getNumberOfCommands());
ASSERT_NO_THROW(program = program.flattenModules(smtSolverFactory));
EXPECT_EQ(1, program.getNumberOfModules());
EXPECT_EQ(74, program.getModule(0).getNumberOfCommands());
ASSERT_NO_THROW(result = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/wlan0_collide.nm"));
ASSERT_NO_THROW(program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/wlan0_collide.nm"));
ASSERT_NO_THROW(result = result.flattenModules(smtSolverFactory));
EXPECT_EQ(1, result.getNumberOfModules());
EXPECT_EQ(180, result.getModule(0).getNumberOfCommands());
ASSERT_NO_THROW(program = program.flattenModules(smtSolverFactory));
EXPECT_EQ(1, program.getNumberOfModules());
EXPECT_EQ(180, program.getModule(0).getNumberOfCommands());
ASSERT_NO_THROW(program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/csma2_2.nm"));
ASSERT_NO_THROW(program = program.flattenModules(smtSolverFactory));
EXPECT_EQ(1, program.getNumberOfModules());
EXPECT_EQ(71, program.getModule(0).getNumberOfCommands());
ASSERT_NO_THROW(program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/firewire.nm"));
ASSERT_NO_THROW(program = program.flattenModules(smtSolverFactory));
EXPECT_EQ(1, program.getNumberOfModules());
EXPECT_EQ(5026, program.getModule(0).getNumberOfCommands());
ASSERT_NO_THROW(program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/coin2.nm"));
ASSERT_NO_THROW(program = program.flattenModules(smtSolverFactory));
EXPECT_EQ(1, program.getNumberOfModules());
EXPECT_EQ(13, program.getModule(0).getNumberOfCommands());
ASSERT_NO_THROW(program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/parser/prism/two_dice.nm"));
ASSERT_NO_THROW(program = program.flattenModules(smtSolverFactory));
EXPECT_EQ(1, program.getNumberOfModules());
EXPECT_EQ(16, program.getModule(0).getNumberOfCommands());
} }
#endif #endif

Loading…
Cancel
Save