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.

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