Storm 1.11.1.1
A Modern Probabilistic Model Checker
Loading...
Searching...
No Matches
HybridDtmcPrctlModelChecker.cpp
Go to the documentation of this file.
2
11#include "storm/utility/graph.h"
13
14namespace storm {
15namespace modelchecker {
16template<typename ModelType>
18 // Intentionally left empty.
19}
20
21template<typename ModelType>
23 storm::logic::Formula const& formula = checkTask.getFormula();
24 return formula.isInFragment(storm::logic::prctl()
25 .setLongRunAverageRewardFormulasAllowed(true)
26 .setLongRunAverageProbabilitiesAllowed(true)
27 .setTimeOperatorsAllowed(true)
28 .setReachbilityTimeFormulasAllowed(true)
29 .setRewardAccumulationAllowed(true));
30}
31
32template<typename ModelType>
34 return canHandleStatic(checkTask);
35}
36
37template<typename ModelType>
40 storm::logic::UntilFormula const& pathFormula = checkTask.getFormula();
41 std::unique_ptr<CheckResult> leftResultPointer = this->check(env, pathFormula.getLeftSubformula());
42 std::unique_ptr<CheckResult> rightResultPointer = this->check(env, pathFormula.getRightSubformula());
43 SymbolicQualitativeCheckResult<DdType> const& leftResult = leftResultPointer->asSymbolicQualitativeCheckResult<DdType>();
44 SymbolicQualitativeCheckResult<DdType> const& rightResult = rightResultPointer->asSymbolicQualitativeCheckResult<DdType>();
46 env, this->getModel(), this->getModel().getTransitionMatrix(), leftResult.getTruthValuesVector(), rightResult.getTruthValuesVector(),
47 checkTask.isQualitativeSet());
48}
49
50template<typename ModelType>
53 storm::logic::GloballyFormula const& pathFormula = checkTask.getFormula();
54 std::unique_ptr<CheckResult> subResultPointer = this->check(env, pathFormula.getSubformula());
55 SymbolicQualitativeCheckResult<DdType> const& subResult = subResultPointer->asSymbolicQualitativeCheckResult<DdType>();
57 env, this->getModel(), this->getModel().getTransitionMatrix(), subResult.getTruthValuesVector(), checkTask.isQualitativeSet());
58}
59
60template<typename ModelType>
63 storm::logic::NextFormula const& pathFormula = checkTask.getFormula();
64 std::unique_ptr<CheckResult> subResultPointer = this->check(env, pathFormula.getSubformula());
65 SymbolicQualitativeCheckResult<DdType> const& subResult = subResultPointer->asSymbolicQualitativeCheckResult<DdType>();
67 env, this->getModel(), this->getModel().getTransitionMatrix(), subResult.getTruthValuesVector());
68}
69
70template<typename ModelType>
73 storm::logic::BoundedUntilFormula const& pathFormula = checkTask.getFormula();
74 STORM_LOG_THROW(!pathFormula.hasLowerBound() && pathFormula.hasUpperBound(), storm::exceptions::InvalidPropertyException,
75 "Formula needs to have (a single) upper time bound, and no lower bound.");
76 STORM_LOG_THROW(pathFormula.hasIntegerUpperBound(), storm::exceptions::InvalidPropertyException, "Formula needs to have discrete upper time bound.");
77 std::unique_ptr<CheckResult> leftResultPointer = this->check(env, pathFormula.getLeftSubformula());
78 std::unique_ptr<CheckResult> rightResultPointer = this->check(env, pathFormula.getRightSubformula());
79 SymbolicQualitativeCheckResult<DdType> const& leftResult = leftResultPointer->asSymbolicQualitativeCheckResult<DdType>();
80 SymbolicQualitativeCheckResult<DdType> const& rightResult = rightResultPointer->asSymbolicQualitativeCheckResult<DdType>();
82 env, this->getModel(), this->getModel().getTransitionMatrix(), leftResult.getTruthValuesVector(), rightResult.getTruthValuesVector(),
83 pathFormula.getNonStrictUpperBound<uint64_t>());
84}
85
86template<typename ModelType>
89 storm::logic::CumulativeRewardFormula const& rewardPathFormula = checkTask.getFormula();
90 STORM_LOG_THROW(rewardPathFormula.hasIntegerBound(), storm::exceptions::InvalidPropertyException, "Formula needs to have a discrete time bound.");
91 auto rewardModel = storm::utility::createFilteredRewardModel(this->getModel(), checkTask);
93 env, this->getModel(), this->getModel().getTransitionMatrix(), rewardModel.get(), rewardPathFormula.getNonStrictBound<uint64_t>());
94}
95
96template<typename ModelType>
99 storm::logic::InstantaneousRewardFormula const& rewardPathFormula = checkTask.getFormula();
100 STORM_LOG_THROW(rewardPathFormula.hasIntegerBound(), storm::exceptions::InvalidPropertyException, "Formula needs to have a discrete time bound.");
102 env, this->getModel(), this->getModel().getTransitionMatrix(),
103 checkTask.isRewardModelSet() ? this->getModel().getRewardModel(checkTask.getRewardModel()) : this->getModel().getRewardModel(""),
104 rewardPathFormula.getBound<uint64_t>());
105}
106
107template<typename ModelType>
110 storm::logic::EventuallyFormula const& eventuallyFormula = checkTask.getFormula();
111 std::unique_ptr<CheckResult> subResultPointer = this->check(env, eventuallyFormula.getSubformula());
112 SymbolicQualitativeCheckResult<DdType> const& subResult = subResultPointer->asSymbolicQualitativeCheckResult<DdType>();
113 auto rewardModel = storm::utility::createFilteredRewardModel(this->getModel(), checkTask);
115 env, this->getModel(), this->getModel().getTransitionMatrix(), rewardModel.get(), subResult.getTruthValuesVector(), checkTask.isQualitativeSet());
116}
117
118template<typename ModelType>
121 storm::logic::EventuallyFormula const& eventuallyFormula = checkTask.getFormula();
122 std::unique_ptr<CheckResult> subResultPointer = this->check(env, eventuallyFormula.getSubformula());
123 SymbolicQualitativeCheckResult<DdType> const& subResult = subResultPointer->asSymbolicQualitativeCheckResult<DdType>();
124
126 env, this->getModel(), this->getModel().getTransitionMatrix(), subResult.getTruthValuesVector(), checkTask.isQualitativeSet());
127}
128
129template<typename ModelType>
132 storm::logic::StateFormula const& stateFormula = checkTask.getFormula();
133 std::unique_ptr<CheckResult> subResultPointer = this->check(env, stateFormula);
134 SymbolicQualitativeCheckResult<DdType> const& subResult = subResultPointer->asSymbolicQualitativeCheckResult<DdType>();
135
136 storm::modelchecker::helper::HybridInfiniteHorizonHelper<ValueType, DdType, false> helper(this->getModel(), this->getModel().getTransitionMatrix());
138 return helper.computeLongRunAverageProbabilities(env, subResult.getTruthValuesVector());
139}
140
141template<typename ModelType>
144 auto rewardModel = storm::utility::createFilteredRewardModel(this->getModel(), checkTask);
145
146 storm::modelchecker::helper::HybridInfiniteHorizonHelper<ValueType, DdType, false> helper(this->getModel(), this->getModel().getTransitionMatrix());
148 return helper.computeLongRunAverageRewards(env, rewardModel.get());
149}
150
153
156} // namespace modelchecker
157} // namespace storm
Formula const & getRightSubformula() const
Formula const & getLeftSubformula() const
ValueType getNonStrictUpperBound(unsigned i=0) const
bool hasIntegerUpperBound(unsigned i=0) const
bool isInFragment(FragmentSpecification const &fragment) const
Definition Formula.cpp:204
storm::expressions::Expression const & getBound() const
Formula const & getSubformula() const
SymbolicQualitativeCheckResult< Type > & asSymbolicQualitativeCheckResult()
bool isRewardModelSet() const
Retrieves whether a reward model was set.
Definition CheckTask.h:190
bool isQualitativeSet() const
Retrieves whether the computation only needs to be performed qualitatively, because the values will o...
Definition CheckTask.h:257
std::string const & getRewardModel() const
Retrieves the reward model over which to perform the checking (if set).
Definition CheckTask.h:197
FormulaType const & getFormula() const
Retrieves the formula from this task.
Definition CheckTask.h:140
virtual std::unique_ptr< CheckResult > computeNextProbabilities(Environment const &env, CheckTask< storm::logic::NextFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeReachabilityRewards(Environment const &env, CheckTask< storm::logic::EventuallyFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeCumulativeRewards(Environment const &env, CheckTask< storm::logic::CumulativeRewardFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeGloballyProbabilities(Environment const &env, CheckTask< storm::logic::GloballyFormula, ValueType > const &checkTask) override
static bool canHandleStatic(CheckTask< storm::logic::Formula, ValueType > const &checkTask)
Returns false, if this task can certainly not be handled by this model checker (independent of the co...
virtual std::unique_ptr< CheckResult > computeLongRunAverageProbabilities(Environment const &env, CheckTask< storm::logic::StateFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeUntilProbabilities(Environment const &env, CheckTask< storm::logic::UntilFormula, ValueType > const &checkTask) override
virtual bool canHandle(CheckTask< storm::logic::Formula, ValueType > const &checkTask) const override
virtual std::unique_ptr< CheckResult > computeReachabilityTimes(Environment const &env, CheckTask< storm::logic::EventuallyFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeBoundedUntilProbabilities(Environment const &env, CheckTask< storm::logic::BoundedUntilFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeLongRunAverageRewards(Environment const &env, CheckTask< storm::logic::LongRunAverageRewardFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeInstantaneousRewards(Environment const &env, CheckTask< storm::logic::InstantaneousRewardFormula, ValueType > const &checkTask) override
static std::unique_ptr< CheckResult > computeReachabilityTimes(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, storm::dd::Bdd< DdType > const &targetStates, bool qualitative)
static std::unique_ptr< CheckResult > computeInstantaneousRewards(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, RewardModelType const &rewardModel, uint_fast64_t stepBound)
static std::unique_ptr< CheckResult > computeReachabilityRewards(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, RewardModelType const &rewardModel, storm::dd::Bdd< DdType > const &targetStates, bool qualitative)
static std::unique_ptr< CheckResult > computeNextProbabilities(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, storm::dd::Bdd< DdType > const &nextStates)
static std::unique_ptr< CheckResult > computeGloballyProbabilities(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, storm::dd::Bdd< DdType > const &psiStates, bool qualitative)
static std::unique_ptr< CheckResult > computeBoundedUntilProbabilities(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, storm::dd::Bdd< DdType > const &phiStates, storm::dd::Bdd< DdType > const &psiStates, uint_fast64_t stepBound)
static std::unique_ptr< CheckResult > computeCumulativeRewards(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, RewardModelType const &rewardModel, uint_fast64_t stepBound)
static std::unique_ptr< CheckResult > computeUntilProbabilities(Environment const &env, storm::models::symbolic::Model< DdType, ValueType > const &model, storm::dd::Add< DdType, ValueType > const &transitionMatrix, storm::dd::Bdd< DdType > const &phiStates, storm::dd::Bdd< DdType > const &psiStates, bool qualitative)
Helper class for model checking queries that depend on the long run behavior of the (nondeterministic...
std::unique_ptr< HybridQuantitativeCheckResult< DdType, ValueType > > computeLongRunAverageRewards(Environment const &env, storm::models::symbolic::StandardRewardModel< DdType, ValueType > const &rewardModel)
Computes the long run average rewards, i.e., the average reward collected per time unit.
#define STORM_LOG_THROW(cond, exception, message)
Definition macros.h:30
FragmentSpecification prctl()
void setInformationFromCheckTaskDeterministic(HelperType &helper, storm::modelchecker::CheckTask< FormulaType, typename ModelType::ValueType > const &checkTask, ModelType const &model)
Forwards relevant information stored in the given CheckTask to the given helper.
FilteredRewardModel< RewardModelType > createFilteredRewardModel(RewardModelType const &baseRewardModel, storm::logic::RewardAccumulation const &acc, bool isDiscreteTimeModel)