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->produceCertificate =
false;
43 this->qualitative =
false;
44 this->uncertaintyResolutionMode = UncertaintyResolutionMode::Unset;
53 template<
typename NewFormulaType>
56 this->onlyInitialStatesRelevant, this->bound, this->qualitative, this->produceSchedulers,
57 this->produceCertificate, this->hint, this->uncertaintyResolutionMode);
67 if (formula.get().isOperatorFormula()) {
74 this->bound = operatorFormula.
getBound();
79 }
else if (operatorFormula.
hasBound()) {
82 ? OptimizationDirection::Maximize
83 : OptimizationDirection::Minimize;
86 if (formula.get().isProbabilityOperatorFormula()) {
89 if (probabilityOperatorFormula.
hasBound()) {
92 this->qualitative =
true;
95 }
else if (formula.get().isRewardOperatorFormula()) {
99 if (rewardOperatorFormula.
hasBound()) {
101 this->qualitative =
true;
132 template<
typename NewValueType>
135 this->onlyInitialStatesRelevant, this->bound, this->qualitative, this->produceSchedulers,
136 this->produceCertificate, this->hint, this->uncertaintyResolutionMode);
143 return formula.get();
150 return static_cast<bool>(optimizationDirection);
157 return optimizationDirection.get();
164 optimizationDirection = dir;
171 return static_cast<bool>(playerCoalition);
178 return playerCoalition.get();
185 playerCoalition = coalition;
193 return static_cast<bool>(rewardModel);
200 return rewardModel.get();
207 return onlyInitialStatesRelevant;
214 this->onlyInitialStatesRelevant = value;
222 return static_cast<bool>(bound);
229 STORM_LOG_THROW(!bound.get().threshold.containsVariables(), storm::exceptions::InvalidOperationException,
230 "Cannot evaluate threshold '" << bound.get().threshold <<
"' as it contains undefined constants.");
231 return bound.get().template evaluateThresholdAs<ValueType>();
238 return bound.get().comparisonType;
275 this->produceSchedulers = produceSchedulers;
282 return produceSchedulers;
289 this->produceCertificate = produceCertificate;
296 return produceCertificate;
302 void setHint(std::shared_ptr<ModelCheckerHint>
const& hint) {
321 return uncertaintyResolutionMode;
328 this->uncertaintyResolutionMode = uncertaintyResolutionMode;
335 return isSet(this->uncertaintyResolutionMode);
362 CheckTask(std::reference_wrapper<FormulaType const>
const& formula, boost::optional<storm::OptimizationDirection>
const& optimizationDirection,
363 boost::optional<storm::logic::PlayerCoalition> playerCoalition, boost::optional<std::string>
const& rewardModel,
bool onlyInitialStatesRelevant,
364 boost::optional<storm::logic::Bound>
const& bound,
bool qualitative,
bool produceSchedulers,
bool produceCertificate,
367 optimizationDirection(optimizationDirection),
368 playerCoalition(playerCoalition),
369 rewardModel(rewardModel),
370 onlyInitialStatesRelevant(onlyInitialStatesRelevant),
372 qualitative(qualitative),
373 produceSchedulers(produceSchedulers),
374 produceCertificate(produceCertificate),
376 uncertaintyResolutionMode(uncertaintyResolutionMode) {
381 std::reference_wrapper<FormulaType const> formula;
384 boost::optional<storm::OptimizationDirection> optimizationDirection;
387 boost::optional<storm::logic::PlayerCoalition> playerCoalition;
390 boost::optional<std::string> rewardModel;
393 bool onlyInitialStatesRelevant;
396 boost::optional<storm::logic::Bound> bound;
403 bool produceSchedulers;
406 bool produceCertificate;
409 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.
void setProduceCertificate(bool produceCertificate=true)
Sets whether to produce certificates (if supported).
ValueType getBoundThreshold() const
Retrieves the value of the bound (if set).
ModelCheckerHint & getHint()
bool isProduceCertificateSet() const
Retrieves whether certificate(s) are to be produced (if supported).
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)
The contract of a DD backend.
solver::UncertaintyResolutionMode UncertaintyResolutionMode
solver::OptimizationDirection OptimizationDirection