21template<
typename SparseMarkovAutomatonModelType>
27template<
typename ModelType>
29 bool* requiresSingleInitialState) {
39 auto multiObjectiveFragment =
42 singleObjectiveFragment.setBoundedUntilFormulasAllowed(
false).setCumulativeRewardFormulasAllowed(
false);
43 multiObjectiveFragment.setTimeBoundedUntilFormulasAllowed(
false).setCumulativeRewardFormulasAllowed(
false);
45 if (checkTask.
getFormula().isInFragment(singleObjectiveFragment)) {
48 if (requiresSingleInitialState) {
49 *requiresSingleInitialState =
true;
56template<
typename SparseMarkovAutomatonModelType>
58 bool requiresSingleInitialState =
false;
60 return !requiresSingleInitialState || this->
getModel().getInitialStates().getNumberOfSetBits() == 1;
66template<
typename SparseMarkovAutomatonModelType>
71 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
73 "Unable to compute time-bounded reachability probabilities in non-closed Markov automaton.");
81 "Currently step-bounded and reward-bounded properties on MAs are not supported.");
82 double lowerBound = 0;
83 double upperBound = 0;
99template<
typename SparseMarkovAutomatonModelType>
104 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
105 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, pathFormula.
getSubformula());
113template<
typename SparseMarkovAutomatonModelType>
118 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
119 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, pathFormula.
getSubformula());
126 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
131template<
typename SparseMarkovAutomatonModelType>
136 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
143 env, checkTask.
getOptimizationDirection(), this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(),
147 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
152template<
typename SparseMarkovAutomatonModelType>
161 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<ValueType>().getTruthValuesVector();
164 std::vector<ValueType> numericResult =
helper.computeDAProductProbabilities(env, *pathFormula.
readAutomaton(), apSets);
168 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(
175template<
typename SparseMarkovAutomatonModelType>
181 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
187 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<ValueType>().getTruthValuesVector();
189 std::vector<ValueType> numericResult =
helper.computeLTLProbabilities(env, pathFormula, formulaChecker);
193 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(
200template<
typename SparseMarkovAutomatonModelType>
205 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
207 "Unable to compute reachability rewards in non-closed Markov automaton.");
208 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
213 env, checkTask.
getOptimizationDirection(), this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(),
214 this->getModel().getExitRates(), this->getModel().getMarkovianStates(), rewardModel.get(), subResult.
getTruthValuesVector(),
218 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
223template<
typename SparseMarkovAutomatonModelType>
227 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
229 "Unable to compute reachability rewards in non-closed Markov automaton.");
233 env, checkTask.
getOptimizationDirection(), this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(),
234 this->getModel().getExitRates(), this->getModel().getMarkovianStates(), rewardModel.get(), checkTask.
isProduceSchedulersSet());
237 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
242template<
typename SparseMarkovAutomatonModelType>
247 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
249 "Unable to compute long-run average in non-closed Markov automaton.");
250 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, stateFormula);
265template<
typename SparseMarkovAutomatonModelType>
269 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
271 "Unable to compute long run average rewards in non-closed Markov automaton.");
277 auto values =
helper.computeLongRunAverageRewards(env, rewardModel.get());
286template<
typename SparseMarkovAutomatonModelType>
291 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
293 "Unable to compute expected times in non-closed Markov automaton.");
294 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
298 env, checkTask.
getOptimizationDirection(), this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(),
302 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
307template<
typename SparseMarkovAutomatonModelType>
FragmentSpecification & setRewardAccumulationAllowed(bool newValue)
FragmentSpecification & setTimeBoundedUntilFormulasAllowed(bool newValue)
FragmentSpecification & setTotalRewardFormulasAllowed(bool newValue)
FragmentSpecification & setReachabilityRewardFormulasAllowed(bool newValue)
FragmentSpecification & setLongRunAverageRewardFormulasAllowed(bool newValue)
FragmentSpecification & setLongRunAverageProbabilitiesAllowed(bool newValue)
FragmentSpecification & setRewardOperatorsAllowed(bool newValue)
FragmentSpecification & setInstantaneousFormulasAllowed(bool newValue)
FragmentSpecification & setTimeAllowed(bool newValue)
virtual std::unique_ptr< CheckResult > check(Environment const &env, CheckTask< storm::logic::Formula, SolutionType > const &checkTask)
bool isOptimizationDirectionSet() const
Retrieves whether an optimization direction was set.
bool isQualitativeSet() const
Retrieves whether the computation only needs to be performed qualitatively, because the values will o...
FormulaType const & getFormula() const
Retrieves the formula from this task.
bool isProduceSchedulersSet() const
Retrieves whether scheduler(s) are to be produced (if supported).
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 > computeBoundedUntilProbabilities(Environment const &env, CheckTask< storm::logic::BoundedUntilFormula, ValueType > const &checkTask) override
static bool canHandleStatic(CheckTask< storm::logic::Formula, ValueType > 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 > computeUntilProbabilities(Environment const &env, CheckTask< storm::logic::UntilFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeLTLProbabilities(Environment const &env, CheckTask< storm::logic::PathFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeLongRunAverageProbabilities(Environment const &env, CheckTask< storm::logic::StateFormula, ValueType > const &checkTask) override
SparseMarkovAutomatonModelType::ValueType ValueType
virtual std::unique_ptr< CheckResult > checkMultiObjectiveFormula(Environment const &env, CheckTask< storm::logic::MultiObjectiveFormula, ValueType > const &checkTask) override
SparseMarkovAutomatonCslModelChecker(SparseMarkovAutomatonModelType const &model)
virtual bool canHandle(CheckTask< storm::logic::Formula, ValueType > const &checkTask) const override
virtual std::unique_ptr< CheckResult > computeGloballyProbabilities(Environment const &env, CheckTask< storm::logic::GloballyFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeTotalRewards(Environment const &env, CheckTask< storm::logic::TotalRewardFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeNextProbabilities(Environment const &env, CheckTask< storm::logic::NextFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeHOAPathProbabilities(Environment const &env, CheckTask< storm::logic::HOAPathFormula, 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 > computeReachabilityTimes(Environment const &env, CheckTask< storm::logic::EventuallyFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeReachabilityRewards(Environment const &env, CheckTask< storm::logic::EventuallyFormula, ValueType > const &checkTask) override
SparsePropositionalModelChecker(SparseMarkovAutomatonModelType const &model)
SparseMarkovAutomatonModelType const & getModel() const
Helper class for LTL model checking.
static MDPSparseModelCheckingHelperReturnType< ValueType > computeTotalRewards(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, RewardModelType const &rewardModel, bool produceScheduler)
static MDPSparseModelCheckingHelperReturnType< ValueType > computeReachabilityRewards(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, RewardModelType const &rewardModel, storm::storage::BitVector const &psiStates, bool produceScheduler)
static MDPSparseModelCheckingHelperReturnType< ValueType > computeUntilProbabilities(Environment const &env, OptimizationDirection dir, 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)
static MDPSparseModelCheckingHelperReturnType< ValueType > computeReachabilityTimes(Environment const &env, OptimizationDirection dir, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, storm::storage::BitVector const &psiStates, bool produceScheduler)
static std::vector< ValueType > computeBoundedUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &transitionMatrix, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &markovianStates, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, std::pair< double, double > const &boundsPair)
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)
Helper class for model checking queries that depend on the long run behavior of the (nondeterministic...
This class defines which action is chosen in a particular state of a non-deterministic model.
#define STORM_LOG_THROW(cond, exception, message)
FragmentSpecification csrlstar()
FragmentSpecification multiObjective()
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.
std::unique_ptr< CheckResult > performMultiObjectiveModelChecking(Environment const &env, SparseModelType const &model, storm::logic::MultiObjectiveFormula const &formula, bool produceScheduler)
FilteredRewardModel< RewardModelType > createFilteredRewardModel(RewardModelType const &baseRewardModel, storm::logic::RewardAccumulation const &acc, bool isDiscreteTimeModel)
static const bool SupportsExponential