25void testModelB(std::string programFile, std::string formulaAsString, std::string constantsAsString) {
27 program = program.
preprocess(constantsAsString);
28 std::vector<std::shared_ptr<const storm::logic::Formula>> formulas =
30 std::shared_ptr<storm::models::sparse::Dtmc<storm::RationalFunction>> model =
41 auto simpleDtmc = binaryDtmcTransformer.
transform(*dtmc,
true);
53 std::vector<std::map<storm::RationalFunctionVariable, storm::RationalFunctionCoefficient>> testInstantiations;
54 std::map<storm::RationalFunctionVariable, storm::RationalFunctionCoefficient> emptyInstantiation;
55 testInstantiations.push_back(emptyInstantiation);
56 for (
auto const& param : parameters) {
57 std::vector<std::map<storm::RationalFunctionVariable, storm::RationalFunctionCoefficient>> newInstantiations;
58 for (
auto point : testInstantiations) {
61 std::map<storm::RationalFunctionVariable, storm::RationalFunctionCoefficient> newMap(point);
63 newInstantiations.push_back(newMap);
66 testInstantiations = newInstantiations;
70 for (
auto const& instantiation : testInstantiations) {
71 auto result = modelChecker.
check(env, instantiation)->asExplicitQuantitativeCheckResult<storm::RationalNumber>()[initialStateModel];
72 auto resultSimple = modelCheckerSimple.
check(env, instantiation)->asExplicitQuantitativeCheckResult<storm::RationalNumber>()[initialStateModel];
82 auto resultPLA = pla->getBoundAtInitState(env, region[0], storm::OptimizationDirection::Minimize);
86 auto resultPLASimple = plaSimple->getBoundAtInitState(env, region[0], storm::OptimizationDirection::Minimize);
88 ASSERT_TRUE(resultPLA == resultPLASimple) <<
"Different PLA result with simplified DTMC";
91 for (uint64_t state = 0; state < simpleDtmc->getTransitionMatrix().getRowCount(); ++state) {
92 auto row = simpleDtmc->getTransitionMatrix().getRow(state);
94 std::set<storm::RationalFunctionVariable> variables;
96 for (
auto const& entry : row) {
97 for (
auto const& variable : entry.getValue().gatherVariables()) {
98 variables.emplace(variable);
102 if (variables.size() != 0) {
103 ASSERT_TRUE(variables.size() == 1);
104 auto parameter = *variables.begin();
107 std::shared_ptr<storm::RawPolynomialCache> cache;
108 for (
auto const& entry : row) {
109 if (!entry.getValue().isConstant()) {
110 cache = entry.getValue().nominator().pCache();
114 ASSERT_TRUE(cache !=
nullptr);
122 uint64_t seenOneMinusP = 0;
124 for (
auto const& entry : row) {
126 if (entry.getValue() == parameterRational) {
128 }
else if (entry.getValue() == oneMinusParameterRational) {
131 ASSERT_TRUE(
false) <<
"Value " << entry.getValue() <<
" is not simple";
136 ASSERT_TRUE(seenP == 1 && seenOneMinusP == 1) <<
"State " << state <<
" not simple";
Program preprocess(std::map< storm::expressions::Variable, storm::expressions::Expression > const &constantDefinitions) const
Preprocesses the program by defining the given constant definitions, substituting constants and formu...
std::shared_ptr< storm::models::sparse::Model< ValueType > > buildSparseModel(storm::storage::SymbolicModelDescription const &model, storm::builder::BuilderOptions const &options, typename storm::builder::ExplicitModelBuilder< ValueType >::Options const &explorationOptions=typename storm::builder::ExplicitModelBuilder< ValueType >::Options())
std::unique_ptr< storm::modelchecker::RegionModelChecker< ValueType > > initializeRegionModelChecker(Environment const &env, std::shared_ptr< storm::models::sparse::Model< ValueType > > const &model, storm::modelchecker::CheckTask< storm::logic::Formula, ValueType > const &task, storm::modelchecker::RegionCheckEngine engine, bool allowModelSimplification=true, storm::pars::analysis::GraphPreservationStatus graphPreservationStatus=storm::pars::analysis::GraphPreservationStatus::GraphPreserving, bool preconditionsValidated=false, MonotonicitySetting monotonicitySetting=MonotonicitySetting(), std::optional< std::pair< std::set< typename storm::storage::ParameterRegion< ValueType >::VariableType >, std::set< typename storm::storage::ParameterRegion< ValueType >::VariableType > > > monotoneParameters=std::nullopt)