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.

324 lines
25 KiB

  1. #include "gtest/gtest.h"
  2. #include "storm-config.h"
  3. #include "src/settings/SettingMemento.h"
  4. #include "src/parser/PrismParser.h"
  5. #include "src/parser/FormulaParser.h"
  6. #include "src/logic/Formulas.h"
  7. #include "src/builder/DdPrismModelBuilder.h"
  8. #include "src/storage/dd/DdType.h"
  9. #include "src/utility/solver.h"
  10. #include "src/modelchecker/csl/HybridCtmcCslModelChecker.h"
  11. #include "src/modelchecker/results/HybridQuantitativeCheckResult.h"
  12. #include "src/modelchecker/results/SymbolicQualitativeCheckResult.h"
  13. #include "src/modelchecker/results/SymbolicQuantitativeCheckResult.h"
  14. #include "src/settings/SettingsManager.h"
  15. TEST(GmmxxHybridCtmcCslModelCheckerTest, Cluster) {
  16. // Set the PRISM compatibility mode temporarily. It is set to its old value once the returned object is destructed.
  17. std::unique_ptr<storm::settings::SettingMemento> enablePrismCompatibility = storm::settings::mutableGeneralSettings().overridePrismCompatibilityMode(true);
  18. // Parse the model description.
  19. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/cluster2.sm");
  20. storm::parser::FormulaParser formulaParser(program.getManager().getSharedPointer());
  21. std::shared_ptr<storm::logic::Formula> formula(nullptr);
  22. // Build the model.
  23. #ifdef WINDOWS
  24. storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>::Options options;
  25. #else
  26. typename storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>::Options options;
  27. #endif
  28. options.buildRewards = true;
  29. options.rewardModelName = "num_repairs";
  30. std::shared_ptr<storm::models::symbolic::Model<storm::dd::DdType::CUDD>> model = storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>::translateProgram(program, options);
  31. ASSERT_EQ(storm::models::ModelType::Ctmc, model->getType());
  32. std::shared_ptr<storm::models::symbolic::Ctmc<storm::dd::DdType::CUDD>> ctmc = model->as<storm::models::symbolic::Ctmc<storm::dd::DdType::CUDD>>();
  33. // Create model checker.
  34. storm::modelchecker::HybridCtmcCslModelChecker<storm::dd::DdType::CUDD, double> modelchecker(*ctmc, std::unique_ptr<storm::utility::solver::LinearEquationSolverFactory<double>>(new storm::utility::solver::GmmxxLinearEquationSolverFactory<double>()));
  35. // Start checking properties.
  36. formula = formulaParser.parseFromString("P=? [ F<=100 !\"minimum\"]");
  37. std::unique_ptr<storm::modelchecker::CheckResult> checkResult = modelchecker.check(*formula);
  38. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  39. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  40. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult1 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  41. EXPECT_NEAR(5.5461254704419085E-5, quantitativeCheckResult1.getMin(), storm::settings::generalSettings().getPrecision());
  42. EXPECT_NEAR(5.5461254704419085E-5, quantitativeCheckResult1.getMax(), storm::settings::generalSettings().getPrecision());
  43. formula = formulaParser.parseFromString("P=? [ F[100,100] !\"minimum\"]");
  44. checkResult = modelchecker.check(*formula);
  45. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  46. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  47. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult2 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  48. EXPECT_NEAR(2.3397873548343415E-6, quantitativeCheckResult2.getMin(), storm::settings::generalSettings().getPrecision());
  49. EXPECT_NEAR(2.3397873548343415E-6, quantitativeCheckResult2.getMax(), storm::settings::generalSettings().getPrecision());
  50. formula = formulaParser.parseFromString("P=? [ F[100,2000] !\"minimum\"]");
  51. checkResult = modelchecker.check(*formula);
  52. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  53. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  54. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult3 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  55. EXPECT_NEAR(0.001105335651670241, quantitativeCheckResult3.getMin(), storm::settings::generalSettings().getPrecision());
  56. EXPECT_NEAR(0.001105335651670241, quantitativeCheckResult3.getMax(), storm::settings::generalSettings().getPrecision());
  57. formula = formulaParser.parseFromString("P=? [ \"minimum\" U<=10 \"premium\"]");
  58. checkResult = modelchecker.check(*formula);
  59. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  60. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  61. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult4 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  62. EXPECT_NEAR(1, quantitativeCheckResult4.getMin(), storm::settings::generalSettings().getPrecision());
  63. EXPECT_NEAR(1, quantitativeCheckResult4.getMax(), storm::settings::generalSettings().getPrecision());
  64. formula = formulaParser.parseFromString("P=? [ !\"minimum\" U[1,inf] \"minimum\"]");
  65. checkResult = modelchecker.check(*formula);
  66. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  67. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  68. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult5 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  69. EXPECT_NEAR(0, quantitativeCheckResult5.getMin(), storm::settings::generalSettings().getPrecision());
  70. EXPECT_NEAR(0, quantitativeCheckResult5.getMax(), storm::settings::generalSettings().getPrecision());
  71. formula = formulaParser.parseFromString("P=? [ \"minimum\" U[1,inf] !\"minimum\"]");
  72. checkResult = modelchecker.check(*formula);
  73. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  74. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  75. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult6 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  76. EXPECT_NEAR(0.9999999033633374, quantitativeCheckResult6.getMin(), storm::settings::generalSettings().getPrecision());
  77. EXPECT_NEAR(0.9999999033633374, quantitativeCheckResult6.getMax(), storm::settings::generalSettings().getPrecision());
  78. formula = formulaParser.parseFromString("R=? [C<=100]");
  79. checkResult = modelchecker.check(*formula);
  80. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  81. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  82. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult7 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  83. EXPECT_NEAR(0.8602815057967503, quantitativeCheckResult7.getMin(), storm::settings::generalSettings().getPrecision());
  84. EXPECT_NEAR(0.8602815057967503, quantitativeCheckResult7.getMax(), storm::settings::generalSettings().getPrecision());
  85. formula = formulaParser.parseFromString("LRA=? [\"minimum\"]");
  86. checkResult = modelchecker.check(*formula);
  87. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  88. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult8 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  89. EXPECT_NEAR(0.99999766034263426, quantitativeCheckResult8.getMin(), storm::settings::generalSettings().getPrecision());
  90. EXPECT_NEAR(0.99999766034263426, quantitativeCheckResult8.getMax(), storm::settings::generalSettings().getPrecision());
  91. }
  92. TEST(GmmxxHybridCtmcCslModelCheckerTest, Embedded) {
  93. // Set the PRISM compatibility mode temporarily. It is set to its old value once the returned object is destructed.
  94. std::unique_ptr<storm::settings::SettingMemento> enablePrismCompatibility = storm::settings::mutableGeneralSettings().overridePrismCompatibilityMode(true);
  95. // Parse the model description.
  96. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/embedded2.sm");
  97. storm::parser::FormulaParser formulaParser(program.getManager().getSharedPointer());
  98. std::shared_ptr<storm::logic::Formula> formula(nullptr);
  99. // Build the model.
  100. #ifdef WINDOWS
  101. storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>::Options options;
  102. #else
  103. typename storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>::Options options;
  104. #endif
  105. options.buildRewards = true;
  106. options.rewardModelName = "up";
  107. std::shared_ptr<storm::models::symbolic::Model<storm::dd::DdType::CUDD>> model = storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>::translateProgram(program, options);
  108. ASSERT_EQ(storm::models::ModelType::Ctmc, model->getType());
  109. std::shared_ptr<storm::models::symbolic::Ctmc<storm::dd::DdType::CUDD>> ctmc = model->as<storm::models::symbolic::Ctmc<storm::dd::DdType::CUDD>>();
  110. // Create model checker.
  111. storm::modelchecker::HybridCtmcCslModelChecker<storm::dd::DdType::CUDD, double> modelchecker(*ctmc, std::unique_ptr<storm::utility::solver::LinearEquationSolverFactory<double>>(new storm::utility::solver::GmmxxLinearEquationSolverFactory<double>()));
  112. // Start checking properties.
  113. formula = formulaParser.parseFromString("P=? [ F<=10000 \"down\"]");
  114. std::unique_ptr<storm::modelchecker::CheckResult> checkResult = modelchecker.check(*formula);
  115. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  116. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  117. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult1 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  118. EXPECT_NEAR(0.0019216435246119591, quantitativeCheckResult1.getMin(), storm::settings::generalSettings().getPrecision());
  119. EXPECT_NEAR(0.0019216435246119591, quantitativeCheckResult1.getMax(), storm::settings::generalSettings().getPrecision());
  120. formula = formulaParser.parseFromString("P=? [ !\"down\" U<=10000 \"fail_actuators\"]");
  121. checkResult = modelchecker.check(*formula);
  122. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  123. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  124. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult2 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  125. EXPECT_NEAR(3.7079151806696567E-6, quantitativeCheckResult2.getMin(), storm::settings::generalSettings().getPrecision());
  126. EXPECT_NEAR(3.7079151806696567E-6, quantitativeCheckResult2.getMax(), storm::settings::generalSettings().getPrecision());
  127. formula = formulaParser.parseFromString("P=? [ !\"down\" U<=10000 \"fail_io\"]");
  128. checkResult = modelchecker.check(*formula);
  129. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  130. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  131. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult3 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  132. EXPECT_NEAR(0.001556839327673734, quantitativeCheckResult3.getMin(), storm::settings::generalSettings().getPrecision());
  133. EXPECT_NEAR(0.001556839327673734, quantitativeCheckResult3.getMax(), storm::settings::generalSettings().getPrecision());
  134. formula = formulaParser.parseFromString("P=? [ !\"down\" U<=10000 \"fail_sensors\"]");
  135. checkResult = modelchecker.check(*formula);
  136. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  137. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  138. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult4 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  139. EXPECT_NEAR(4.429620626755424E-5, quantitativeCheckResult4.getMin(), storm::settings::generalSettings().getPrecision());
  140. EXPECT_NEAR(4.429620626755424E-5, quantitativeCheckResult4.getMax(), storm::settings::generalSettings().getPrecision());
  141. formula = formulaParser.parseFromString("R=? [C<=10000]");
  142. checkResult = modelchecker.check(*formula);
  143. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  144. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  145. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult5 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  146. EXPECT_NEAR(2.7745274082080154, quantitativeCheckResult5.getMin(), storm::settings::generalSettings().getPrecision());
  147. EXPECT_NEAR(2.7745274082080154, quantitativeCheckResult5.getMax(), storm::settings::generalSettings().getPrecision());
  148. formula = formulaParser.parseFromString("LRA=? [\"fail_sensors\"]");
  149. checkResult = modelchecker.check(*formula);
  150. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  151. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult6 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  152. EXPECT_NEAR(0.934586179, quantitativeCheckResult6.getMin(), storm::settings::generalSettings().getPrecision());
  153. EXPECT_NEAR(0.934586179, quantitativeCheckResult6.getMax(), storm::settings::generalSettings().getPrecision());
  154. }
  155. TEST(GmmxxHybridCtmcCslModelCheckerTest, Polling) {
  156. // Set the PRISM compatibility mode temporarily. It is set to its old value once the returned object is destructed.
  157. std::unique_ptr<storm::settings::SettingMemento> enablePrismCompatibility = storm::settings::mutableGeneralSettings().overridePrismCompatibilityMode(true);
  158. // Parse the model description.
  159. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/polling2.sm");
  160. storm::parser::FormulaParser formulaParser(program.getManager().getSharedPointer());
  161. std::shared_ptr<storm::logic::Formula> formula(nullptr);
  162. // Build the model.
  163. std::shared_ptr<storm::models::symbolic::Model<storm::dd::DdType::CUDD>> model = storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>::translateProgram(program);
  164. ASSERT_EQ(storm::models::ModelType::Ctmc, model->getType());
  165. std::shared_ptr<storm::models::symbolic::Ctmc<storm::dd::DdType::CUDD>> ctmc = model->as<storm::models::symbolic::Ctmc<storm::dd::DdType::CUDD>>();
  166. // Create model checker.
  167. storm::modelchecker::HybridCtmcCslModelChecker<storm::dd::DdType::CUDD, double> modelchecker(*ctmc, std::unique_ptr<storm::utility::solver::LinearEquationSolverFactory<double>>(new storm::utility::solver::GmmxxLinearEquationSolverFactory<double>()));
  168. // Start checking properties.
  169. formula = formulaParser.parseFromString("P=?[ F<=10 \"target\"]");
  170. std::unique_ptr<storm::modelchecker::CheckResult> checkResult = modelchecker.check(*formula);
  171. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  172. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  173. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult1 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  174. EXPECT_NEAR(1, quantitativeCheckResult1.getMin(), storm::settings::generalSettings().getPrecision());
  175. EXPECT_NEAR(1, quantitativeCheckResult1.getMax(), storm::settings::generalSettings().getPrecision());
  176. formula = formulaParser.parseFromString("LRA=? [\"target\"]");
  177. checkResult = modelchecker.check(*formula);
  178. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  179. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult2 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  180. EXPECT_NEAR(0.20079750055570736, quantitativeCheckResult2.getMin(), storm::settings::generalSettings().getPrecision());
  181. EXPECT_NEAR(0.20079750055570736, quantitativeCheckResult2.getMax(), storm::settings::generalSettings().getPrecision());
  182. }
  183. TEST(GmmxxHybridCtmcCslModelCheckerTest, Fms) {
  184. // Set the PRISM compatibility mode temporarily. It is set to its old value once the returned object is destructed.
  185. std::unique_ptr<storm::settings::SettingMemento> enablePrismCompatibility = storm::settings::mutableGeneralSettings().overridePrismCompatibilityMode(true);
  186. // No properties to check at this point.
  187. }
  188. TEST(GmmxxHybridCtmcCslModelCheckerTest, Tandem) {
  189. // Set the PRISM compatibility mode temporarily. It is set to its old value once the returned object is destructed.
  190. std::unique_ptr<storm::settings::SettingMemento> enablePrismCompatibility = storm::settings::mutableGeneralSettings().overridePrismCompatibilityMode(true);
  191. // Parse the model description.
  192. storm::prism::Program program = storm::parser::PrismParser::parse(STORM_CPP_TESTS_BASE_PATH "/functional/builder/tandem5.sm");
  193. storm::parser::FormulaParser formulaParser(program.getManager().getSharedPointer());
  194. std::shared_ptr<storm::logic::Formula> formula(nullptr);
  195. // Build the model with the customers reward structure.
  196. #ifdef WINDOWS
  197. storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>::Options options;
  198. #else
  199. typename storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>::Options options;
  200. #endif
  201. options.buildRewards = true;
  202. options.rewardModelName = "customers";
  203. std::shared_ptr<storm::models::symbolic::Model<storm::dd::DdType::CUDD>> model = storm::builder::DdPrismModelBuilder<storm::dd::DdType::CUDD>::translateProgram(program, options);
  204. ASSERT_EQ(storm::models::ModelType::Ctmc, model->getType());
  205. std::shared_ptr<storm::models::symbolic::Ctmc<storm::dd::DdType::CUDD>> ctmc = model->as<storm::models::symbolic::Ctmc<storm::dd::DdType::CUDD>>();
  206. // Create model checker.
  207. storm::modelchecker::HybridCtmcCslModelChecker<storm::dd::DdType::CUDD, double> modelchecker(*ctmc, std::unique_ptr<storm::utility::solver::LinearEquationSolverFactory<double>>(new storm::utility::solver::GmmxxLinearEquationSolverFactory<double>()));
  208. // Start checking properties.
  209. formula = formulaParser.parseFromString("P=? [ F<=10 \"network_full\" ]");
  210. std::unique_ptr<storm::modelchecker::CheckResult> checkResult = modelchecker.check(*formula);
  211. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  212. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  213. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult1 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  214. EXPECT_NEAR(0.015446370562428037, quantitativeCheckResult1.getMin(), storm::settings::generalSettings().getPrecision());
  215. EXPECT_NEAR(0.015446370562428037, quantitativeCheckResult1.getMax(), storm::settings::generalSettings().getPrecision());
  216. formula = formulaParser.parseFromString("P=? [ F<=10 \"first_queue_full\" ]");
  217. checkResult = modelchecker.check(*formula);
  218. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  219. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  220. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult2 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  221. EXPECT_NEAR(0.999999837225515, quantitativeCheckResult2.getMin(), storm::settings::generalSettings().getPrecision());
  222. EXPECT_NEAR(0.999999837225515, quantitativeCheckResult2.getMax(), storm::settings::generalSettings().getPrecision());
  223. formula = formulaParser.parseFromString("P=? [\"second_queue_full\" U<=1 !\"second_queue_full\"]");
  224. checkResult = modelchecker.check(*formula);
  225. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  226. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  227. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult3 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  228. EXPECT_NEAR(1, quantitativeCheckResult3.getMin(), storm::settings::generalSettings().getPrecision());
  229. EXPECT_NEAR(1, quantitativeCheckResult3.getMax(), storm::settings::generalSettings().getPrecision());
  230. formula = formulaParser.parseFromString("R=? [I=10]");
  231. checkResult = modelchecker.check(*formula);
  232. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  233. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  234. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult4 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  235. EXPECT_NEAR(5.679243850315877, quantitativeCheckResult4.getMin(), storm::settings::generalSettings().getPrecision());
  236. EXPECT_NEAR(5.679243850315877, quantitativeCheckResult4.getMax(), storm::settings::generalSettings().getPrecision());
  237. formula = formulaParser.parseFromString("R=? [C<=10]");
  238. checkResult = modelchecker.check(*formula);
  239. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  240. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  241. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult5 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  242. EXPECT_NEAR(55.44792186036232, quantitativeCheckResult5.getMin(), storm::settings::generalSettings().getPrecision());
  243. EXPECT_NEAR(55.44792186036232, quantitativeCheckResult5.getMax(), storm::settings::generalSettings().getPrecision());
  244. formula = formulaParser.parseFromString("R=? [F \"first_queue_full\"&\"second_queue_full\"]");
  245. checkResult = modelchecker.check(*formula);
  246. ASSERT_TRUE(checkResult->isHybridQuantitativeCheckResult());
  247. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  248. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult6 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  249. EXPECT_NEAR(262.85103498583413, quantitativeCheckResult6.getMin(), storm::settings::generalSettings().getPrecision());
  250. EXPECT_NEAR(262.85103498583413, quantitativeCheckResult6.getMax(), storm::settings::generalSettings().getPrecision());
  251. formula = formulaParser.parseFromString("LRA=? [\"first_queue_full\"]");
  252. checkResult = modelchecker.check(*formula);
  253. checkResult->filter(storm::modelchecker::SymbolicQualitativeCheckResult<storm::dd::DdType::CUDD>(ctmc->getReachableStates(), ctmc->getInitialStates()));
  254. storm::modelchecker::HybridQuantitativeCheckResult<storm::dd::DdType::CUDD> quantitativeCheckResult7 = checkResult->asHybridQuantitativeCheckResult<storm::dd::DdType::CUDD>();
  255. EXPECT_NEAR(0.9100373532, quantitativeCheckResult7.getMin(), storm::settings::generalSettings().getPrecision());
  256. EXPECT_NEAR(0.9100373532, quantitativeCheckResult7.getMax(), storm::settings::generalSettings().getPrecision());
  257. }