16template<
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.");
33 storm::exceptions::InvalidArgumentException,
"Instantiation point is invalid as the transition matrix becomes non-stochastic.");
42 .setRewardOperatorsAllowed(
true)
43 .setReachabilityRewardFormulasAllowed(
true)
44 .setOperatorAtTopLevelRequired(
true)
45 .setNestedOperatorsAllowed(
false))) {
48 .setProbabilityOperatorsAllowed(
true)
49 .setBoundedUntilFormulasAllowed(
true)
50 .setStepBoundedUntilFormulasAllowed(
true)
51 .setTimeBoundedUntilFormulasAllowed(
true)
52 .setOperatorAtTopLevelRequired(
true)
53 .setNestedOperatorsAllowed(
false))) {
60template<
typename SparseModelType,
typename ConstantType>
70 std::vector<ExtendedConstantType> qualitativeResult;
71 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
73 newCheckTask.setQualitative(
true);
74 newCheckTask.setOnlyInitialStatesRelevant(
false);
75 qualitativeResult = std::move(modelChecker.check(
env, newCheckTask)->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector());
78 newCheckTask.setQualitative(
true);
79 newCheckTask.setOnlyInitialStatesRelevant(
false);
81 std::move(modelChecker.computeProbabilities(
env, newCheckTask)->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector());
90 std::unique_ptr<CheckResult> result;
93 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
95 hint.
setResultHint(result->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector());
98 .setOnlyInitialStatesRelevant(
false);
99 std::unique_ptr<CheckResult> quantitativeResult = modelChecker.computeProbabilities(
env, newCheckTask);
100 result = quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().compareAgainstBound(
101 this->
currentCheckTask->getFormula().asOperatorFormula().getComparisonType(),
102 this->currentCheckTask->getFormula().asOperatorFormula().template getThresholdAs<ConstantType>());
103 hint.
setResultHint(std::move(quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector()));
109template<
typename SparseModelType,
typename ConstantType>
119 std::vector<ExtendedConstantType> qualitativeResult;
120 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
122 newCheckTask.setQualitative(
true);
123 newCheckTask.setOnlyInitialStatesRelevant(
false);
124 qualitativeResult = std::move(modelChecker.check(
env, newCheckTask)->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector());
127 newCheckTask.setQualitative(
true);
128 newCheckTask.setOnlyInitialStatesRelevant(
false);
130 std::move(modelChecker.computeRewards(
env, newCheckTask)->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector());
139 std::unique_ptr<CheckResult> result;
143 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
145 this->
currentCheckTask->getHint().template asExplicitModelCheckerHint<ConstantType>().setResultHint(
146 result->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector());
149 .setOnlyInitialStatesRelevant(
false);
150 std::unique_ptr<CheckResult> quantitativeResult = modelChecker.computeRewards(
env, newCheckTask);
151 result = quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().compareAgainstBound(
152 this->
currentCheckTask->getFormula().asOperatorFormula().getComparisonType(),
153 this->currentCheckTask->getFormula().asOperatorFormula().template getThresholdAs<ConstantType>());
154 this->
currentCheckTask->getHint().template asExplicitModelCheckerHint<ConstantType>().setResultHint(
155 std::move(quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector()));
161template<
typename SparseModelType,
typename ConstantType>
167 std::unique_ptr<CheckResult> result;
173 if (this->
currentCheckTask->getFormula().asOperatorFormula().hasQuantitativeResult()) {
175 hint.
setResultHint(result->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector());
178 .setOnlyInitialStatesRelevant(
false);
179 std::unique_ptr<CheckResult> quantitativeResult = modelChecker.computeProbabilities(
env, newCheckTask);
180 result = quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().compareAgainstBound(
181 this->
currentCheckTask->getFormula().asOperatorFormula().getComparisonType(),
182 this->currentCheckTask->getFormula().asOperatorFormula().template getThresholdAs<ConstantType>());
183 hint.
setResultHint(std::move(quantitativeResult->template asExplicitQuantitativeCheckResult<ConstantType>().getValueVector()));
189 std::unique_ptr<CheckResult> subFormulaResult =
190 modelChecker.check(
env, this->
currentCheckTask->getFormula().asOperatorFormula().getSubformula().asBoundedUntilFormula().getRightSubformula());
191 maybeStates = maybeStates & ~(subFormulaResult->template asExplicitQualitativeCheckResult<ConstantType>().getTruthValuesVector());
201template<
typename SparseModelType,
typename ConstantType>
206 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< ExtendedValueType > > const &resultHint)
void setComputeOnlyMaybeStates(bool value)
void setMaybeStates(storm::storage::BitVector const &maybeStates)
bool hasMaybeStates() const
std::vector< ExtendedValueType > const & getResultHint() 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::ExtendedValueType< ConstantType > ExtendedConstantType
SparseDtmcInstantiationModelChecker(Environment const &env, SparseModelType const ¶metricModel)
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)
SparseModelType const & parametricModel
SparseInstantiationModelChecker(Environment const &env, SparseModelType const ¶metricModel)
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()
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)