21template<
typename SparseCtmcModelType>
27template<
typename ModelType>
37 fragment.setBoundedUntilFormulasAllowed(
false).setCumulativeRewardFormulasAllowed(
false).setInstantaneousFormulasAllowed(
false);
39 return checkTask.
getFormula().isInFragment(fragment);
42template<
typename SparseCtmcModelType>
47template<
typename SparseCtmcModelType>
51 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Computing bounded until probabilities is not supported for this numeric type.");
61 "Currently step-bounded or reward-bounded properties on CTMCs are not supported.");
63 std::optional<ValueType> upperBound;
74 this->getModel().getExitRateVector(), checkTask.
isQualitativeSet(), lowerBound, upperBound);
79template<
typename SparseCtmcModelType>
83 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, pathFormula.
getSubformula());
90template<
typename SparseCtmcModelType>
94 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, pathFormula.
getSubformula());
96 auto probabilisticTransitions = this->
getModel().computeProbabilityMatrix();
103template<
typename SparseCtmcModelType>
118template<
typename SparseCtmcModelType>
123 auto probabilisticTransitions = this->
getModel().computeProbabilityMatrix();
128 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<ValueType>().getTruthValuesVector();
131 std::vector<ValueType> numericResult =
helper.computeDAProductProbabilities(env, *pathFormula.
readAutomaton(), apSets);
136template<
typename SparseCtmcModelType>
141 auto probabilisticTransitions = this->
getModel().computeProbabilityMatrix();
146 return this->
check(env, formula)->template asExplicitQualitativeCheckResult<ValueType>().getTruthValuesVector();
148 std::vector<ValueType> numericResult =
helper.computeLTLProbabilities(env, pathFormula, formulaChecker);
153template<
typename SparseCtmcModelType>
157 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Computing instantaneous rewards is not supported for this numeric type.");
162 "Currently step-bounded properties on CTMCs are not supported.");
171template<
typename SparseCtmcModelType>
175 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Computing cumulative rewards is not supported for this numeric type.");
180 "Currently step-bounded and reward-bounded properties on CTMCs are not supported.");
189template<
typename SparseCtmcModelType>
193 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
203template<
typename SparseCtmcModelType>
213template<
typename SparseCtmcModelType>
217 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, stateFormula);
220 auto probabilisticTransitions = this->
getModel().computeProbabilityMatrix();
228template<
typename SparseCtmcModelType>
232 auto probabilisticTransitions = this->
getModel().computeProbabilityMatrix();
235 auto values =
helper.computeLongRunAverageRewards(env, rewardModel.get());
239template<
typename SparseCtmcModelType>
243 std::unique_ptr<CheckResult> subResultPointer = this->
check(env, eventuallyFormula.
getSubformula());
252template<
typename SparseCtmcModelType>
256 STORM_LOG_THROW(
false, storm::exceptions::NotSupportedException,
"Computing transient probabilities is not supported for this numeric type.");
261 "Currently step-bounded or reward-bounded properties on CTMCs are not supported.");
262 STORM_LOG_THROW(pathFormula.
hasUpperBound(), storm::exceptions::NotImplementedException,
"Computation needs upper limit for time bound.");
277template<
typename SparseCtmcModelType>
280 auto probabilisticTransitions = this->
getModel().computeProbabilityMatrix();
284 std::vector<ValueType> result;
285 auto const& initialStates = this->
getModel().getInitialStates();
286 uint64_t numInitStates = initialStates.getNumberOfSetBits();
287 if (numInitStates == 1) {
288 result =
helper.computeLongRunAverageStateDistribution(env, *initialStates.begin());
290 STORM_LOG_WARN(
"Multiple initial states found. A uniform distribution over initial states is assumed.");
292 result =
helper.computeLongRunAverageStateDistribution(env, [&initialStates, &initProb](uint64_t
const& stateIndex) {
301template<
typename SparseCtmcModelType>
304 auto probabilisticTransitions = this->
getModel().computeProbabilityMatrix();
308 std::vector<ValueType> result;
309 auto const& initialStates = this->
getModel().getInitialStates();
310 uint64_t numInitStates = initialStates.getNumberOfSetBits();
311 STORM_LOG_THROW(numInitStates > 0, storm::exceptions::InvalidOperationException,
"No initial states given. Cannot compute expected visiting times.");
312 STORM_LOG_WARN_COND(numInitStates == 1,
"Multiple initial states found. A uniform distribution over initial states is assumed.");
313 result =
helper.computeExpectedVisitingTimes(env, initialStates);
FragmentSpecification & setRewardAccumulationAllowed(bool newValue)
FragmentSpecification & setTimeOperatorsAllowed(bool newValue)
FragmentSpecification & setTotalRewardFormulasAllowed(bool newValue)
FragmentSpecification & setLongRunAverageRewardFormulasAllowed(bool newValue)
FragmentSpecification & setLongRunAverageProbabilitiesAllowed(bool newValue)
FragmentSpecification & setTimeAllowed(bool newValue)
virtual std::unique_ptr< CheckResult > check(Environment const &env, CheckTask< storm::logic::Formula, SolutionType > const &checkTask)
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.
vector_type const & getTruthValuesVector() const
virtual std::unique_ptr< CheckResult > computeCumulativeRewards(Environment const &env, CheckTask< storm::logic::CumulativeRewardFormula, 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 > computeReachabilityTimes(Environment const &env, CheckTask< storm::logic::EventuallyFormula, ValueType > const &checkTask) override
std::unique_ptr< CheckResult > computeExpectedVisitingTimes(Environment const &env)
Computes for each state the expected number of times we visit that state.
virtual std::unique_ptr< CheckResult > computeInstantaneousRewards(Environment const &env, CheckTask< storm::logic::InstantaneousRewardFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeLongRunAverageProbabilities(Environment const &env, CheckTask< storm::logic::StateFormula, ValueType > const &checkTask) override
static bool canHandleStatic(CheckTask< storm::logic::Formula, ValueType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeBoundedUntilProbabilities(Environment const &env, CheckTask< storm::logic::BoundedUntilFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeReachabilityRewards(Environment const &env, CheckTask< storm::logic::EventuallyFormula, 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 > computeNextProbabilities(Environment const &env, CheckTask< storm::logic::NextFormula, ValueType > const &checkTask) override
virtual bool canHandle(CheckTask< storm::logic::Formula, ValueType > const &checkTask) const override
SparseCtmcCslModelChecker(SparseCtmcModelType const &model)
std::unique_ptr< CheckResult > computeSteadyStateDistribution(Environment const &env)
Computes the long run average (or: steady state) distribution over all states Assumes a uniform distr...
SparseCtmcModelType::ValueType ValueType
virtual std::unique_ptr< CheckResult > computeTotalRewards(Environment const &env, CheckTask< storm::logic::TotalRewardFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeGloballyProbabilities(Environment const &env, CheckTask< storm::logic::GloballyFormula, ValueType > const &checkTask) override
std::vector< ValueType > computeAllTransientProbabilities(Environment const &env, CheckTask< storm::logic::BoundedUntilFormula, ValueType > const &checkTask)
Compute transient probabilities for all states.
virtual std::unique_ptr< CheckResult > computeUntilProbabilities(Environment const &env, CheckTask< storm::logic::UntilFormula, ValueType > const &checkTask) override
virtual std::unique_ptr< CheckResult > computeHOAPathProbabilities(Environment const &env, CheckTask< storm::logic::HOAPathFormula, ValueType > const &checkTask) override
SparsePropositionalModelChecker(SparseCtmcModelType const &model)
SparseCtmcModelType const & getModel() const
static std::vector< ValueType > computeReachabilityRewards(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, RewardModelType const &rewardModel, storm::storage::BitVector const &targetStates, bool qualitative)
static std::vector< ValueType > computeUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, bool qualitative)
static std::vector< ValueType > computeCumulativeRewards(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, std::vector< ValueType > const &exitRateVector, RewardModelType const &rewardModel, ValueType timeBound)
static std::vector< ValueType > computeAllTransientProbabilities(Environment const &env, storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::storage::BitVector const &initialStates, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, std::vector< ValueType > const &exitRates, ValueType timeBound)
static std::vector< ValueType > computeBoundedUntilProbabilities(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, storm::storage::BitVector const &phiStates, storm::storage::BitVector const &psiStates, std::vector< ValueType > const &exitRates, bool qualitative, ValueType lowerBound, std::optional< ValueType > const &upperBound)
static std::vector< ValueType > computeReachabilityTimes(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &targetStates, bool qualitative)
static std::vector< ValueType > computeNextProbabilities(Environment const &env, storm::storage::SparseMatrix< ValueType > const &rateMatrix, std::vector< ValueType > const &exitRateVector, storm::storage::BitVector const &nextStates)
static std::vector< ValueType > computeInstantaneousRewards(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, std::vector< ValueType > const &exitRateVector, RewardModelType const &rewardModel, ValueType timeBound)
static std::vector< ValueType > computeTotalRewards(Environment const &env, storm::solver::SolveGoal< ValueType > &&goal, storm::storage::SparseMatrix< ValueType > const &rateMatrix, storm::storage::SparseMatrix< ValueType > const &backwardTransitions, std::vector< ValueType > const &exitRateVector, RewardModelType const &rewardModel, bool qualitative)
Helper class for model checking queries that depend on the long run behavior of the (nondeterministic...
Helper class for computing for each state the expected number of times to visit that state assuming a...
static std::vector< 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)
Helper class for LTL model checking.
#define STORM_LOG_WARN(message)
#define STORM_LOG_WARN_COND(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
FragmentSpecification csrlstar()
void setInformationFromCheckTaskDeterministic(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.
FilteredRewardModel< RewardModelType > createFilteredRewardModel(RewardModelType const &baseRewardModel, storm::logic::RewardAccumulation const &acc, bool isDiscreteTimeModel)
TargetType convertNumber(SourceType const &number)
static const bool SupportsExponential