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 std::optional<double> upperBound;
97template<
typename SparseMarkovAutomatonModelType>
102 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
103 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, pathFormula.
getSubformula());
111template<
typename SparseMarkovAutomatonModelType>
116 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
117 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, pathFormula.
getSubformula());
124 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
129template<
typename SparseMarkovAutomatonModelType>
134 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
141 env, checkTask.
getOptimizationDirection(), this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(),
145 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
150template<
typename SparseMarkovAutomatonModelType>
159 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<ValueType>().getTruthValuesVector();
162 std::vector<ValueType> numericResult =
helper.computeDAProductProbabilities(env, *pathFormula.
readAutomaton(), apSets);
166 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(
173template<
typename SparseMarkovAutomatonModelType>
179 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
185 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<ValueType>().getTruthValuesVector();
187 std::vector<ValueType> numericResult =
helper.computeLTLProbabilities(env, pathFormula, formulaChecker);
191 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(
198template<
typename SparseMarkovAutomatonModelType>
203 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
205 "Unable to compute reachability rewards in non-closed Markov automaton.");
206 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
211 env, checkTask.
getOptimizationDirection(), this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(),
212 this->getModel().getExitRates(), this->getModel().getMarkovianStates(), rewardModel.get(), subResult.
getTruthValuesVector(),
216 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
221template<
typename SparseMarkovAutomatonModelType>
225 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
227 "Unable to compute reachability rewards in non-closed Markov automaton.");
231 env, checkTask.
getOptimizationDirection(), this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(),
232 this->getModel().getExitRates(), this->getModel().getMarkovianStates(), rewardModel.get(), checkTask.
isProduceSchedulersSet());
235 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
240template<
typename SparseMarkovAutomatonModelType>
245 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
247 "Unable to compute long-run average in non-closed Markov automaton.");
248 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, stateFormula);
263template<
typename SparseMarkovAutomatonModelType>
267 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
269 "Unable to compute long run average rewards in non-closed Markov automaton.");
275 auto values =
helper.computeLongRunAverageRewards(env, rewardModel.get());
284template<
typename SparseMarkovAutomatonModelType>
289 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
291 "Unable to compute expected times in non-closed Markov automaton.");
292 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
296 env, checkTask.
getOptimizationDirection(), this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(),
300 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
305template<
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 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, std::optional< double > > const &boundsPair)
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 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