Storm 1.14.0.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
verification.h
Go to the documentation of this file.
1#pragma once
2
8
9namespace storm::gbar {
10namespace api {
11
12//
13// Verifying with Abstraction Refinement engine
14//
17 AbstractionRefinementOptions(std::vector<storm::expressions::Expression>&& constraints,
18 std::vector<std::vector<storm::expressions::Expression>>&& injectedRefinementPredicates)
20 // Intentionally left empty.
21 }
22
23 std::vector<storm::expressions::Expression> constraints;
24 std::vector<std::vector<storm::expressions::Expression>> injectedRefinementPredicates;
25};
26
27template<storm::dd::DdType DdType, typename ValueType>
28typename std::enable_if<!std::is_same<ValueType, storm::RationalFunction>::value, std::unique_ptr<storm::modelchecker::CheckResult>>::type
32 storm::gbar::modelchecker::GameBasedMdpModelCheckerOptions modelCheckerOptions(options.constraints, options.injectedRefinementPredicates);
33
34 std::unique_ptr<storm::modelchecker::CheckResult> result;
37 if (modelchecker.canHandle(task)) {
38 result = modelchecker.check(env, task);
39 }
42 if (modelchecker.canHandle(task)) {
43 result = modelchecker.check(env, task);
44 }
45 } else {
46 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException,
47 "The model type " << model.getModelType() << " is not supported by the abstraction refinement engine.");
48 }
49 return result;
50}
51
52template<storm::dd::DdType DdType, typename ValueType>
53typename std::enable_if<std::is_same<ValueType, storm::RationalFunction>::value, std::unique_ptr<storm::modelchecker::CheckResult>>::type
57 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "Abstraction-refinement engine does not support data type.");
58}
59
60template<storm::dd::DdType DdType, typename ValueType>
67
68template<storm::dd::DdType DdType, typename ValueType>
69typename std::enable_if<std::is_same<ValueType, double>::value, std::unique_ptr<storm::modelchecker::CheckResult>>::type verifyWithAbstractionRefinementEngine(
70 storm::Environment const& env, std::shared_ptr<storm::models::symbolic::Model<DdType, ValueType>> const& model,
72 std::unique_ptr<storm::modelchecker::CheckResult> result;
73 model->getManager().execute([&]() {
74 if (model->getType() == storm::models::ModelType::Dtmc) {
77 if (modelchecker.canHandle(task)) {
78 result = modelchecker.check(env, task);
79 }
80 } else if (model->getType() == storm::models::ModelType::Mdp) {
83 if (modelchecker.canHandle(task)) {
84 result = modelchecker.check(env, task);
85 }
86 } else {
87 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException,
88 "The model type " << model->getType() << " is not supported by the abstraction refinement engine.");
89 }
90 });
91 return result;
92}
93
94template<storm::dd::DdType DdType, typename ValueType>
95typename std::enable_if<!std::is_same<ValueType, double>::value, std::unique_ptr<storm::modelchecker::CheckResult>>::type verifyWithAbstractionRefinementEngine(
98 STORM_LOG_THROW(false, storm::exceptions::NotSupportedException, "Abstraction-refinement engine does not support data type.");
99}
100
101template<storm::dd::DdType DdType, typename ValueType>
102std::unique_ptr<storm::modelchecker::CheckResult> verifyWithAbstractionRefinementEngine(
103 std::shared_ptr<storm::models::symbolic::Model<DdType, ValueType>> const& model,
105 Environment env;
107}
108
109} // namespace api
110} // namespace storm::gbar
This class represents a discrete-time Markov chain.
Definition Dtmc.h:13
This class represents a discrete-time Markov decision process.
Definition Mdp.h:13
Base class for all symbolic models.
Definition Model.h:42
storm::expressions::ExpressionManager & getManager() const
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:28
std::enable_if<!std::is_same< ValueType, storm::RationalFunction >::value, std::unique_ptr< storm::modelchecker::CheckResult > >::type verifyWithAbstractionRefinementEngine(storm::Environment const &env, storm::storage::SymbolicModelDescription const &model, storm::modelchecker::CheckTask< storm::logic::Formula, ValueType > const &task, AbstractionRefinementOptions const &options=AbstractionRefinementOptions())
std::vector< std::vector< storm::expressions::Expression > > injectedRefinementPredicates
AbstractionRefinementOptions(std::vector< storm::expressions::Expression > &&constraints, std::vector< std::vector< storm::expressions::Expression > > &&injectedRefinementPredicates)
std::vector< storm::expressions::Expression > constraints