|
@ -808,4 +808,52 @@ namespace { |
|
|
#endif
|
|
|
#endif
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TYPED_TEST(DtmcPrctlModelCheckerTest, HOAProbabilitiesDie) { |
|
|
|
|
|
// "P=? [(X s>0) U (s=7 & d=2)]"
|
|
|
|
|
|
std::string formulasString = "P=?[HOA: {\"" STORM_TEST_RESOURCES_DIR "/hoa/automaton_UXp0p1.hoa\", \"p0\" -> (s>0), \"p1\" -> (s=7 & d=2) }]"; |
|
|
|
|
|
// "P=? [(X s>0) U (d=4 | d=2)]"
|
|
|
|
|
|
formulasString += "; P=?[HOA: {\"" STORM_TEST_RESOURCES_DIR "/hoa/automaton_UXp0p1.hoa\", \"p0\" -> (s>0), \"p1\" -> (d=4 | d=2) }]"; |
|
|
|
|
|
// "P=? [ (F s=4) & (X \"three\")]"
|
|
|
|
|
|
formulasString += "; P=?[HOA: {\"" STORM_TEST_RESOURCES_DIR "/hoa/automaton_Fandp0Xp1.hoa\", \"p0\" -> (s=4), \"p1\" -> \"three\" }]"; |
|
|
|
|
|
// "P=? [ (F s=6) & (X \"done\")]"
|
|
|
|
|
|
formulasString += "; P=?[HOA: {\"" STORM_TEST_RESOURCES_DIR "/hoa/automaton_Fandp0Xp1.hoa\", \"p0\" -> (s=6), \"p1\" -> \"done\" }]"; |
|
|
|
|
|
// "P=? [ (F s=6) & (X !\"done\")]"
|
|
|
|
|
|
formulasString += "; P=?[HOA: {\"" STORM_TEST_RESOURCES_DIR "/hoa/automaton_Fandp0Xp1.hoa\", \"p0\" -> (s=6), \"p1\" -> !\"done\" }]"; |
|
|
|
|
|
// "P=? [ (F (s=4 | s=5)) & (X (\"three\" | \"five\"))]"
|
|
|
|
|
|
formulasString += "; P=?[HOA: {\"" STORM_TEST_RESOURCES_DIR "/hoa/automaton_Fandp0Xp1.hoa\", \"p0\" -> (s=4 | s=5), \"p1\" -> s=7 & (d=3 | d=5) }]"; |
|
|
|
|
|
|
|
|
|
|
|
auto modelFormulas = this->buildModelFormulas(STORM_TEST_RESOURCES_DIR "/dtmc/die.pm", formulasString); |
|
|
|
|
|
auto model = std::move(modelFormulas.first); |
|
|
|
|
|
auto tasks = this->getTasks(modelFormulas.second); |
|
|
|
|
|
EXPECT_EQ(13ul, model->getNumberOfStates()); |
|
|
|
|
|
EXPECT_EQ(20ul, model->getNumberOfTransitions()); |
|
|
|
|
|
ASSERT_EQ(model->getType(), storm::models::ModelType::Dtmc); |
|
|
|
|
|
auto checker = this->createModelChecker(model); |
|
|
|
|
|
std::unique_ptr<storm::modelchecker::CheckResult> result; |
|
|
|
|
|
|
|
|
|
|
|
// Not supported in all engines (Hybrid, PrismDd, JaniDd)
|
|
|
|
|
|
if (TypeParam::engine == DtmcEngine::PrismSparse || TypeParam::engine == DtmcEngine::JaniSparse || TypeParam::engine == DtmcEngine::JitSparse) { |
|
|
|
|
|
result = checker->check(tasks[0]); |
|
|
|
|
|
EXPECT_NEAR(this->parseNumber("1/6"), this->getQuantitativeResultAtInitialState(model, result), this->precision()); |
|
|
|
|
|
|
|
|
|
|
|
result = checker->check(tasks[1]); |
|
|
|
|
|
EXPECT_NEAR(this->parseNumber("1/3"), this->getQuantitativeResultAtInitialState(model, result), this->precision()); |
|
|
|
|
|
|
|
|
|
|
|
result = checker->check(tasks[2]); |
|
|
|
|
|
EXPECT_NEAR(this->parseNumber("1/6"), this->getQuantitativeResultAtInitialState(model, result), this->precision()); |
|
|
|
|
|
|
|
|
|
|
|
result = checker->check(tasks[3]); |
|
|
|
|
|
EXPECT_NEAR(this->parseNumber("1/6"), this->getQuantitativeResultAtInitialState(model, result), this->precision()); |
|
|
|
|
|
|
|
|
|
|
|
result = checker->check(tasks[4]); |
|
|
|
|
|
EXPECT_NEAR(this->parseNumber("1/8"), this->getQuantitativeResultAtInitialState(model, result), this->precision()); |
|
|
|
|
|
|
|
|
|
|
|
result = checker->check(tasks[5]); |
|
|
|
|
|
EXPECT_NEAR(this->parseNumber("1/3"), this->getQuantitativeResultAtInitialState(model, result), this->precision()); |
|
|
|
|
|
} else { |
|
|
|
|
|
EXPECT_FALSE(checker->canHandle(tasks[0])); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |