17template<
typename SparseModelType,
typename ConstantType>
23template<
typename SparseModelType,
typename ConstantType>
26 STORM_LOG_THROW(this->
currentCheckTask, storm::exceptions::InvalidStateException,
"Checking has been invoked but no property has been specified before.");
28 if (instantiatedModel.isExact()) {
30 storm::exceptions::InvalidArgumentException,
"Instantiation point is invalid as the transition matrix becomes non-stochastic.");
34 storm::exceptions::InvalidArgumentException,
"Instantiation point is invalid as the transition matrix becomes non-stochastic.");
43 .setRewardOperatorsAllowed(
true)
44 .setReachabilityRewardFormulasAllowed(
true)
45 .setOperatorAtTopLevelRequired(
true)
46 .setNestedOperatorsAllowed(
false))) {
49 .setProbabilityOperatorsAllowed(
true)
50 .setBoundedUntilFormulasAllowed(
true)
51 .setStepBoundedUntilFormulasAllowed(
true)
52 .setTimeBoundedUntilFormulasAllowed(
true)
53 .setOperatorAtTopLevelRequired(
true)
54 .setNestedOperatorsAllowed(
false))) {
61template<
typename SparseModelType,
typename ConstantType>
71 std::vector<ConstantType> qualitativeResult;
72 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
74 newCheckTask.setQualitative(
true);
75 newCheckTask.setOnlyInitialStatesRelevant(
false);
76 qualitativeResult = modelChecker.check(env, newCheckTask)->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector();
79 newCheckTask.setQualitative(
true);
80 newCheckTask.setOnlyInitialStatesRelevant(
false);
82 modelChecker.computeProbabilities(env, newCheckTask)->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector();
92 std::unique_ptr<CheckResult> result;
95 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
97 hint.
setResultHint(result->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector());
100 .setOnlyInitialStatesRelevant(
false);
101 std::unique_ptr<CheckResult> quantitativeResult = modelChecker.computeProbabilities(env, newCheckTask);
102 result = quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().compareAgainstBound(
103 this->
currentCheckTask->getFormula().asOperatorFormula().getComparisonType(),
104 this->currentCheckTask->getFormula().asOperatorFormula().template getThresholdAs<ConstantType>());
105 hint.
setResultHint(std::move(quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector()));
111template<
typename SparseModelType,
typename ConstantType>
121 std::vector<ConstantType> qualitativeResult;
122 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
124 newCheckTask.setQualitative(
true);
125 newCheckTask.setOnlyInitialStatesRelevant(
false);
126 qualitativeResult = modelChecker.check(env, newCheckTask)->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector();
129 newCheckTask.setQualitative(
true);
130 newCheckTask.setOnlyInitialStatesRelevant(
false);
131 qualitativeResult = modelChecker.computeRewards(env, newCheckTask)->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector();
141 std::unique_ptr<CheckResult> result;
145 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
147 this->
currentCheckTask->getHint().template asExplicitModelCheckerHint<ConstantType>().setResultHint(
148 result->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector());
151 .setOnlyInitialStatesRelevant(
false);
152 std::unique_ptr<CheckResult> quantitativeResult = modelChecker.computeRewards(env, newCheckTask);
153 result = quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().compareAgainstBound(
154 this->
currentCheckTask->getFormula().asOperatorFormula().getComparisonType(),
155 this->currentCheckTask->getFormula().asOperatorFormula().template getThresholdAs<ConstantType>());
156 this->
currentCheckTask->getHint().template asExplicitModelCheckerHint<ConstantType>().setResultHint(
157 std::move(quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector()));
163template<
typename SparseModelType,
typename ConstantType>
169 std::unique_ptr<CheckResult> result;
175 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
177 hint.
setResultHint(result->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector());
180 .setOnlyInitialStatesRelevant(
false);
181 std::unique_ptr<CheckResult> quantitativeResult = modelChecker.computeProbabilities(env, newCheckTask);
182 result = quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().compareAgainstBound(
183 this->
currentCheckTask->getFormula().asOperatorFormula().getComparisonType(),
184 this->currentCheckTask->getFormula().asOperatorFormula().template getThresholdAs<ConstantType>());
185 hint.
setResultHint(std::move(quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector()));
191 std::unique_ptr<CheckResult> subFormulaResult =
192 modelChecker.check(env, this->
currentCheckTask->getFormula().asOperatorFormula().getSubformula().asBoundedUntilFormula().getRightSubformula());
193 maybeStates = maybeStates & ~(subFormulaResult->template asExplicitQualitativeCheckResult<ConstantType>().getTruthValuesVector());
203template<
typename SparseModelType,
typename ConstantType>
208 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 setResultHint(boost::optional< std::vector< ValueType > > const &resultHint)
void setComputeOnlyMaybeStates(bool value)
void setMaybeStates(storm::storage::BitVector const &maybeStates)
std::vector< ValueType > const & getResultHint() const
bool hasMaybeStates() const
Class to efficiently check a formula on a parametric model with different parameter instantiations.
std::unique_ptr< CheckResult > checkReachabilityRewardFormula(Environment const &env, storm::modelchecker::SparseDtmcPrctlModelChecker< storm::models::sparse::Dtmc< ConstantType > > &modelChecker)
virtual std::unique_ptr< CheckResult > check(Environment const &env, storm::utility::parametric::Valuation< typename SparseModelType::ValueType > const &valuation) override
virtual bool isWellDefined(storm::utility::parametric::Valuation< typename SparseModelType::ValueType > const &valuation) override
Checks if the given valuation is valid for the current model.
storm::utility::ModelInstantiator< SparseModelType, storm::models::sparse::Dtmc< ConstantType > > modelInstantiator
std::unique_ptr< CheckResult > checkBoundedUntilFormula(Environment const &env, storm::modelchecker::SparseDtmcPrctlModelChecker< storm::models::sparse::Dtmc< ConstantType > > &modelChecker)
std::unique_ptr< CheckResult > checkReachabilityProbabilityFormula(Environment const &env, storm::modelchecker::SparseDtmcPrctlModelChecker< storm::models::sparse::Dtmc< ConstantType > > &modelChecker)
SparseDtmcInstantiationModelChecker(SparseModelType const ¶metricModel)
SparseInstantiationModelChecker(SparseModelType const ¶metricModel)
SparseModelType const & parametricModel
bool getInstantiationsAreGraphPreserving() const
std::unique_ptr< CheckTask< storm::logic::Formula, ConstantType > > currentCheckTask
This class represents a discrete-time Markov chain.
A bit vector that is internally represented as a vector of 64-bit values.
#define STORM_LOG_THROW(cond, exception, message)
FragmentSpecification propositional()
FragmentSpecification reachability()
SettingsType const & getModule()
Get module.
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)