31template<
typename SparseMdpModelType>
37template<
typename SparseMdpModelType>
39 bool* requiresSingleInitialState) {
53 .setLongRunAverageRewardFormulasAllowed(
true)
54 .setLongRunAverageProbabilitiesAllowed(
true)
55 .setConditionalProbabilityFormulasAllowed(
true)
56 .setOnlyEventuallyFormuluasInConditionalFormulasAllowed(
true)
57 .setTotalRewardFormulasAllowed(
true)
58 .setRewardBoundedUntilFormulasAllowed(
true)
59 .setRewardBoundedCumulativeRewardFormulasAllowed(
true)
60 .setMultiDimensionalBoundedUntilFormulasAllowed(
true)
61 .setMultiDimensionalCumulativeRewardFormulasAllowed(
true)
62 .setTimeOperatorsAllowed(
true)
63 .setReachbilityTimeFormulasAllowed(
true)
64 .setRewardAccumulationAllowed(
true)
65 .setDiscountedTotalRewardFormulasAllowed(
true)
66 .setDiscountedCumulativeRewardFormulasAllowed(
true))) {
95 if (requiresSingleInitialState) {
96 *requiresSingleInitialState =
true;
105template<
typename SparseMdpModelType>
107 bool requiresSingleInitialState =
false;
109 return !requiresSingleInitialState || this->
getModel().getInitialStates().getNumberOfSetBits() == 1;
115template<
typename SparseMdpModelType>
120 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
123 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented multi dimensional bounded until with intervals.");
127 "Checking non-trivial bounded until probabilities can only be computed for the initial states of the model.");
133 auto formula = std::make_shared<storm::logic::ProbabilityOperatorFormula>(checkTask.
getFormula().asSharedPointer(), opInfo);
140 STORM_LOG_THROW(pathFormula.
hasUpperBound(), storm::exceptions::InvalidPropertyException,
"Formula needs to have (a single) upper step bound.");
148 std::vector<SolutionType> numericResult =
helper.computeStepBoundedUntilProbabilities(
156template<
typename SparseMdpModelType>
161 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
162 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, pathFormula.
getSubformula());
170template<
typename SparseMdpModelType>
175 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
186 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(std::move(ret.scheduler));
191template<
typename SparseMdpModelType>
196 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
197 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, pathFormula.
getSubformula());
204 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(std::move(ret.scheduler));
209template<
typename SparseMdpModelType>
213 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented automata-props with intervals.");
221 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<SolutionType>().getTruthValuesVector();
224 std::vector<SolutionType> numericResult =
helper.computeDAProductProbabilities(env, *pathFormula.
readAutomaton(), apSets);
228 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(
236template<
typename SparseMdpModelType>
240 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented LTL with intervals.");
245 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
251 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<SolutionType>().getTruthValuesVector();
253 std::vector<SolutionType> numericResult =
helper.computeLTLProbabilities(env, pathFormula, formulaChecker);
257 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(
265template<
typename SparseMdpModelType>
270 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
271 STORM_LOG_THROW(this->
getModel().getInitialStates().hasUniqueSetBit(), storm::exceptions::InvalidPropertyException,
272 "Cannot compute conditional probabilities on MDPs with more than one initial state.");
274 "Conditional probabilities can only be computed for the initial states of the model.");
276 "Illegal conditional probability formula.");
278 "Illegal conditional probability formula.");
285 STORM_LOG_THROW(
false, exceptions::NotSupportedException,
"Conditional Probabilities are not supported with interval models.");
294template<
typename SparseMdpModelType>
298 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Cumulative reward properties are not implemented for interval models.");
302 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
305 "Checking reward bounded cumulative reward formulas can only be done for the initial states of the model.");
307 "Checking reward bounded cumulative reward formulas is not supported if reward accumulations are given.");
313 auto formula = std::make_shared<storm::logic::RewardOperatorFormula>(checkTask.
getFormula().asSharedPointer(), checkTask.
getRewardModel(), opInfo);
319 STORM_LOG_THROW(rewardPathFormula.
hasIntegerBound(), storm::exceptions::InvalidPropertyException,
"Formula needs to have a discrete time bound.");
331 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Discounted properties are not implemented for interval models.");
337 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Discounted properties are not implemented for interval models.");
340template<
typename SparseMdpModelType>
345 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
346 STORM_LOG_THROW(rewardPathFormula.
hasIntegerBound(), storm::exceptions::InvalidPropertyException,
"Formula needs to have a discrete time bound.");
354template<
typename SparseMdpModelType>
359 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
360 STORM_LOG_THROW(rewardPathFormula.
hasIntegerBound(), storm::exceptions::InvalidPropertyException,
"Formula needs to have a discrete time bound.");
364 rewardPathFormula.
getBound<uint64_t>());
368template<
typename SparseMdpModelType>
373 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
374 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
383 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(std::move(ret.scheduler));
388template<
typename SparseMdpModelType>
393 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
394 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
402 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(std::move(ret.scheduler));
407template<
typename SparseMdpModelType>
411 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
418 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(std::move(ret.scheduler));
426 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Discounted properties are not implemented for interval models.");
432 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Discounted properties are not implemented for interval models.");
435template<
typename SparseMdpModelType>
439 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
449 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(std::move(ret.scheduler));
454template<
typename SparseMdpModelType>
458 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented LRA probabilities with intervals.");
462 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
463 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, stateFormula);
472 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(
479template<
typename SparseMdpModelType>
483 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented lra with intervals.");
486 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
490 auto values =
helper.computeLongRunAverageRewards(env, rewardModel.get());
493 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(
500template<
typename SparseMdpModelType>
504 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented multi-objective with intervals.");
510template<
class SparseMdpModelType>
514 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented lexicographic model checking with intervals.");
517 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<SolutionType>().getTruthValuesVector();
525template<
typename SparseMdpModelType>
529 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented quantile formulas with intervals.");
532 "Computing quantiles is only supported for the initial states of a model.");
533 STORM_LOG_THROW(this->
getModel().getInitialStates().getNumberOfSetBits() == 1, storm::exceptions::InvalidOperationException,
534 "Quantiles not supported on models with multiple initial states.");
535 uint64_t initialState = *this->
getModel().getInitialStates().begin();
540 if (res.size() == 1 && res.front().size() == 1) {
FragmentSpecification & setStepBoundedUntilFormulasAllowed(bool newValue)
FragmentSpecification & setRewardBoundedCumulativeRewardFormulasAllowed(bool newValue)
FragmentSpecification & setRewardAccumulationAllowed(bool newValue)
FragmentSpecification & setMultiDimensionalBoundedUntilFormulasAllowed(bool newValue)
FragmentSpecification & setTimeBoundedUntilFormulasAllowed(bool newValue)
FragmentSpecification & setCumulativeRewardFormulasAllowed(bool newValue)
FragmentSpecification & setMultiDimensionalCumulativeRewardFormulasAllowed(bool newValue)
FragmentSpecification & setRewardBoundedUntilFormulasAllowed(bool newValue)
FragmentSpecification & setTimeBoundedCumulativeRewardFormulasAllowed(bool newValue)
FragmentSpecification & setHOAPathFormulasAllowed(bool newValue)
FragmentSpecification & setTimeAllowed(bool newValue)
FragmentSpecification & setStepBoundedCumulativeRewardFormulasAllowed(bool newValue)
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 isOptimizationDirectionSet() const
Retrieves whether an optimization direction was set.
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 isProduceSchedulersSet() const
Retrieves whether scheduler(s) are to be produced (if supported).
storm::logic::Bound const & getBound() const
Retrieves the bound (if set).
storm::OptimizationDirection const & getOptimizationDirection() const
Retrieves the optimization direction (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 > computeLongRunAverageProbabilities(Environment const &env, CheckTask< storm::logic::StateFormula, SolutionType > const &checkTask) override
SparseMdpModelType::ValueType ValueType
virtual std::unique_ptr< CheckResult > computeCumulativeRewards(Environment const &env, CheckTask< storm::logic::CumulativeRewardFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeLongRunAverageRewards(Environment const &env, CheckTask< storm::logic::LongRunAverageRewardFormula, 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 > checkMultiObjectiveFormula(Environment const &env, CheckTask< storm::logic::MultiObjectiveFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeReachabilityTimes(Environment const &env, CheckTask< storm::logic::EventuallyFormula, 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 > computeLTLProbabilities(Environment const &env, CheckTask< storm::logic::PathFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeGloballyProbabilities(Environment const &env, CheckTask< storm::logic::GloballyFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeUntilProbabilities(Environment const &env, CheckTask< storm::logic::UntilFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > checkQuantileFormula(Environment const &env, CheckTask< storm::logic::QuantileFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > checkLexObjectiveFormula(Environment const &env, CheckTask< storm::logic::MultiObjectiveFormula, SolutionType > const &checkTask) override
virtual bool canHandle(CheckTask< storm::logic::Formula, SolutionType > const &checkTask) const override
virtual std::unique_ptr< CheckResult > computeReachabilityRewards(Environment const &env, CheckTask< storm::logic::EventuallyFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeHOAPathProbabilities(Environment const &env, CheckTask< storm::logic::HOAPathFormula, SolutionType > const &checkTask) override
storm::IntervalBaseType< ValueType > SolutionType
virtual std::unique_ptr< CheckResult > computeInstantaneousRewards(Environment const &env, CheckTask< storm::logic::InstantaneousRewardFormula, 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 > computeDiscountedTotalRewards(Environment const &env, CheckTask< storm::logic::DiscountedTotalRewardFormula, SolutionType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeTotalRewards(Environment const &env, CheckTask< storm::logic::TotalRewardFormula, SolutionType > const &checkTask) override
SparseMdpPrctlModelChecker(SparseMdpModelType const &model)
virtual std::unique_ptr< CheckResult > computeBoundedUntilProbabilities(Environment const &env, CheckTask< storm::logic::BoundedUntilFormula, SolutionType > const &checkTask) override
SparsePropositionalModelChecker(SparseMdpModelType const &model)
SparseMdpModelType const & getModel() const
Helper class for LTL model checking.
static MDPSparseModelCheckingHelperReturnType< 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, bool produceScheduler, ModelCheckerHint const &hint=ModelCheckerHint())
static MDPSparseModelCheckingHelperReturnType< 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, bool produceScheduler, ModelCheckerHint const &hint=ModelCheckerHint())
static MDPSparseModelCheckingHelperReturnType< 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, bool produceScheduler, bool useMecBasedTechnique=false)
static std::vector< SolutionType > computeNextProbabilities(Environment const &env, OptimizationDirection dir, UncertaintyResolutionMode uncertaintyResolutionMode, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::BitVector const &nextStates)
static std::map< storm::storage::sparse::state_type, SolutionType > computeRewardBoundedValues(Environment const &env, OptimizationDirection dir, rewardbounded::MultiDimensionalRewardUnfolding< ValueType, true > &rewardUnfolding, storm::storage::BitVector const &initialStates)
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 MDPSparseModelCheckingHelperReturnType< 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, bool produceScheduler, ModelCheckerHint const &hint=ModelCheckerHint())
static MDPSparseModelCheckingHelperReturnType< 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, bool produceScheduler, ValueType discountFactor, 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 > 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 MDPSparseModelCheckingHelperReturnType< 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, bool produceScheduler, ModelCheckerHint const &hint=ModelCheckerHint())
Helper class for model checking queries that depend on the long run behavior of the (nondeterministic...
std::vector< std::vector< ValueType > > computeQuantile(Environment const &env)
This class defines which action is chosen in a particular state of a non-deterministic model.
#define STORM_LOG_WARN_COND(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
FragmentSpecification prctlstar()
FragmentSpecification propositional()
FragmentSpecification lexObjective()
FragmentSpecification multiObjective()
FragmentSpecification reachability()
FragmentSpecification quantiles()
void setInformationFromCheckTaskNondeterministic(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.
helper::MDPSparseModelCheckingHelperReturnType< ValueType > check(Environment const &, SparseModelType const &model, CheckTask< storm::logic::MultiObjectiveFormula, ValueType > const &checkTask, CheckFormulaCallback const &formulaChecker)
check a lexicographic LTL-formula
std::unique_ptr< CheckResult > performMultiObjectiveModelChecking(Environment const &env, SparseModelType const &model, storm::logic::MultiObjectiveFormula const &formula, bool produceScheduler)
std::unique_ptr< CheckResult > computeConditionalProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType, SolutionType > &&goal, bool produceSchedulers, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &targetStates, storm::storage::BitVector const &conditionStates)
FilteredRewardModel< RewardModelType > createFilteredRewardModel(RewardModelType const &baseRewardModel, storm::logic::RewardAccumulation const &acc, bool isDiscreteTimeModel)
constexpr bool IsIntervalType
Helper to check if a type is an interval.