3#include <boost/core/typeinfo.hpp>
35namespace modelchecker {
37template<
typename ModelType>
39 return std::string(boost::core::demangled_name(BOOST_CORE_TYPEID(*
this)));
42template<
typename ModelType>
45 return this->check(env, checkTask);
48template<
typename ModelType>
51 STORM_LOG_THROW(this->canHandle(checkTask), storm::exceptions::InvalidArgumentException,
52 "The model checker (" << getClassName() <<
") is not able to check the formula '" << formula <<
"'.");
56 STORM_LOG_THROW(
false, storm::exceptions::InvalidArgumentException,
"The given formula '" << formula <<
"' is invalid.");
59template<
typename ModelType>
86 STORM_LOG_THROW(
false, storm::exceptions::InvalidArgumentException,
"The given formula '" << formula <<
"' is invalid.");
89template<
typename ModelType>
93 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
96template<
typename ModelType>
100 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
103template<
typename ModelType>
111template<
typename ModelType>
115 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
118template<
typename ModelType>
122 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
125template<
typename ModelType>
129 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
132template<
typename ModelType>
135 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"This model checker does not support the formula: " << checkTask.
getFormula() <<
".");
138template<
typename ModelType>
141 STORM_LOG_THROW(
false, storm::exceptions::NotImplementedException,
"This model checker does not support the formula: " << checkTask.
getFormula() <<
".");
144template<
typename ModelType>
148 std::unique_ptr<CheckResult> resultPointer = this->check(env, checkTask.
getFormula());
149 if (resultPointer->isExplicitQualitativeCheckResult()) {
151 return std::make_unique<ExplicitQuantitativeCheckResult<SolutionType>>(resultPointer->asExplicitQualitativeCheckResult());
153 STORM_LOG_ASSERT(resultPointer->isSymbolicQualitativeCheckResult(),
"Unexpected result type.");
156 return std::make_unique<SymbolicQuantitativeCheckResult<storm::models::GetDdType<ModelType::Representation>::ddType,
SolutionType>>(qualRes);
160template<
typename ModelType>
181 STORM_LOG_THROW(
false, storm::exceptions::InvalidArgumentException,
"The given formula '" << rewardFormula <<
"' is invalid.");
184template<
typename ModelType>
188 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
191template<
typename ModelType>
195 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
198template<
typename ModelType>
202 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
205template<
typename ModelType>
209 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
212template<
typename ModelType>
216 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
219template<
typename ModelType>
223 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
226template<
typename ModelType>
230 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
233template<
typename ModelType>
237 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
240template<
typename ModelType>
244 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
247template<
typename ModelType>
255 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
258template<
typename ModelType>
262 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
265template<
typename ModelType>
300 STORM_LOG_THROW(
false, storm::exceptions::InvalidArgumentException,
"The given formula '" << stateFormula <<
"' is invalid.");
303template<
typename ModelType>
307 std::stringstream stream;
312template<
typename ModelType>
316 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
319template<
typename ModelType>
324 storm::exceptions::InvalidArgumentException,
"The given formula is invalid.");
326 std::unique_ptr<CheckResult> leftResult =
328 std::unique_ptr<CheckResult> rightResult =
331 STORM_LOG_THROW(leftResult->isQualitative() && rightResult->isQualitative(), storm::exceptions::InternalTypeErrorException,
332 "Expected qualitative results.");
334 if (stateFormula.
isAnd()) {
335 leftResult->asQualitativeCheckResult() &= rightResult->asQualitativeCheckResult();
336 }
else if (stateFormula.
isOr()) {
337 leftResult->asQualitativeCheckResult() |= rightResult->asQualitativeCheckResult();
339 STORM_LOG_THROW(
false, storm::exceptions::InvalidArgumentException,
"The given formula '" << stateFormula <<
"' is invalid.");
345template<
typename ModelType>
349 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
352template<
typename ModelType>
359 STORM_LOG_THROW(result->isQuantitative(), storm::exceptions::InvalidOperationException,
360 "Unable to perform comparison operation on non-quantitative result.");
367template<
typename ModelType>
374 STORM_LOG_THROW(result->isQuantitative(), storm::exceptions::InvalidOperationException,
375 "Unable to perform comparison operation on non-quantitative result.");
382template<
typename ModelType>
391 STORM_LOG_THROW(result->isQuantitative(), storm::exceptions::InvalidOperationException,
392 "Unable to perform comparison operation on non-quantitative result.");
399template<
typename ModelType>
405 std::unique_ptr<CheckResult> result =
409 STORM_LOG_THROW(result->isQuantitative(), storm::exceptions::InvalidOperationException,
410 "Unable to perform comparison operation on non-quantitative result.");
417template<
typename ModelType>
421 std::unique_ptr<CheckResult> subResult = this->check(env, checkTask.template substituteFormula<storm::logic::Formula>(stateFormula.
getSubformula()));
422 STORM_LOG_THROW(subResult->isQualitative(), storm::exceptions::InternalTypeErrorException,
"Expected qualitative result.");
423 if (stateFormula.
isNot()) {
424 subResult->asQualitativeCheckResult().complement();
426 STORM_LOG_THROW(
false, storm::exceptions::InvalidArgumentException,
"The given formula '" << stateFormula <<
"' is invalid.");
431template<
typename ModelType>
435 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
438template<
typename ModelType>
442 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
445template<
typename ModelType>
449 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
452template<
typename ModelType>
456 "This model checker (" << getClassName() <<
") does not support the formula: " << checkTask.
getFormula() <<
".");
ModelCheckerEnvironment & modelchecker()
MultiObjectiveModelCheckerEnvironment & multi()
bool isLexicographicModelCheckingSet() const
virtual std::unique_ptr< CheckResult > computeProbabilities(Environment const &env, CheckTask< storm::logic::Formula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeCumulativeRewards(Environment const &env, CheckTask< storm::logic::CumulativeRewardFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeDiscountedCumulativeRewards(Environment const &env, CheckTask< storm::logic::DiscountedCumulativeRewardFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeGloballyProbabilities(Environment const &env, CheckTask< storm::logic::GloballyFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkLongRunAverageOperatorFormula(Environment const &env, CheckTask< storm::logic::LongRunAverageOperatorFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > check(Environment const &env, CheckTask< storm::logic::Formula, SolutionType > const &checkTask)
Checks the provided formula.
virtual std::unique_ptr< CheckResult > computeLTLProbabilities(Environment const &env, CheckTask< storm::logic::PathFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkRewardOperatorFormula(Environment const &env, CheckTask< storm::logic::RewardOperatorFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkAtomicLabelFormula(Environment const &env, CheckTask< storm::logic::AtomicLabelFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkQuantileFormula(Environment const &env, CheckTask< storm::logic::QuantileFormula, SolutionType > const &checkTask)
std::unique_ptr< CheckResult > computeStateFormulaProbabilities(Environment const &env, CheckTask< storm::logic::Formula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkUnaryBooleanStateFormula(Environment const &env, CheckTask< storm::logic::UnaryBooleanStateFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkProbabilityOperatorFormula(Environment const &env, CheckTask< storm::logic::ProbabilityOperatorFormula, SolutionType > const &checkTask)
typename std::conditional< std::is_same_v< ValueType, storm::Interval >, double, ValueType >::type SolutionType
virtual std::unique_ptr< CheckResult > computeTimes(Environment const &env, CheckTask< storm::logic::Formula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeConditionalRewards(Environment const &env, CheckTask< storm::logic::ConditionalFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkGameFormula(Environment const &env, CheckTask< storm::logic::GameFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkTimeOperatorFormula(Environment const &env, CheckTask< storm::logic::TimeOperatorFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkStateFormula(Environment const &env, CheckTask< storm::logic::StateFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeReachabilityRewards(Environment const &env, CheckTask< storm::logic::EventuallyFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkBinaryBooleanStateFormula(Environment const &env, CheckTask< storm::logic::BinaryBooleanStateFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeLongRunAverageProbabilities(Environment const &env, CheckTask< storm::logic::StateFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeUntilProbabilities(Environment const &env, CheckTask< storm::logic::UntilFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkLexObjectiveFormula(Environment const &env, CheckTask< storm::logic::MultiObjectiveFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeLongRunAverageRewards(Environment const &env, CheckTask< storm::logic::LongRunAverageRewardFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeHOAPathProbabilities(Environment const &env, CheckTask< storm::logic::HOAPathFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkMultiObjectiveFormula(Environment const &env, CheckTask< storm::logic::MultiObjectiveFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeReachabilityProbabilities(Environment const &env, CheckTask< storm::logic::EventuallyFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeConditionalProbabilities(Environment const &env, CheckTask< storm::logic::ConditionalFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkBooleanLiteralFormula(Environment const &env, CheckTask< storm::logic::BooleanLiteralFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeRewards(Environment const &env, CheckTask< storm::logic::Formula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeInstantaneousRewards(Environment const &env, CheckTask< storm::logic::InstantaneousRewardFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeNextProbabilities(Environment const &env, CheckTask< storm::logic::NextFormula, SolutionType > const &checkTask)
virtual std::string getClassName() const
Returns the name of the model checker class (e.g., for display in error messages).
virtual std::unique_ptr< CheckResult > computeReachabilityTimes(Environment const &env, CheckTask< storm::logic::EventuallyFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > checkAtomicExpressionFormula(Environment const &env, CheckTask< storm::logic::AtomicExpressionFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeTotalRewards(Environment const &env, CheckTask< storm::logic::TotalRewardFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeBoundedUntilProbabilities(Environment const &env, CheckTask< storm::logic::BoundedUntilFormula, SolutionType > const &checkTask)
virtual std::unique_ptr< CheckResult > computeDiscountedTotalRewards(Environment const &env, CheckTask< storm::logic::DiscountedTotalRewardFormula, SolutionType > const &checkTask)
bool isBoundSet() const
Retrieves whether there is a bound with which the values for the states will be compared.
ValueType getBoundThreshold() const
Retrieves the value of the bound (if set).
storm::logic::ComparisonType const & getBoundComparisonType() const
Retrieves the comparison type of the bound (if set).
CheckTask< NewFormulaType, ValueType > substituteFormula(NewFormulaType const &newFormula) const
Copies the check task from the source while replacing the formula with the new one.
FormulaType const & getFormula() const
Retrieves the formula from this task.
#define STORM_LOG_ASSERT(cond, message)
#define STORM_LOG_THROW(cond, exception, message)
std::unique_ptr< CheckResult > computeConditionalProbabilities(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, storm::storage::BitVector const &conditionStates)