19template<
typename SparseModelType,
typename ConstantType>
26template<
typename SparseModelType,
typename ConstantType>
29 STORM_LOG_THROW(this->
currentCheckTask, storm::exceptions::InvalidStateException,
"Checking has been invoked but no property has been specified before.");
32 if (instantiatedModel.isExact()) {
34 storm::exceptions::InvalidArgumentException,
"Instantiation point is invalid as the transition matrix becomes non-stochastic.");
38 storm::exceptions::InvalidArgumentException,
"Instantiation point is invalid as the transition matrix becomes non-stochastic.");
47 .setRewardOperatorsAllowed(
true)
48 .setReachabilityRewardFormulasAllowed(
true)
49 .setOperatorAtTopLevelRequired(
true)
50 .setNestedOperatorsAllowed(
false))) {
53 .setProbabilityOperatorsAllowed(
true)
54 .setBoundedUntilFormulasAllowed(
true)
55 .setStepBoundedUntilFormulasAllowed(
true)
56 .setTimeBoundedUntilFormulasAllowed(
true)
57 .setOperatorAtTopLevelRequired(
true)
58 .setNestedOperatorsAllowed(
false))) {
65template<
typename SparseModelType,
typename ConstantType>
80 std::vector<ConstantType> qualitativeResult;
81 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
83 newCheckTask.setQualitative(
true);
84 newCheckTask.setOnlyInitialStatesRelevant(
false);
85 newCheckTask.setProduceSchedulers(
false);
86 qualitativeResult = modelChecker.check(env, newCheckTask)->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector();
89 newCheckTask.setQualitative(
true);
90 newCheckTask.setOnlyInitialStatesRelevant(
false);
91 newCheckTask.setProduceSchedulers(
false);
93 modelChecker.computeProbabilities(env, newCheckTask)->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector();
111 std::unique_ptr<CheckResult> result;
114 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
116 hint.
setResultHint(result->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector());
123 .setOnlyInitialStatesRelevant(
false);
124 std::unique_ptr<storm::modelchecker::CheckResult> quantitativeResult = modelChecker.computeProbabilities(env, newCheckTask);
125 result = quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().compareAgainstBound(
126 this->
currentCheckTask->getFormula().asOperatorFormula().getComparisonType(),
127 this->currentCheckTask->getFormula().asOperatorFormula().template getThresholdAs<ConstantType>());
128 hint.
setResultHint(std::move(quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector()));
138template<
typename SparseModelType,
typename ConstantType>
151 std::vector<ConstantType> qualitativeResult;
152 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
154 newCheckTask.setQualitative(
true);
155 newCheckTask.setOnlyInitialStatesRelevant(
false);
156 newCheckTask.setProduceSchedulers(
false);
157 qualitativeResult = modelChecker.check(env, newCheckTask)->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector();
160 newCheckTask.setQualitative(
true);
161 newCheckTask.setOnlyInitialStatesRelevant(
false);
162 newCheckTask.setProduceSchedulers(
false);
163 qualitativeResult = modelChecker.computeRewards(env, newCheckTask)->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector();
181 std::unique_ptr<CheckResult> result;
184 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
187 hint.
setResultHint(result->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector());
191 .setOnlyInitialStatesRelevant(
false);
192 std::unique_ptr<storm::modelchecker::CheckResult> quantitativeResult = modelChecker.computeRewards(env, newCheckTask);
193 result = quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().compareAgainstBound(
194 this->
currentCheckTask->getFormula().asOperatorFormula().getComparisonType(),
195 this->currentCheckTask->getFormula().asOperatorFormula().template getThresholdAs<ConstantType>());
197 hint.
setResultHint(std::move(quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector()));
204template<
typename SparseModelType,
typename ConstantType>
210 std::unique_ptr<CheckResult> result;
216 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
218 hint.
setResultHint(result->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector());
221 .setOnlyInitialStatesRelevant(
false);
222 std::unique_ptr<CheckResult> quantitativeResult = modelChecker.computeProbabilities(env, newCheckTask);
223 result = quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().compareAgainstBound(
224 this->
currentCheckTask->getFormula().asOperatorFormula().getComparisonType(),
225 this->currentCheckTask->getFormula().asOperatorFormula().template getThresholdAs<ConstantType>());
226 hint.
setResultHint(std::move(quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector()));
231 std::unique_ptr<CheckResult> subFormulaResult =
232 modelChecker.check(env, this->
currentCheckTask->getFormula().asOperatorFormula().getSubformula().asBoundedUntilFormula().getRightSubformula());
233 maybeStates = maybeStates & ~(subFormulaResult->template asExplicitQualitativeCheckResult<ConstantType>().getTruthValuesVector());
242template<
typename SparseModelType,
typename ConstantType>
247 if (instantiatedModel.isExact()) {
virtual std::unique_ptr< CheckResult > check(Environment const &env, CheckTask< storm::logic::Formula, SolutionType > const &checkTask)
Checks the provided formula.
This class contains information that might accelerate the model checking process.
void setSchedulerHint(boost::optional< storage::Scheduler< ValueType > > const &schedulerHint)
void setResultHint(boost::optional< std::vector< ValueType > > const &resultHint)
storm::storage::BitVector const & getMaybeStates() const
void setComputeOnlyMaybeStates(bool value)
void setNoEndComponentsInMaybeStates(bool value)
void setMaybeStates(storm::storage::BitVector const &maybeStates)
std::vector< ValueType > const & getResultHint() const
bool hasMaybeStates() const
SparseInstantiationModelChecker(SparseModelType const ¶metricModel)
SparseModelType const & parametricModel
bool getInstantiationsAreGraphPreserving() const
std::unique_ptr< CheckTask< storm::logic::Formula, ConstantType > > currentCheckTask
Class to efficiently check a formula on a parametric model with different parameter instantiations.
std::unique_ptr< CheckResult > checkReachabilityProbabilityFormula(Environment const &env, storm::modelchecker::SparseMdpPrctlModelChecker< storm::models::sparse::Mdp< ConstantType > > &modelChecker, storm::models::sparse::Mdp< ConstantType > const &instantiatedModel)
virtual std::unique_ptr< CheckResult > check(Environment const &env, storm::utility::parametric::Valuation< typename SparseModelType::ValueType > const &valuation) override
storm::utility::ModelInstantiator< SparseModelType, storm::models::sparse::Mdp< ConstantType > > modelInstantiator
std::unique_ptr< CheckResult > checkBoundedUntilFormula(Environment const &env, storm::modelchecker::SparseMdpPrctlModelChecker< storm::models::sparse::Mdp< ConstantType > > &modelChecker)
virtual bool isWellDefined(storm::utility::parametric::Valuation< typename SparseModelType::ValueType > const &valuation) override
Checks if the given valuation is valid for the current model.
std::unique_ptr< CheckResult > checkReachabilityRewardFormula(Environment const &env, storm::modelchecker::SparseMdpPrctlModelChecker< storm::models::sparse::Mdp< ConstantType > > &modelChecker, storm::models::sparse::Mdp< ConstantType > const &instantiatedModel)
SparseMdpInstantiationModelChecker(SparseModelType const ¶metricModel, bool produceScheduler=true)
This class represents a (discrete-time) Markov decision process.
storm::storage::SparseMatrix< ValueType > const & getTransitionMatrix() const
Retrieves the matrix representing the transitions of the model.
storm::storage::SparseMatrix< ValueType > getBackwardTransitions() const
Retrieves the backward transition relation of the model, i.e.
A bit vector that is internally represented as a vector of 64-bit values.
This class defines which action is chosen in a particular state of a non-deterministic model.
#define STORM_LOG_THROW(cond, exception, message)
FragmentSpecification propositional()
FragmentSpecification reachability()
SettingsType const & getModule()
Get module.
bool constexpr maximize(OptimizationDirection d)
bool constexpr minimize(OptimizationDirection d)
storm::storage::BitVector performProb1A(storm::models::sparse::NondeterministicModel< T, RM > const &model, storm::storage::SparseMatrix< T > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates)
Computes the sets of states that have probability 1 of satisfying phi until psi under all possible re...
std::map< typename VariableType< FunctionType >::type, typename CoefficientType< FunctionType >::type > Valuation
storm::storage::BitVector filter(std::vector< T > const &values, std::function< bool(T const &value)> const &function)
Retrieves a bit vector containing all the indices for which the value at this position makes the give...
storm::storage::BitVector filterGreaterZero(std::vector< T > const &values)
Retrieves a bit vector containing all the indices for which the value at this position is greater tha...
bool isOne(ValueType const &a)
bool isZero(ValueType const &a)
bool isInfinity(ValueType const &a)
TargetType convertNumber(SourceType const &number)