You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

886 lines
60 KiB

  1. #include "gtest/gtest.h"
  2. #include "storm-config.h"
  3. #ifdef STORM_HAVE_MSAT
  4. #include "src/parser/PrismParser.h"
  5. #include "src/abstraction/prism/AbstractProgram.h"
  6. #include "src/storage/expressions/Expression.h"
  7. #include "src/storage/dd/Add.h"
  8. #include "src/storage/dd/Bdd.h"
  9. #include "src/models/symbolic/StandardRewardModel.h"
  10. #include "src/utility/solver.h"
  11. TEST(PrismMenuGame, DieAbstractionTest_Cudd) {
  12. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/die.pm");
  13. std::vector<storm::expressions::Expression> initialPredicates;
  14. storm::expressions::ExpressionManager& manager = program.getManager();
  15. initialPredicates.push_back(manager.getVariableExpression("s") < manager.integer(3));
  16. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::CUDD, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  17. storm::abstraction::MenuGame<storm::dd::DdType::CUDD, double> game = abstractProgram.getAbstractGame();
  18. EXPECT_EQ(10, game.getNumberOfTransitions());
  19. EXPECT_EQ(2, game.getNumberOfStates());
  20. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  21. }
  22. TEST(PrismMenuGame, DieAbstractionTest_Sylvan) {
  23. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/die.pm");
  24. std::vector<storm::expressions::Expression> initialPredicates;
  25. storm::expressions::ExpressionManager& manager = program.getManager();
  26. initialPredicates.push_back(manager.getVariableExpression("s") < manager.integer(3));
  27. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::Sylvan, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  28. storm::abstraction::MenuGame<storm::dd::DdType::Sylvan, double> game = abstractProgram.getAbstractGame();
  29. EXPECT_EQ(10, game.getNumberOfTransitions());
  30. EXPECT_EQ(2, game.getNumberOfStates());
  31. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  32. }
  33. TEST(PrismMenuGame, DieAbstractionAndRefinementTest_Cudd) {
  34. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/die.pm");
  35. std::vector<storm::expressions::Expression> initialPredicates;
  36. storm::expressions::ExpressionManager& manager = program.getManager();
  37. initialPredicates.push_back(manager.getVariableExpression("s") < manager.integer(3));
  38. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::CUDD, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  39. ASSERT_NO_THROW(abstractProgram.refine({manager.getVariableExpression("s") == manager.integer(7)}));
  40. storm::abstraction::MenuGame<storm::dd::DdType::CUDD, double> game = abstractProgram.getAbstractGame();
  41. EXPECT_EQ(10, game.getNumberOfTransitions());
  42. EXPECT_EQ(3, game.getNumberOfStates());
  43. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  44. }
  45. TEST(PrismMenuGame, DieAbstractionAndRefinementTest_Sylvan) {
  46. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/die.pm");
  47. std::vector<storm::expressions::Expression> initialPredicates;
  48. storm::expressions::ExpressionManager& manager = program.getManager();
  49. initialPredicates.push_back(manager.getVariableExpression("s") < manager.integer(3));
  50. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::Sylvan, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  51. ASSERT_NO_THROW(abstractProgram.refine({manager.getVariableExpression("s") == manager.integer(7)}));
  52. storm::abstraction::MenuGame<storm::dd::DdType::Sylvan, double> game = abstractProgram.getAbstractGame();
  53. EXPECT_EQ(10, game.getNumberOfTransitions());
  54. EXPECT_EQ(3, game.getNumberOfStates());
  55. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  56. }
  57. TEST(PrismMenuGame, DieFullAbstractionTest_Cudd) {
  58. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/die.pm");
  59. std::vector<storm::expressions::Expression> initialPredicates;
  60. storm::expressions::ExpressionManager& manager = program.getManager();
  61. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(0));
  62. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(1));
  63. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(2));
  64. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(3));
  65. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(4));
  66. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(5));
  67. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(6));
  68. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(7));
  69. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(0));
  70. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(1));
  71. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(2));
  72. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(3));
  73. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(4));
  74. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(5));
  75. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(6));
  76. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::CUDD, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  77. storm::abstraction::MenuGame<storm::dd::DdType::CUDD, double> game = abstractProgram.getAbstractGame();
  78. EXPECT_EQ(20, game.getNumberOfTransitions());
  79. EXPECT_EQ(13, game.getNumberOfStates());
  80. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  81. }
  82. TEST(PrismMenuGame, DieFullAbstractionTest_Sylvan) {
  83. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/die.pm");
  84. std::vector<storm::expressions::Expression> initialPredicates;
  85. storm::expressions::ExpressionManager& manager = program.getManager();
  86. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(0));
  87. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(1));
  88. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(2));
  89. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(3));
  90. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(4));
  91. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(5));
  92. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(6));
  93. initialPredicates.push_back(manager.getVariableExpression("s") == manager.integer(7));
  94. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(0));
  95. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(1));
  96. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(2));
  97. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(3));
  98. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(4));
  99. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(5));
  100. initialPredicates.push_back(manager.getVariableExpression("d") == manager.integer(6));
  101. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::Sylvan, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  102. storm::abstraction::MenuGame<storm::dd::DdType::Sylvan, double> game = abstractProgram.getAbstractGame();
  103. EXPECT_EQ(20, game.getNumberOfTransitions());
  104. EXPECT_EQ(13, game.getNumberOfStates());
  105. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  106. }
  107. TEST(PrismMenuGame, CrowdsAbstractionTest_Cudd) {
  108. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/crowds-5-5.pm");
  109. program = program.substituteConstants();
  110. std::vector<storm::expressions::Expression> initialPredicates;
  111. storm::expressions::ExpressionManager& manager = program.getManager();
  112. initialPredicates.push_back(manager.getVariableExpression("phase") < manager.integer(3));
  113. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::CUDD, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  114. storm::abstraction::MenuGame<storm::dd::DdType::CUDD, double> game = abstractProgram.getAbstractGame();
  115. EXPECT_EQ(11, game.getNumberOfTransitions());
  116. EXPECT_EQ(2, game.getNumberOfStates());
  117. EXPECT_EQ(1, game.getBottomStates().getNonZeroCount());
  118. }
  119. TEST(PrismMenuGame, CrowdsAbstractionTest_Sylvan) {
  120. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/crowds-5-5.pm");
  121. program = program.substituteConstants();
  122. std::vector<storm::expressions::Expression> initialPredicates;
  123. storm::expressions::ExpressionManager& manager = program.getManager();
  124. initialPredicates.push_back(manager.getVariableExpression("phase") < manager.integer(3));
  125. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::Sylvan, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  126. storm::abstraction::MenuGame<storm::dd::DdType::Sylvan, double> game = abstractProgram.getAbstractGame();
  127. EXPECT_EQ(11, game.getNumberOfTransitions());
  128. EXPECT_EQ(2, game.getNumberOfStates());
  129. EXPECT_EQ(1, game.getBottomStates().getNonZeroCount());
  130. }
  131. TEST(PrismMenuGame, CrowdsAbstractionAndRefinementTest_Cudd) {
  132. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/crowds-5-5.pm");
  133. program = program.substituteConstants();
  134. std::vector<storm::expressions::Expression> initialPredicates;
  135. storm::expressions::ExpressionManager& manager = program.getManager();
  136. initialPredicates.push_back(manager.getVariableExpression("phase") < manager.integer(3));
  137. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::CUDD, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  138. ASSERT_NO_THROW(abstractProgram.refine({manager.getVariableExpression("observe0") + manager.getVariableExpression("observe1") + manager.getVariableExpression("observe2") + manager.getVariableExpression("observe3") + manager.getVariableExpression("observe4") <= manager.getVariableExpression("runCount")}));
  139. storm::abstraction::MenuGame<storm::dd::DdType::CUDD, double> game = abstractProgram.getAbstractGame();
  140. EXPECT_EQ(28, game.getNumberOfTransitions());
  141. EXPECT_EQ(4, game.getNumberOfStates());
  142. EXPECT_EQ(2, game.getBottomStates().getNonZeroCount());
  143. }
  144. TEST(PrismMenuGame, CrowdsAbstractionAndRefinementTest_Sylvan) {
  145. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/crowds-5-5.pm");
  146. program = program.substituteConstants();
  147. std::vector<storm::expressions::Expression> initialPredicates;
  148. storm::expressions::ExpressionManager& manager = program.getManager();
  149. initialPredicates.push_back(manager.getVariableExpression("phase") < manager.integer(3));
  150. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::Sylvan, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  151. ASSERT_NO_THROW(abstractProgram.refine({manager.getVariableExpression("observe0") + manager.getVariableExpression("observe1") + manager.getVariableExpression("observe2") + manager.getVariableExpression("observe3") + manager.getVariableExpression("observe4") <= manager.getVariableExpression("runCount")}));
  152. storm::abstraction::MenuGame<storm::dd::DdType::Sylvan, double> game = abstractProgram.getAbstractGame();
  153. EXPECT_EQ(28, game.getNumberOfTransitions());
  154. EXPECT_EQ(4, game.getNumberOfStates());
  155. EXPECT_EQ(2, game.getBottomStates().getNonZeroCount());
  156. }
  157. TEST(PrismMenuGame, CrowdsFullAbstractionTest_Cudd) {
  158. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/crowds-5-5.pm");
  159. program = program.substituteConstants();
  160. std::vector<storm::expressions::Expression> initialPredicates;
  161. storm::expressions::ExpressionManager& manager = program.getManager();
  162. initialPredicates.push_back(manager.getVariableExpression("phase") == manager.integer(0));
  163. initialPredicates.push_back(manager.getVariableExpression("phase") == manager.integer(1));
  164. initialPredicates.push_back(manager.getVariableExpression("phase") == manager.integer(2));
  165. initialPredicates.push_back(manager.getVariableExpression("phase") == manager.integer(3));
  166. initialPredicates.push_back(manager.getVariableExpression("phase") == manager.integer(4));
  167. initialPredicates.push_back(manager.getVariableExpression("good"));
  168. initialPredicates.push_back(manager.getVariableExpression("runCount") == manager.integer(0));
  169. initialPredicates.push_back(manager.getVariableExpression("runCount") == manager.integer(1));
  170. initialPredicates.push_back(manager.getVariableExpression("runCount") == manager.integer(2));
  171. initialPredicates.push_back(manager.getVariableExpression("runCount") == manager.integer(3));
  172. initialPredicates.push_back(manager.getVariableExpression("runCount") == manager.integer(4));
  173. initialPredicates.push_back(manager.getVariableExpression("runCount") == manager.integer(5));
  174. initialPredicates.push_back(manager.getVariableExpression("observe0") == manager.integer(0));
  175. initialPredicates.push_back(manager.getVariableExpression("observe0") == manager.integer(1));
  176. initialPredicates.push_back(manager.getVariableExpression("observe0") == manager.integer(2));
  177. initialPredicates.push_back(manager.getVariableExpression("observe0") == manager.integer(3));
  178. initialPredicates.push_back(manager.getVariableExpression("observe0") == manager.integer(4));
  179. initialPredicates.push_back(manager.getVariableExpression("observe0") == manager.integer(5));
  180. initialPredicates.push_back(manager.getVariableExpression("observe1") == manager.integer(0));
  181. initialPredicates.push_back(manager.getVariableExpression("observe1") == manager.integer(1));
  182. initialPredicates.push_back(manager.getVariableExpression("observe1") == manager.integer(2));
  183. initialPredicates.push_back(manager.getVariableExpression("observe1") == manager.integer(3));
  184. initialPredicates.push_back(manager.getVariableExpression("observe1") == manager.integer(4));
  185. initialPredicates.push_back(manager.getVariableExpression("observe1") == manager.integer(5));
  186. initialPredicates.push_back(manager.getVariableExpression("observe2") == manager.integer(0));
  187. initialPredicates.push_back(manager.getVariableExpression("observe2") == manager.integer(1));
  188. initialPredicates.push_back(manager.getVariableExpression("observe2") == manager.integer(2));
  189. initialPredicates.push_back(manager.getVariableExpression("observe2") == manager.integer(3));
  190. initialPredicates.push_back(manager.getVariableExpression("observe2") == manager.integer(4));
  191. initialPredicates.push_back(manager.getVariableExpression("observe2") == manager.integer(5));
  192. initialPredicates.push_back(manager.getVariableExpression("observe3") == manager.integer(0));
  193. initialPredicates.push_back(manager.getVariableExpression("observe3") == manager.integer(1));
  194. initialPredicates.push_back(manager.getVariableExpression("observe3") == manager.integer(2));
  195. initialPredicates.push_back(manager.getVariableExpression("observe3") == manager.integer(3));
  196. initialPredicates.push_back(manager.getVariableExpression("observe3") == manager.integer(4));
  197. initialPredicates.push_back(manager.getVariableExpression("observe3") == manager.integer(5));
  198. initialPredicates.push_back(manager.getVariableExpression("observe4") == manager.integer(0));
  199. initialPredicates.push_back(manager.getVariableExpression("observe4") == manager.integer(1));
  200. initialPredicates.push_back(manager.getVariableExpression("observe4") == manager.integer(2));
  201. initialPredicates.push_back(manager.getVariableExpression("observe4") == manager.integer(3));
  202. initialPredicates.push_back(manager.getVariableExpression("observe4") == manager.integer(4));
  203. initialPredicates.push_back(manager.getVariableExpression("observe4") == manager.integer(5));
  204. initialPredicates.push_back(manager.getVariableExpression("lastSeen") == manager.integer(0));
  205. initialPredicates.push_back(manager.getVariableExpression("lastSeen") == manager.integer(1));
  206. initialPredicates.push_back(manager.getVariableExpression("lastSeen") == manager.integer(2));
  207. initialPredicates.push_back(manager.getVariableExpression("lastSeen") == manager.integer(3));
  208. initialPredicates.push_back(manager.getVariableExpression("lastSeen") == manager.integer(4));
  209. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::CUDD, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  210. storm::abstraction::MenuGame<storm::dd::DdType::CUDD, double> game = abstractProgram.getAbstractGame();
  211. EXPECT_EQ(15113, game.getNumberOfTransitions());
  212. EXPECT_EQ(8607, game.getNumberOfStates());
  213. EXPECT_EQ(1260, game.getBottomStates().getNonZeroCount());
  214. }
  215. TEST(PrismMenuGame, CrowdsFullAbstractionTest_Sylvan) {
  216. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/crowds-5-5.pm");
  217. program = program.substituteConstants();
  218. std::vector<storm::expressions::Expression> initialPredicates;
  219. storm::expressions::ExpressionManager& manager = program.getManager();
  220. initialPredicates.push_back(manager.getVariableExpression("phase") == manager.integer(0));
  221. initialPredicates.push_back(manager.getVariableExpression("phase") == manager.integer(1));
  222. initialPredicates.push_back(manager.getVariableExpression("phase") == manager.integer(2));
  223. initialPredicates.push_back(manager.getVariableExpression("phase") == manager.integer(3));
  224. initialPredicates.push_back(manager.getVariableExpression("phase") == manager.integer(4));
  225. initialPredicates.push_back(manager.getVariableExpression("good"));
  226. initialPredicates.push_back(manager.getVariableExpression("runCount") == manager.integer(0));
  227. initialPredicates.push_back(manager.getVariableExpression("runCount") == manager.integer(1));
  228. initialPredicates.push_back(manager.getVariableExpression("runCount") == manager.integer(2));
  229. initialPredicates.push_back(manager.getVariableExpression("runCount") == manager.integer(3));
  230. initialPredicates.push_back(manager.getVariableExpression("runCount") == manager.integer(4));
  231. initialPredicates.push_back(manager.getVariableExpression("runCount") == manager.integer(5));
  232. initialPredicates.push_back(manager.getVariableExpression("observe0") == manager.integer(0));
  233. initialPredicates.push_back(manager.getVariableExpression("observe0") == manager.integer(1));
  234. initialPredicates.push_back(manager.getVariableExpression("observe0") == manager.integer(2));
  235. initialPredicates.push_back(manager.getVariableExpression("observe0") == manager.integer(3));
  236. initialPredicates.push_back(manager.getVariableExpression("observe0") == manager.integer(4));
  237. initialPredicates.push_back(manager.getVariableExpression("observe0") == manager.integer(5));
  238. initialPredicates.push_back(manager.getVariableExpression("observe1") == manager.integer(0));
  239. initialPredicates.push_back(manager.getVariableExpression("observe1") == manager.integer(1));
  240. initialPredicates.push_back(manager.getVariableExpression("observe1") == manager.integer(2));
  241. initialPredicates.push_back(manager.getVariableExpression("observe1") == manager.integer(3));
  242. initialPredicates.push_back(manager.getVariableExpression("observe1") == manager.integer(4));
  243. initialPredicates.push_back(manager.getVariableExpression("observe1") == manager.integer(5));
  244. initialPredicates.push_back(manager.getVariableExpression("observe2") == manager.integer(0));
  245. initialPredicates.push_back(manager.getVariableExpression("observe2") == manager.integer(1));
  246. initialPredicates.push_back(manager.getVariableExpression("observe2") == manager.integer(2));
  247. initialPredicates.push_back(manager.getVariableExpression("observe2") == manager.integer(3));
  248. initialPredicates.push_back(manager.getVariableExpression("observe2") == manager.integer(4));
  249. initialPredicates.push_back(manager.getVariableExpression("observe2") == manager.integer(5));
  250. initialPredicates.push_back(manager.getVariableExpression("observe3") == manager.integer(0));
  251. initialPredicates.push_back(manager.getVariableExpression("observe3") == manager.integer(1));
  252. initialPredicates.push_back(manager.getVariableExpression("observe3") == manager.integer(2));
  253. initialPredicates.push_back(manager.getVariableExpression("observe3") == manager.integer(3));
  254. initialPredicates.push_back(manager.getVariableExpression("observe3") == manager.integer(4));
  255. initialPredicates.push_back(manager.getVariableExpression("observe3") == manager.integer(5));
  256. initialPredicates.push_back(manager.getVariableExpression("observe4") == manager.integer(0));
  257. initialPredicates.push_back(manager.getVariableExpression("observe4") == manager.integer(1));
  258. initialPredicates.push_back(manager.getVariableExpression("observe4") == manager.integer(2));
  259. initialPredicates.push_back(manager.getVariableExpression("observe4") == manager.integer(3));
  260. initialPredicates.push_back(manager.getVariableExpression("observe4") == manager.integer(4));
  261. initialPredicates.push_back(manager.getVariableExpression("observe4") == manager.integer(5));
  262. initialPredicates.push_back(manager.getVariableExpression("lastSeen") == manager.integer(0));
  263. initialPredicates.push_back(manager.getVariableExpression("lastSeen") == manager.integer(1));
  264. initialPredicates.push_back(manager.getVariableExpression("lastSeen") == manager.integer(2));
  265. initialPredicates.push_back(manager.getVariableExpression("lastSeen") == manager.integer(3));
  266. initialPredicates.push_back(manager.getVariableExpression("lastSeen") == manager.integer(4));
  267. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::Sylvan, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  268. storm::abstraction::MenuGame<storm::dd::DdType::Sylvan, double> game = abstractProgram.getAbstractGame();
  269. EXPECT_EQ(15113, game.getNumberOfTransitions());
  270. EXPECT_EQ(8607, game.getNumberOfStates());
  271. EXPECT_EQ(1260, game.getBottomStates().getNonZeroCount());
  272. }
  273. TEST(PrismMenuGame, TwoDiceAbstractionTest_Cudd) {
  274. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm");
  275. program = program.substituteConstants();
  276. program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
  277. std::vector<storm::expressions::Expression> initialPredicates;
  278. storm::expressions::ExpressionManager& manager = program.getManager();
  279. initialPredicates.push_back(manager.getVariableExpression("s1") < manager.integer(3));
  280. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(0));
  281. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::CUDD, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  282. storm::abstraction::MenuGame<storm::dd::DdType::CUDD, double> game = abstractProgram.getAbstractGame();
  283. EXPECT_EQ(34, game.getNumberOfTransitions());
  284. EXPECT_EQ(4, game.getNumberOfStates());
  285. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  286. }
  287. TEST(PrismMenuGame, TwoDiceAbstractionTest_Sylvan) {
  288. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm");
  289. program = program.substituteConstants();
  290. program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
  291. std::vector<storm::expressions::Expression> initialPredicates;
  292. storm::expressions::ExpressionManager& manager = program.getManager();
  293. initialPredicates.push_back(manager.getVariableExpression("s1") < manager.integer(3));
  294. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(0));
  295. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::Sylvan, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  296. storm::abstraction::MenuGame<storm::dd::DdType::Sylvan, double> game = abstractProgram.getAbstractGame();
  297. EXPECT_EQ(34, game.getNumberOfTransitions());
  298. EXPECT_EQ(4, game.getNumberOfStates());
  299. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  300. }
  301. TEST(PrismMenuGame, TwoDiceAbstractionAndRefinementTest_Cudd) {
  302. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm");
  303. program = program.substituteConstants();
  304. program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
  305. std::vector<storm::expressions::Expression> initialPredicates;
  306. storm::expressions::ExpressionManager& manager = program.getManager();
  307. initialPredicates.push_back(manager.getVariableExpression("s1") < manager.integer(3));
  308. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(0));
  309. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::CUDD, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  310. ASSERT_NO_THROW(abstractProgram.refine({manager.getVariableExpression("d1") + manager.getVariableExpression("d2") == manager.integer(7)}));
  311. storm::abstraction::MenuGame<storm::dd::DdType::CUDD, double> game = abstractProgram.getAbstractGame();
  312. EXPECT_EQ(164, game.getNumberOfTransitions());
  313. EXPECT_EQ(8, game.getNumberOfStates());
  314. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  315. }
  316. TEST(PrismMenuGame, TwoDiceAbstractionAndRefinementTest_Sylvan) {
  317. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm");
  318. program = program.substituteConstants();
  319. program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
  320. std::vector<storm::expressions::Expression> initialPredicates;
  321. storm::expressions::ExpressionManager& manager = program.getManager();
  322. initialPredicates.push_back(manager.getVariableExpression("s1") < manager.integer(3));
  323. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(0));
  324. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::CUDD, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  325. ASSERT_NO_THROW(abstractProgram.refine({manager.getVariableExpression("d1") + manager.getVariableExpression("d2") == manager.integer(7)}));
  326. storm::abstraction::MenuGame<storm::dd::DdType::CUDD, double> game = abstractProgram.getAbstractGame();
  327. EXPECT_EQ(164, game.getNumberOfTransitions());
  328. EXPECT_EQ(8, game.getNumberOfStates());
  329. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  330. }
  331. TEST(PrismMenuGame, TwoDiceFullAbstractionTest_Cudd) {
  332. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm");
  333. program = program.substituteConstants();
  334. program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
  335. std::vector<storm::expressions::Expression> initialPredicates;
  336. storm::expressions::ExpressionManager& manager = program.getManager();
  337. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(0));
  338. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(1));
  339. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(2));
  340. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(3));
  341. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(4));
  342. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(5));
  343. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(6));
  344. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(7));
  345. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(0));
  346. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(1));
  347. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(2));
  348. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(3));
  349. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(4));
  350. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(5));
  351. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(6));
  352. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(0));
  353. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(1));
  354. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(2));
  355. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(3));
  356. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(4));
  357. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(5));
  358. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(6));
  359. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(7));
  360. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(0));
  361. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(1));
  362. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(2));
  363. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(3));
  364. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(4));
  365. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(5));
  366. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(6));
  367. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::CUDD, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  368. storm::abstraction::MenuGame<storm::dd::DdType::CUDD, double> game = abstractProgram.getAbstractGame();
  369. EXPECT_EQ(436, game.getNumberOfTransitions());
  370. EXPECT_EQ(169, game.getNumberOfStates());
  371. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  372. }
  373. TEST(PrismMenuGame, TwoDiceFullAbstractionTest_Sylvan) {
  374. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/two_dice.nm");
  375. program = program.substituteConstants();
  376. program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
  377. std::vector<storm::expressions::Expression> initialPredicates;
  378. storm::expressions::ExpressionManager& manager = program.getManager();
  379. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(0));
  380. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(1));
  381. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(2));
  382. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(3));
  383. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(4));
  384. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(5));
  385. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(6));
  386. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(7));
  387. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(0));
  388. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(1));
  389. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(2));
  390. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(3));
  391. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(4));
  392. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(5));
  393. initialPredicates.push_back(manager.getVariableExpression("d1") == manager.integer(6));
  394. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(0));
  395. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(1));
  396. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(2));
  397. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(3));
  398. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(4));
  399. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(5));
  400. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(6));
  401. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(7));
  402. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(0));
  403. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(1));
  404. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(2));
  405. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(3));
  406. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(4));
  407. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(5));
  408. initialPredicates.push_back(manager.getVariableExpression("d2") == manager.integer(6));
  409. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::Sylvan, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  410. storm::abstraction::MenuGame<storm::dd::DdType::Sylvan, double> game = abstractProgram.getAbstractGame();
  411. EXPECT_EQ(436, game.getNumberOfTransitions());
  412. EXPECT_EQ(169, game.getNumberOfStates());
  413. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  414. }
  415. TEST(PrismMenuGame, WlanAbstractionTest_Cudd) {
  416. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm");
  417. program = program.substituteConstants();
  418. program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
  419. std::vector<storm::expressions::Expression> initialPredicates;
  420. storm::expressions::ExpressionManager& manager = program.getManager();
  421. initialPredicates.push_back(manager.getVariableExpression("s1") < manager.integer(5));
  422. initialPredicates.push_back(manager.getVariableExpression("bc1") == manager.integer(0));
  423. initialPredicates.push_back(manager.getVariableExpression("c1") == manager.getVariableExpression("c2"));
  424. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::CUDD, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  425. storm::abstraction::MenuGame<storm::dd::DdType::CUDD, double> game = abstractProgram.getAbstractGame();
  426. EXPECT_EQ(283, game.getNumberOfTransitions());
  427. EXPECT_EQ(4, game.getNumberOfStates());
  428. EXPECT_EQ(4, game.getBottomStates().getNonZeroCount());
  429. }
  430. TEST(PrismMenuGame, WlanAbstractionTest_Sylvan) {
  431. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm");
  432. program = program.substituteConstants();
  433. program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
  434. std::vector<storm::expressions::Expression> initialPredicates;
  435. storm::expressions::ExpressionManager& manager = program.getManager();
  436. initialPredicates.push_back(manager.getVariableExpression("s1") < manager.integer(5));
  437. initialPredicates.push_back(manager.getVariableExpression("bc1") == manager.integer(0));
  438. initialPredicates.push_back(manager.getVariableExpression("c1") == manager.getVariableExpression("c2"));
  439. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::Sylvan, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  440. storm::abstraction::MenuGame<storm::dd::DdType::Sylvan, double> game = abstractProgram.getAbstractGame();
  441. EXPECT_EQ(283, game.getNumberOfTransitions());
  442. EXPECT_EQ(4, game.getNumberOfStates());
  443. EXPECT_EQ(4, game.getBottomStates().getNonZeroCount());
  444. }
  445. TEST(PrismMenuGame, WlanAbstractionAndRefinementTest_Cudd) {
  446. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm");
  447. program = program.substituteConstants();
  448. program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
  449. std::vector<storm::expressions::Expression> initialPredicates;
  450. storm::expressions::ExpressionManager& manager = program.getManager();
  451. initialPredicates.push_back(manager.getVariableExpression("s1") < manager.integer(5));
  452. initialPredicates.push_back(manager.getVariableExpression("bc1") == manager.integer(0));
  453. initialPredicates.push_back(manager.getVariableExpression("c1") == manager.getVariableExpression("c2"));
  454. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::CUDD, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  455. ASSERT_NO_THROW(abstractProgram.refine({manager.getVariableExpression("backoff1") < manager.integer(7)}));
  456. storm::abstraction::MenuGame<storm::dd::DdType::CUDD, double> game = abstractProgram.getAbstractGame();
  457. EXPECT_EQ(568, game.getNumberOfTransitions());
  458. EXPECT_EQ(8, game.getNumberOfStates());
  459. EXPECT_EQ(8, game.getBottomStates().getNonZeroCount());
  460. }
  461. TEST(PrismMenuGame, WlanAbstractionAndRefinementTest_Sylvan) {
  462. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm");
  463. program = program.substituteConstants();
  464. program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
  465. std::vector<storm::expressions::Expression> initialPredicates;
  466. storm::expressions::ExpressionManager& manager = program.getManager();
  467. initialPredicates.push_back(manager.getVariableExpression("s1") < manager.integer(5));
  468. initialPredicates.push_back(manager.getVariableExpression("bc1") == manager.integer(0));
  469. initialPredicates.push_back(manager.getVariableExpression("c1") == manager.getVariableExpression("c2"));
  470. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::Sylvan, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  471. ASSERT_NO_THROW(abstractProgram.refine({manager.getVariableExpression("backoff1") < manager.integer(7)}));
  472. storm::abstraction::MenuGame<storm::dd::DdType::Sylvan, double> game = abstractProgram.getAbstractGame();
  473. EXPECT_EQ(568, game.getNumberOfTransitions());
  474. EXPECT_EQ(8, game.getNumberOfStates());
  475. EXPECT_EQ(8, game.getBottomStates().getNonZeroCount());
  476. }
  477. TEST(PrismMenuGame, WlanFullAbstractionTest_Cudd) {
  478. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm");
  479. program = program.substituteConstants();
  480. program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
  481. std::vector<storm::expressions::Expression> initialPredicates;
  482. storm::expressions::ExpressionManager& manager = program.getManager();
  483. initialPredicates.push_back(manager.getVariableExpression("col") == manager.integer(0));
  484. initialPredicates.push_back(manager.getVariableExpression("col") == manager.integer(1));
  485. initialPredicates.push_back(manager.getVariableExpression("col") == manager.integer(2));
  486. initialPredicates.push_back(manager.getVariableExpression("c1") == manager.integer(0));
  487. initialPredicates.push_back(manager.getVariableExpression("c1") == manager.integer(1));
  488. initialPredicates.push_back(manager.getVariableExpression("c1") == manager.integer(2));
  489. initialPredicates.push_back(manager.getVariableExpression("c2") == manager.integer(0));
  490. initialPredicates.push_back(manager.getVariableExpression("c2") == manager.integer(1));
  491. initialPredicates.push_back(manager.getVariableExpression("c2") == manager.integer(2));
  492. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(0));
  493. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(1));
  494. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(2));
  495. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(3));
  496. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(4));
  497. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(5));
  498. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(6));
  499. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(7));
  500. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(1));
  501. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(2));
  502. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(3));
  503. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(4));
  504. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(5));
  505. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(6));
  506. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(7));
  507. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(8));
  508. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(9));
  509. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(10));
  510. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(11));
  511. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(12));
  512. initialPredicates.push_back(manager.getVariableExpression("slot1") == manager.integer(0));
  513. initialPredicates.push_back(manager.getVariableExpression("slot1") == manager.integer(1));
  514. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(0));
  515. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(1));
  516. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(2));
  517. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(3));
  518. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(4));
  519. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(5));
  520. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(6));
  521. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(7));
  522. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(8));
  523. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(9));
  524. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(10));
  525. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(11));
  526. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(12));
  527. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(13));
  528. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(14));
  529. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(15));
  530. initialPredicates.push_back(manager.getVariableExpression("bc1") == manager.integer(0));
  531. initialPredicates.push_back(manager.getVariableExpression("bc1") == manager.integer(1));
  532. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(0));
  533. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(1));
  534. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(2));
  535. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(3));
  536. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(4));
  537. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(5));
  538. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(6));
  539. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(7));
  540. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(1));
  541. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(2));
  542. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(3));
  543. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(4));
  544. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(5));
  545. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(6));
  546. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(7));
  547. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(8));
  548. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(9));
  549. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(10));
  550. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(11));
  551. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(12));
  552. initialPredicates.push_back(manager.getVariableExpression("slot2") == manager.integer(0));
  553. initialPredicates.push_back(manager.getVariableExpression("slot2") == manager.integer(1));
  554. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(0));
  555. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(1));
  556. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(2));
  557. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(3));
  558. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(4));
  559. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(5));
  560. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(6));
  561. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(7));
  562. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(8));
  563. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(9));
  564. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(10));
  565. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(11));
  566. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(12));
  567. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(13));
  568. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(14));
  569. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(15));
  570. initialPredicates.push_back(manager.getVariableExpression("bc2") == manager.integer(0));
  571. initialPredicates.push_back(manager.getVariableExpression("bc2") == manager.integer(1));
  572. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::CUDD, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  573. storm::abstraction::MenuGame<storm::dd::DdType::CUDD, double> game = abstractProgram.getAbstractGame();
  574. EXPECT_EQ(9503, game.getNumberOfTransitions());
  575. EXPECT_EQ(5523, game.getNumberOfStates());
  576. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  577. }
  578. TEST(PrismMenuGame, WlanFullAbstractionTest_Sylvan) {
  579. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/wlan0-2-4.nm");
  580. program = program.substituteConstants();
  581. program = program.flattenModules(std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>());
  582. std::vector<storm::expressions::Expression> initialPredicates;
  583. storm::expressions::ExpressionManager& manager = program.getManager();
  584. initialPredicates.push_back(manager.getVariableExpression("col") == manager.integer(0));
  585. initialPredicates.push_back(manager.getVariableExpression("col") == manager.integer(1));
  586. initialPredicates.push_back(manager.getVariableExpression("col") == manager.integer(2));
  587. initialPredicates.push_back(manager.getVariableExpression("c1") == manager.integer(0));
  588. initialPredicates.push_back(manager.getVariableExpression("c1") == manager.integer(1));
  589. initialPredicates.push_back(manager.getVariableExpression("c1") == manager.integer(2));
  590. initialPredicates.push_back(manager.getVariableExpression("c2") == manager.integer(0));
  591. initialPredicates.push_back(manager.getVariableExpression("c2") == manager.integer(1));
  592. initialPredicates.push_back(manager.getVariableExpression("c2") == manager.integer(2));
  593. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(0));
  594. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(1));
  595. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(2));
  596. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(3));
  597. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(4));
  598. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(5));
  599. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(6));
  600. initialPredicates.push_back(manager.getVariableExpression("x1") == manager.integer(7));
  601. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(1));
  602. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(2));
  603. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(3));
  604. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(4));
  605. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(5));
  606. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(6));
  607. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(7));
  608. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(8));
  609. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(9));
  610. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(10));
  611. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(11));
  612. initialPredicates.push_back(manager.getVariableExpression("s1") == manager.integer(12));
  613. initialPredicates.push_back(manager.getVariableExpression("slot1") == manager.integer(0));
  614. initialPredicates.push_back(manager.getVariableExpression("slot1") == manager.integer(1));
  615. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(0));
  616. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(1));
  617. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(2));
  618. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(3));
  619. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(4));
  620. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(5));
  621. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(6));
  622. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(7));
  623. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(8));
  624. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(9));
  625. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(10));
  626. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(11));
  627. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(12));
  628. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(13));
  629. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(14));
  630. initialPredicates.push_back(manager.getVariableExpression("backoff1") == manager.integer(15));
  631. initialPredicates.push_back(manager.getVariableExpression("bc1") == manager.integer(0));
  632. initialPredicates.push_back(manager.getVariableExpression("bc1") == manager.integer(1));
  633. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(0));
  634. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(1));
  635. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(2));
  636. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(3));
  637. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(4));
  638. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(5));
  639. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(6));
  640. initialPredicates.push_back(manager.getVariableExpression("x2") == manager.integer(7));
  641. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(1));
  642. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(2));
  643. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(3));
  644. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(4));
  645. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(5));
  646. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(6));
  647. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(7));
  648. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(8));
  649. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(9));
  650. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(10));
  651. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(11));
  652. initialPredicates.push_back(manager.getVariableExpression("s2") == manager.integer(12));
  653. initialPredicates.push_back(manager.getVariableExpression("slot2") == manager.integer(0));
  654. initialPredicates.push_back(manager.getVariableExpression("slot2") == manager.integer(1));
  655. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(0));
  656. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(1));
  657. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(2));
  658. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(3));
  659. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(4));
  660. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(5));
  661. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(6));
  662. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(7));
  663. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(8));
  664. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(9));
  665. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(10));
  666. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(11));
  667. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(12));
  668. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(13));
  669. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(14));
  670. initialPredicates.push_back(manager.getVariableExpression("backoff2") == manager.integer(15));
  671. initialPredicates.push_back(manager.getVariableExpression("bc2") == manager.integer(0));
  672. initialPredicates.push_back(manager.getVariableExpression("bc2") == manager.integer(1));
  673. storm::abstraction::prism::AbstractProgram<storm::dd::DdType::Sylvan, double> abstractProgram(program.getManager(), program, initialPredicates, std::make_unique<storm::utility::solver::MathsatSmtSolverFactory>(), false);
  674. storm::abstraction::MenuGame<storm::dd::DdType::Sylvan, double> game = abstractProgram.getAbstractGame();
  675. EXPECT_EQ(9503, game.getNumberOfTransitions());
  676. EXPECT_EQ(5523, game.getNumberOfStates());
  677. EXPECT_EQ(0, game.getBottomStates().getNonZeroCount());
  678. }
  679. #endif