27template<
typename SparseDtmcModelType>
33template<
typename SparseDtmcModelType>
35 bool* requiresSingleInitialState) {
49 .setLongRunAverageRewardFormulasAllowed(
true)
50 .setLongRunAverageProbabilitiesAllowed(
true)
51 .setConditionalProbabilityFormulasAllowed(
true)
52 .setConditionalRewardFormulasAllowed(
true)
53 .setTotalRewardFormulasAllowed(
true)
54 .setOnlyEventuallyFormuluasInConditionalFormulasAllowed(
true)
55 .setRewardBoundedUntilFormulasAllowed(
true)
56 .setRewardBoundedCumulativeRewardFormulasAllowed(
true)
57 .setMultiDimensionalBoundedUntilFormulasAllowed(
true)
58 .setMultiDimensionalCumulativeRewardFormulasAllowed(
true)
59 .setTimeOperatorsAllowed(
true)
60 .setReachbilityTimeFormulasAllowed(
true)
61 .setRewardAccumulationAllowed(
true)
62 .setHOAPathFormulasAllowed(
true)
63 .setDiscountedTotalRewardFormulasAllowed(
true)
64 .setDiscountedCumulativeRewardFormulasAllowed(
true))) {
67 if (requiresSingleInitialState) {
68 *requiresSingleInitialState =
true;
77template<
typename SparseDtmcModelType>
79 bool requiresSingleInitialState =
false;
81 return !requiresSingleInitialState || this->
getModel().getInitialStates().getNumberOfSetBits() == 1;
87template<
typename SparseDtmcModelType>
93 "Checking non-trivial bounded until probabilities can only be computed for the initial states of the model.");
98 auto formula = std::make_shared<storm::logic::ProbabilityOperatorFormula>(checkTask.
getFormula().asSharedPointer(), opInfo);
103 STORM_LOG_THROW(pathFormula.
hasUpperBound(), storm::exceptions::InvalidPropertyException,
"Formula needs to have (a single) upper step bound.");
111 std::vector<SolutionType> numericResult =
helper.computeStepBoundedUntilProbabilities(
120template<
typename SparseDtmcModelType>
124 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented next probabilities with intervals");
127 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, pathFormula.
getSubformula());
129 std::vector<SolutionType> numericResult =
136template<
typename SparseDtmcModelType>
142 "Uncertainty resolution mode must be set for uncertain (interval) models.");
145 storm::exceptions::InvalidSettingsException,
146 "Uncertainty resolution modes robust or cooperative not allowed if optimization direction is not stated explicitly.");
147 STORM_LOG_THROW(this->
getModel().getTransitionMatrix().hasOnlyPositiveEntries(), storm::exceptions::InvalidSettingsException,
148 "Computing until probabilities on uncertain model requires graph-preservation.");
154 std::vector<SolutionType> numericResult =
162template<
typename SparseDtmcModelType>
166 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented globally probabilities with intervals");
169 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, pathFormula.
getSubformula());
171 std::vector<SolutionType> numericResult =
179template<
typename SparseDtmcModelType>
183 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented automata-props with intervals");
191 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<SolutionType>().getTruthValuesVector();
194 std::vector<ValueType> numericResult =
helper.computeDAProductProbabilities(env, *pathFormula.
readAutomaton(), apSets);
200template<
typename SparseDtmcModelType>
204 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented LTL with interval models");
212 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<SolutionType>().getTruthValuesVector();
214 std::vector<ValueType> numericResult =
helper.computeLTLProbabilities(env, pathFormula, formulaChecker);
220template<
typename SparseDtmcModelType>
225 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented cumulative rewards with intervals");
229 "Checking non-trivial bounded until probabilities can only be computed for the initial states of the model.");
231 "Checking reward bounded cumulative reward formulas is not supported if reward accumulations are given.");
236 auto formula = std::make_shared<storm::logic::RewardOperatorFormula>(checkTask.
getFormula().asSharedPointer(), checkTask.
getRewardModel(), opInfo);
241 STORM_LOG_THROW(rewardPathFormula.
hasIntegerBound(), storm::exceptions::InvalidPropertyException,
"Formula needs to have a discrete time bound.");
243 std::vector<SolutionType> numericResult =
255 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Discounted properties are not implemented for parametric models.");
258template<
typename SparseDtmcModelType>
262 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented discounted cumulative rewards with intervals");
265 STORM_LOG_THROW(rewardPathFormula.
hasIntegerBound(), storm::exceptions::InvalidPropertyException,
"Formula needs to have a discrete time bound.");
267 std::vector<SolutionType> numericResult =
275template<
typename SparseDtmcModelType>
279 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented instantaneous rewards with intervals");
282 STORM_LOG_THROW(rewardPathFormula.
hasIntegerBound(), storm::exceptions::InvalidPropertyException,
"Formula needs to have a discrete time bound.");
283 std::vector<SolutionType> numericResult =
287 rewardPathFormula.
getBound<uint64_t>());
292template<
typename SparseDtmcModelType>
298 "Uncertainty resolution mode must be set for uncertain (interval) models.");
301 storm::exceptions::InvalidSettingsException,
302 "Uncertainty resolution modes robust or cooperative not allowed if optimization direction is not stated explicitly.");
303 STORM_LOG_THROW(this->
getModel().getTransitionMatrix().hasOnlyPositiveEntries(), storm::exceptions::InvalidSettingsException,
304 "Computing rewards on uncertain model requires graph-preservation.");
306 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
309 std::vector<SolutionType> numericResult =
316template<
typename SparseDtmcModelType>
320 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented reachability times with intervals");
323 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
325 std::vector<SolutionType> numericResult =
333template<
typename SparseDtmcModelType>
337 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented total rewards with intervals");
340 std::vector<SolutionType> numericResult =
351 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Discounted properties are not implemented for parametric models.");
354template<
typename SparseDtmcModelType>
358 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented discounted total rewards with intervals");
371template<
typename SparseDtmcModelType>
375 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented LRA probabilities with intervals");
378 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, stateFormula);
389template<
typename SparseDtmcModelType>
393 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented lra with intervals");
398 auto values =
helper.computeLongRunAverageRewards(env, rewardModel.get());
403template<
typename SparseDtmcModelType>
407 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented conditional probabilities with intervals");
411 "Illegal conditional probability formula.");
413 "Illegal conditional probability formula.");
420 std::vector<SolutionType> numericResult =
428template<
typename SparseDtmcModelType>
432 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented conditional rewards with intervals");
436 "Illegal conditional probability formula.");
438 "Illegal conditional probability formula.");
445 std::vector<SolutionType> numericResult =
448 this->
getModel().getBackwardTransitions(),
458 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Quantiles for parametric models are not implemented.");
461template<
typename SparseDtmcModelType>
465 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented quantile formulas with intervals");
468 "Computing quantiles is only supported for the initial states of a model.");
469 STORM_LOG_THROW(this->
getModel().getInitialStates().getNumberOfSetBits() == 1, storm::exceptions::InvalidOperationException,
470 "Quantiles not supported on models with multiple initial states.");
471 uint64_t initialState = *this->
getModel().getInitialStates().begin();
476 if (res.size() == 1 && res.front().size() == 1) {
484template<
typename SparseDtmcModelType>
487 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented steady state distributions with intervals");
493 std::vector<SolutionType> result;
494 auto const& initialStates = this->
getModel().getInitialStates();
495 uint64_t numInitStates = initialStates.getNumberOfSetBits();
496 if (numInitStates == 1) {
497 result =
helper.computeLongRunAverageStateDistribution(env, *initialStates.begin());
499 STORM_LOG_WARN(
"Multiple initial states found. A uniform distribution over initial states is assumed.");
501 result =
helper.computeLongRunAverageStateDistribution(env, [&initialStates, &initProb](uint64_t
const& stateIndex) {
511template<
typename SparseDtmcModelType>
514 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented expected visiting times with intervals");
520 std::vector<SolutionType> result;
521 auto const& initialStates = this->
getModel().getInitialStates();
522 uint64_t numInitStates = initialStates.getNumberOfSetBits();
523 STORM_LOG_THROW(numInitStates > 0, storm::exceptions::InvalidOperationException,
"No initial states given. Cannot compute expected visiting times.");
524 STORM_LOG_WARN_COND(numInitStates == 1,
"Multiple initial states found. A uniform distribution over initial states is assumed.");
525 result =
helper.computeExpectedVisitingTimes(env, initialStates);
bool isRewardBound() const
virtual std::unique_ptr< CheckResult > check(Environment const &env, CheckTask< storm::logic::Formula, SolutionType > const &checkTask)
bool isBoundSet() const
Retrieves whether there is a bound with which the values for the states will be compared.
bool isRewardModelSet() const
Retrieves whether a reward model was set.
bool isQualitativeSet() const
Retrieves whether the computation only needs to be performed qualitatively, because the values will o...
std::string const & getRewardModel() const
Retrieves the reward model over which to perform the checking (if set).
FormulaType const & getFormula() const
Retrieves the formula from this task.
ModelCheckerHint const & getHint() const
Retrieves a hint that might contain information that speeds up the modelchecking process (if supporte...
bool isUncertaintyResolutionModeSet() const
Returns whether the mode, which decides how the uncertainty will be resolved, is set.
storm::logic::Bound const & getBound() const
Retrieves the bound (if set).
bool isOnlyInitialStatesRelevantSet() const
Retrieves whether only the initial states are relevant in the computation.
UncertaintyResolutionMode getUncertaintyResolutionMode() const
Retrieves the mode which decides how the uncertainty will be resolved.
vector_type const & getTruthValuesVector() const
virtual std::unique_ptr< CheckResult > computeReachabilityTimes(Environment const &env, CheckTask< storm::logic::EventuallyFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeLTLProbabilities(Environment const &env, CheckTask< storm::logic::PathFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeConditionalProbabilities(Environment const &env, CheckTask< storm::logic::ConditionalFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeNextProbabilities(Environment const &env, CheckTask< storm::logic::NextFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeReachabilityRewards(Environment const &env, CheckTask< storm::logic::EventuallyFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeLongRunAverageProbabilities(Environment const &env, CheckTask< storm::logic::StateFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeBoundedUntilProbabilities(Environment const &env, CheckTask< storm::logic::BoundedUntilFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeUntilProbabilities(Environment const &env, CheckTask< storm::logic::UntilFormula, SolutionType > const &checkTask) override
std::unique_ptr< CheckResult > computeExpectedVisitingTimes(Environment const &env)
Computes for each state the expected number of times we visit that state.
storm::IntervalBaseType< ValueType > SolutionType
virtual std::unique_ptr< CheckResult > computeTotalRewards(Environment const &env, CheckTask< storm::logic::TotalRewardFormula, SolutionType > const &checkTask) override
SparseDtmcModelType::ValueType ValueType
virtual std::unique_ptr< CheckResult > computeDiscountedTotalRewards(Environment const &env, CheckTask< storm::logic::DiscountedTotalRewardFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeDiscountedCumulativeRewards(Environment const &env, CheckTask< storm::logic::DiscountedCumulativeRewardFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeHOAPathProbabilities(Environment const &env, CheckTask< storm::logic::HOAPathFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeInstantaneousRewards(Environment const &env, CheckTask< storm::logic::InstantaneousRewardFormula, SolutionType > const &checkTask) override
SparseDtmcPrctlModelChecker(SparseDtmcModelType const &model)
virtual std::unique_ptr< CheckResult > computeCumulativeRewards(Environment const &env, CheckTask< storm::logic::CumulativeRewardFormula, SolutionType > const &checkTask) override
static bool canHandleStatic(CheckTask< storm::logic::Formula, SolutionType > const &checkTask, bool *requiresSingleInitialState=nullptr)
Returns false, if this task can certainly not be handled by this model checker (independent of the co...
virtual std::unique_ptr< CheckResult > computeGloballyProbabilities(Environment const &env, CheckTask< storm::logic::GloballyFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeLongRunAverageRewards(Environment const &env, CheckTask< storm::logic::LongRunAverageRewardFormula, SolutionType > const &checkTask) override
virtual bool canHandle(CheckTask< storm::logic::Formula, SolutionType > const &checkTask) const override
std::unique_ptr< CheckResult > computeSteadyStateDistribution(Environment const &env)
Computes the long run average (or: steady state) distribution over all states Assumes a uniform distr...
virtual std::unique_ptr< CheckResult > computeConditionalRewards(Environment const &env, CheckTask< storm::logic::ConditionalFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > checkQuantileFormula(Environment const &env, CheckTask< storm::logic::QuantileFormula, SolutionType > const &checkTask) override
SparsePropositionalModelChecker(SparseDtmcModelType const &model)
SparseDtmcModelType const & getModel() const
Helper class for model checking queries that depend on the long run behavior of the (nondeterministic...
Helper class for computing for each state the expected number of times to visit that state assuming a...
static std::vector< SolutionType > computeUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool qualitative, ModelCheckerHint const &hint=ModelCheckerHint())
static std::vector< SolutionType > computeConditionalProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &targetStates, storm::storage::BitVector const &conditionStates, bool qualitative)
static std::vector< SolutionType > computeReachabilityTimes(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &targetStates, bool qualitative, ModelCheckerHint const &hint=ModelCheckerHint())
static std::vector< SolutionType > computeReachabilityRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, storm::storage::BitVector const &targetStates, bool qualitative, ModelCheckerHint const &hint=ModelCheckerHint())
static std::vector< SolutionType > computeDiscountedCumulativeRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, RewardModelType const &rewardModel, uint_fast64_t stepBound, ValueType discountFactor)
static std::vector< SolutionType > computeConditionalRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, storm::storage::BitVector const &targetStates, storm::storage::BitVector const &conditionStates, bool qualitative)
static std::vector< SolutionType > computeDiscountedTotalRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, bool qualitative, ValueType discountFactor, ModelCheckerHint const &hint=ModelCheckerHint())
static std::map< storm::storage::sparse::state_type, SolutionType > computeRewardBoundedValues(Environment const &env, storm::models::sparse::Dtmc< ValueType > const &model, std::shared_ptr< storm::logic::OperatorFormula const > rewardBoundedFormula)
static std::vector< SolutionType > computeGloballyProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &psiStates, bool qualitative)
static std::vector< SolutionType > computeTotalRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, RewardModelType const &rewardModel, bool qualitative, ModelCheckerHint const &hint=ModelCheckerHint())
static std::vector< SolutionType > computeCumulativeRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, RewardModelType const &rewardModel, uint_fast64_t stepBound)
static std::vector< SolutionType > computeInstantaneousRewards(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, RewardModelType const &rewardModel, uint_fast64_t stepCount)
static std::vector< SolutionType > computeNextProbabilities(Environment const &env, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::BitVector const &nextStates)
Helper class for LTL model checking.
std::vector< std::vector< ValueType > > computeQuantile(Environment const &env)
#define STORM_LOG_WARN(message)
#define STORM_LOG_WARN_COND(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
FragmentSpecification prctlstar()
FragmentSpecification propositional()
FragmentSpecification reachability()
FragmentSpecification quantiles()
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)
TargetType convertNumber(SourceType const &number)
constexpr bool IsIntervalType
Helper to check if a type is an interval.