30template<
typename SparseMdpModelType>
36template<
typename SparseMdpModelType>
38 bool* requiresSingleInitialState) {
52 .setLongRunAverageRewardFormulasAllowed(
true)
53 .setLongRunAverageProbabilitiesAllowed(
true)
54 .setConditionalProbabilityFormulasAllowed(
true)
55 .setOnlyEventuallyFormuluasInConditionalFormulasAllowed(
true)
56 .setTotalRewardFormulasAllowed(
true)
57 .setRewardBoundedUntilFormulasAllowed(
true)
58 .setRewardBoundedCumulativeRewardFormulasAllowed(
true)
59 .setMultiDimensionalBoundedUntilFormulasAllowed(
true)
60 .setMultiDimensionalCumulativeRewardFormulasAllowed(
true)
61 .setTimeOperatorsAllowed(
true)
62 .setReachbilityTimeFormulasAllowed(
true)
63 .setRewardAccumulationAllowed(
true)
64 .setDiscountedTotalRewardFormulasAllowed(
true)
65 .setDiscountedCumulativeRewardFormulasAllowed(
true))) {
94 if (requiresSingleInitialState) {
95 *requiresSingleInitialState =
true;
104template<
typename SparseMdpModelType>
106 bool requiresSingleInitialState =
false;
108 return !requiresSingleInitialState || this->
getModel().getInitialStates().getNumberOfSetBits() == 1;
114template<
typename SparseMdpModelType>
119 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
122 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented multi dimensional bounded until with intervals");
126 "Checking non-trivial bounded until probabilities can only be computed for the initial states of the model.");
132 auto formula = std::make_shared<storm::logic::ProbabilityOperatorFormula>(checkTask.
getFormula().asSharedPointer(), opInfo);
139 STORM_LOG_THROW(pathFormula.
hasUpperBound(), storm::exceptions::InvalidPropertyException,
"Formula needs to have (a single) upper step bound.");
147 std::vector<SolutionType> numericResult =
helper.computeStepBoundedUntilProbabilities(
155template<
typename SparseMdpModelType>
160 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
161 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, pathFormula.
getSubformula());
169template<
typename SparseMdpModelType>
174 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
185 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(std::move(ret.scheduler));
190template<
typename SparseMdpModelType>
195 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
196 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, pathFormula.
getSubformula());
203 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(std::move(ret.scheduler));
208template<
typename SparseMdpModelType>
212 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented automata-props with intervals");
220 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<SolutionType>().getTruthValuesVector();
223 std::vector<SolutionType> numericResult =
helper.computeDAProductProbabilities(env, *pathFormula.
readAutomaton(), apSets);
227 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(
235template<
typename SparseMdpModelType>
239 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented LTL with intervals");
244 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
250 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<SolutionType>().getTruthValuesVector();
252 std::vector<SolutionType> numericResult =
helper.computeLTLProbabilities(env, pathFormula, formulaChecker);
256 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(
264template<
typename SparseMdpModelType>
269 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
270 STORM_LOG_THROW(this->
getModel().getInitialStates().hasUniqueSetBit(), storm::exceptions::InvalidPropertyException,
271 "Cannot compute conditional probabilities on MDPs with more than one initial state.");
273 "Conditional probabilities can only be computed for the initial states of the model.");
275 "Illegal conditional probability formula.");
277 "Illegal conditional probability formula.");
284 throw exceptions::NotImplementedException() <<
"Conditional Probabilities are not supported with interval models";
293template<
typename SparseMdpModelType>
297 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Cumulative reward properties are not implemented for interval models.");
301 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
304 "Checking reward bounded cumulative reward formulas can only be done for the initial states of the model.");
306 "Checking reward bounded cumulative reward formulas is not supported if reward accumulations are given.");
312 auto formula = std::make_shared<storm::logic::RewardOperatorFormula>(checkTask.
getFormula().asSharedPointer(), checkTask.
getRewardModel(), opInfo);
318 STORM_LOG_THROW(rewardPathFormula.
hasIntegerBound(), storm::exceptions::InvalidPropertyException,
"Formula needs to have a discrete time bound.");
330 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Discounted properties are not implemented for interval models.");
336 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Discounted properties are not implemented for interval models.");
339template<
typename SparseMdpModelType>
344 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
345 STORM_LOG_THROW(rewardPathFormula.
hasIntegerBound(), storm::exceptions::InvalidPropertyException,
"Formula needs to have a discrete time bound.");
353template<
typename SparseMdpModelType>
358 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
359 STORM_LOG_THROW(rewardPathFormula.
hasIntegerBound(), storm::exceptions::InvalidPropertyException,
"Formula needs to have a discrete time bound.");
363 rewardPathFormula.
getBound<uint64_t>());
367template<
typename SparseMdpModelType>
372 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
373 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
382 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(std::move(ret.scheduler));
387template<
typename SparseMdpModelType>
392 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
393 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
401 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(std::move(ret.scheduler));
406template<
typename SparseMdpModelType>
410 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
417 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(std::move(ret.scheduler));
425 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Discounted properties are not implemented for interval models.");
431 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Discounted properties are not implemented for interval models.");
434template<
typename SparseMdpModelType>
438 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
448 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(std::move(ret.scheduler));
453template<
typename SparseMdpModelType>
457 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented LRA probabilities with intervals");
461 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
462 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, stateFormula);
471 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(
478template<
typename SparseMdpModelType>
482 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented lra with intervals");
485 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
489 auto values =
helper.computeLongRunAverageRewards(env, rewardModel.get());
492 result->asExplicitQuantitativeCheckResult<
SolutionType>().setScheduler(
499template<
typename SparseMdpModelType>
503 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented multi-objective with intervals");
509template<
class SparseMdpModelType>
513 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented lexicographic model checking with intervals");
516 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<SolutionType>().getTruthValuesVector();
524template<
typename SparseMdpModelType>
528 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"We have not yet implemented quantile formulas with intervals");
531 "Computing quantiles is only supported for the initial states of a model.");
532 STORM_LOG_THROW(this->
getModel().getInitialStates().getNumberOfSetBits() == 1, storm::exceptions::InvalidOperationException,
533 "Quantiles not supported on models with multiple initial states.");
534 uint64_t initialState = *this->
getModel().getInitialStates().begin();
539 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.