23template<
typename SparseMarkovAutomatonModelType>
29template<
typename ModelType>
31 bool* requiresSingleInitialState) {
41 auto multiObjectiveFragment =
44 singleObjectiveFragment.setBoundedUntilFormulasAllowed(
false).setCumulativeRewardFormulasAllowed(
false);
45 multiObjectiveFragment.setTimeBoundedUntilFormulasAllowed(
false).setCumulativeRewardFormulasAllowed(
false);
47 if (checkTask.
getFormula().isInFragment(singleObjectiveFragment)) {
50 if (requiresSingleInitialState) {
51 *requiresSingleInitialState =
true;
58template<
typename SparseMarkovAutomatonModelType>
60 bool requiresSingleInitialState =
false;
62 return !requiresSingleInitialState || this->
getModel().getInitialStates().getNumberOfSetBits() == 1;
68template<
typename SparseMarkovAutomatonModelType>
73 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
75 "Unable to compute time-bounded reachability probabilities in non-closed Markov automaton.");
83 "Currently step-bounded and reward-bounded properties on MAs are not supported.");
84 double lowerBound = 0;
85 std::optional<double> upperBound;
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 STORM_LOG_INFO(
"Computing reachability probabilities with certificate ...");
145 std::optional<storm::storage::BitVector> constraintStates;
146 std::optional<std::string> constraintLabel;
155 return std::make_unique<ExplicitCertificateCheckResult<ValueType>>(std::move(certificate), std::move(allStates));
157 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Certificates are not implemented for this value type.");
161 env, checkTask.
getOptimizationDirection(), this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(),
165 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
170template<
typename SparseMarkovAutomatonModelType>
179 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<ValueType>().getTruthValuesVector();
182 std::vector<ValueType> numericResult =
helper.computeDAProductProbabilities(env, *pathFormula.
readAutomaton(), apSets);
186 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(
193template<
typename SparseMarkovAutomatonModelType>
199 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
205 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<ValueType>().getTruthValuesVector();
207 std::vector<ValueType> numericResult =
helper.computeLTLProbabilities(env, pathFormula, formulaChecker);
211 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(
218template<
typename SparseMarkovAutomatonModelType>
223 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
225 "Unable to compute reachability rewards in non-closed Markov automaton.");
226 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
231 STORM_LOG_INFO(
"Computing reachability rewards with certificate ...");
234 for (
auto const markovianState : this->
getModel().getMarkovianStates()) {
237 std::vector<ValueType> totalRewardVector = rewardModel.get().getTotalActionRewardVector(this->
getModel().getTransitionMatrix(), stateRewardWeights);
242 return std::make_unique<ExplicitCertificateCheckResult<ValueType>>(std::move(certificate), std::move(allStates));
244 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Certificates are not implemented for this value type.");
248 env, checkTask.
getOptimizationDirection(), this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(),
249 this->getModel().getExitRates(), this->getModel().getMarkovianStates(), rewardModel.get(), subResult.
getTruthValuesVector(),
253 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
258template<
typename SparseMarkovAutomatonModelType>
262 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
264 "Unable to compute reachability rewards in non-closed Markov automaton.");
268 env, checkTask.
getOptimizationDirection(), this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(),
269 this->getModel().getExitRates(), this->getModel().getMarkovianStates(), rewardModel.get(), checkTask.
isProduceSchedulersSet());
272 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
277template<
typename SparseMarkovAutomatonModelType>
282 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
284 "Unable to compute long-run average in non-closed Markov automaton.");
285 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, stateFormula);
300template<
typename SparseMarkovAutomatonModelType>
304 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
306 "Unable to compute long run average rewards in non-closed Markov automaton.");
312 auto values =
helper.computeLongRunAverageRewards(env, rewardModel.get());
321template<
typename SparseMarkovAutomatonModelType>
326 "Formula needs to specify whether minimal or maximal values are to be computed on nondeterministic model.");
328 "Unable to compute expected times in non-closed Markov automaton.");
329 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
334 STORM_LOG_INFO(
"Computing reachability times with certificate ...");
337 for (
auto const markovianState : this->
getModel().getMarkovianStates()) {
338 timeRewards[this->
getModel().getTransitionMatrix().getRowGroupIndices()[markovianState]] =
345 return std::make_unique<ExplicitCertificateCheckResult<ValueType>>(std::move(certificate), std::move(allStates));
347 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"Certificates are not implemented for this value type.");
351 env, checkTask.
getOptimizationDirection(), this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(),
355 result->asExplicitQuantitativeCheckResult<
ValueType>().setScheduler(std::move(ret.scheduler));
360template<
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 isProduceCertificateSet() const
Retrieves whether certificate(s) are to be produced (if supported).
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.
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.
A qualitative check result over the states of a sparse model.
vector_type const & getTruthValuesVector() const
Retrieves the truth values, one per state this result is for.
A quantitative check result over the states of a sparse model.
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 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, storm::utility::ExtendedValueType< 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, storm::utility::ExtendedValueType< 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< ValueType, storm::utility::ExtendedValueType< 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< 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...
A bit vector that is internally represented as a vector of 64-bit values.
This class defines which action is chosen in a particular state of a non-deterministic model.
#define STORM_LOG_INFO(message)
#define STORM_LOG_WARN_COND(cond, message)
#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)
constexpr bool SupportsCertificates
Certificates can be computed for models with these value types.
std::unique_ptr< ReachabilityRewardCertificate< ValueType > > computeReachabilityRewardCertificate(storm::Environment const &env, std::optional< storm::OptimizationDirection > dir, storm::storage::SparseMatrix< ValueType > const &transitionProbabilityMatrix, storm::storage::BitVector targetStates, std::vector< ValueType > stateActionRewardVector, std::string targetLabel, std::string rewardModelName)
Computes a certificate for expected rewards accumulated until reaching the target states.
std::unique_ptr< ReachabilityProbabilityCertificate< ValueType > > computeReachabilityProbabilityCertificate(storm::Environment const &env, std::optional< storm::OptimizationDirection > dir, storm::storage::SparseMatrix< ValueType > const &transitionProbabilityMatrix, storm::storage::BitVector targetStates, std::optional< storm::storage::BitVector > constraintStates, std::string targetLabel, std::optional< std::string > constraintLabel)
Computes a certificate for reachability probabilities (or constrained reachability probabilities if c...
FilteredRewardModel< RewardModelType > createFilteredRewardModel(RewardModelType const &baseRewardModel, storm::logic::RewardAccumulation const &acc, bool isDiscreteTimeModel)
The contract of a DD backend.
static const bool SupportsExponential