3#include <boost/optional.hpp>
29template<
typename FormulaType = storm::logic::Formula,
typename ValueType =
double>
32 template<
typename OtherFormulaType,
typename OtherValueType>
40 this->onlyInitialStatesRelevant = onlyInitialStatesRelevant;
41 this->produceSchedulers =
false;
42 this->qualitative =
false;
43 this->uncertaintyResolutionMode = UncertaintyResolutionMode::Unset;
52 template<
typename NewFormulaType>
55 this->onlyInitialStatesRelevant, this->bound, this->qualitative, this->produceSchedulers, this->hint,
56 this->uncertaintyResolutionMode);
66 if (formula.get().isOperatorFormula()) {
73 this->bound = operatorFormula.
getBound();
78 }
else if (operatorFormula.
hasBound()) {
81 ? OptimizationDirection::Maximize
82 : OptimizationDirection::Minimize;
85 if (formula.get().isProbabilityOperatorFormula()) {
88 if (probabilityOperatorFormula.
hasBound()) {
91 this->qualitative =
true;
94 }
else if (formula.get().isRewardOperatorFormula()) {
98 if (rewardOperatorFormula.
hasBound()) {
100 this->qualitative =
true;
131 template<
typename NewValueType>
134 this->onlyInitialStatesRelevant, this->bound, this->qualitative, this->produceSchedulers, this->hint,
135 this->uncertaintyResolutionMode);
142 return formula.get();
149 return static_cast<bool>(optimizationDirection);
156 return optimizationDirection.get();
163 optimizationDirection = dir;
170 return static_cast<bool>(playerCoalition);
177 return playerCoalition.get();
184 playerCoalition = coalition;
192 return static_cast<bool>(rewardModel);
199 return rewardModel.get();
206 return onlyInitialStatesRelevant;
213 this->onlyInitialStatesRelevant = value;
221 return static_cast<bool>(bound);
228 STORM_LOG_THROW(!bound.get().threshold.containsVariables(), storm::exceptions::InvalidOperationException,
229 "Cannot evaluate threshold '" << bound.get().threshold <<
"' as it contains undefined constants.");
230 return bound.get().template evaluateThresholdAs<ValueType>();
237 return bound.get().comparisonType;
274 this->produceSchedulers = produceSchedulers;
281 return produceSchedulers;
287 void setHint(std::shared_ptr<ModelCheckerHint>
const& hint) {
306 return uncertaintyResolutionMode;
313 this->uncertaintyResolutionMode = uncertaintyResolutionMode;
320 return isSet(this->uncertaintyResolutionMode);
346 CheckTask(std::reference_wrapper<FormulaType const>
const& formula, boost::optional<storm::OptimizationDirection>
const& optimizationDirection,
347 boost::optional<storm::logic::PlayerCoalition> playerCoalition, boost::optional<std::string>
const& rewardModel,
bool onlyInitialStatesRelevant,
348 boost::optional<storm::logic::Bound>
const& bound,
bool qualitative,
bool produceSchedulers, std::shared_ptr<ModelCheckerHint>
const& hint,
351 optimizationDirection(optimizationDirection),
352 playerCoalition(playerCoalition),
353 rewardModel(rewardModel),
354 onlyInitialStatesRelevant(onlyInitialStatesRelevant),
356 qualitative(qualitative),
357 produceSchedulers(produceSchedulers),
359 uncertaintyResolutionMode(uncertaintyResolutionMode) {
364 std::reference_wrapper<FormulaType const> formula;
367 boost::optional<storm::OptimizationDirection> optimizationDirection;
370 boost::optional<storm::logic::PlayerCoalition> playerCoalition;
373 boost::optional<std::string> rewardModel;
376 bool onlyInitialStatesRelevant;
379 boost::optional<storm::logic::Bound> bound;
386 bool produceSchedulers;
389 std::shared_ptr<ModelCheckerHint> hint;
bool isBoundSet() const
Retrieves whether there is a bound with which the values for the states will be compared.
CheckTask< FormulaType, ValueType > & setOnlyInitialStatesRelevant(bool value=true)
Sets whether only initial states are relevant.
void setOptimizationDirection(storm::OptimizationDirection const &dir)
Sets the optimization direction.
ValueType getBoundThreshold() const
Retrieves the value of the bound (if set).
ModelCheckerHint & getHint()
storm::logic::ComparisonType const & getBoundComparisonType() const
Retrieves the comparison type of the bound (if set).
void setUncertaintyResolutionMode(UncertaintyResolutionMode uncertaintyResolutionMode)
Sets the mode which decides how the uncertainty will be resolved.
bool isOptimizationDirectionSet() const
Retrieves whether an optimization direction was set.
CheckTask< NewFormulaType, ValueType > substituteFormula(NewFormulaType const &newFormula) const
Copies the check task from the source while replacing the formula with the new one.
CheckTask< FormulaType, ValueType > & setPlayerCoalition(storm::logic::PlayerCoalition const &coalition)
Sets the player coalition.
bool isRewardModelSet() const
Retrieves whether a reward model was set.
boost::optional< storm::logic::Bound > const & getOptionalBound() const
Retrieves the bound.
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.
ModelCheckerHint const & getHint() const
Retrieves a hint that might contain information that speeds up the modelchecking process (if supporte...
CheckTask negate() const
Negate the optimization direction and the bound threshold, if those exist.
bool isUncertaintyResolutionModeSet() const
Returns whether the mode, which decides how the uncertainty will be resolved, is set.
CheckTask(FormulaType const &formula, bool onlyInitialStatesRelevant=false, UncertaintyResolutionMode=UncertaintyResolutionMode::Unset)
Creates a task object with the default options for the given formula.
CheckTask< FormulaType, NewValueType > convertValueType() const
Copies the check task from the source while replacing the considered ValueType the new one.
void setHint(std::shared_ptr< ModelCheckerHint > const &hint)
sets a hint that might contain information that speeds up the modelchecking process (if supported by ...
bool isProduceSchedulersSet() const
Retrieves whether scheduler(s) are to be produced (if supported).
void setProduceSchedulers(bool produceSchedulers=true)
Sets whether to produce schedulers (if supported).
storm::logic::PlayerCoalition const & getPlayerCoalition() const
Retrieves the player coalition (if set).
storm::logic::Bound const & getBound() const
Retrieves the bound (if set).
storm::OptimizationDirection const & getOptimizationDirection() const
Retrieves the optimization direction (if set).
bool isPlayerCoalitionSet() const
Retrieves whether a player coalition was 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.
void updateOperatorInformation()
If the currently specified formula is an OperatorFormula, this method updates the information that is...
void setQualitative(bool value)
sets whether the computation only needs to be performed qualitatively, because the values will only b...
This class contains information that might accelerate the model checking process.
#define STORM_LOG_THROW(cond, exception, message)
ComparisonType invertPreserveStrictness(ComparisonType t)
bool isOne(ValueType const &a)
bool isZero(ValueType const &a)
solver::UncertaintyResolutionMode UncertaintyResolutionMode
solver::OptimizationDirection OptimizationDirection