Browse Source
Done with PrCTL.
Done with PrCTL.
- Began removing NoBoundFormulas, since they might not be needed anymore. This task will be taken over by filters if they are to be implemented.
Next up: CSL
Former-commit-id: 6164f73737
main
23 changed files with 945 additions and 466 deletions
-
3src/formula/Prctl.h
-
83src/formula/Prctl/AbstractNoBoundOperator.h
-
4src/formula/Prctl/AbstractPathFormula.h
-
31src/formula/Prctl/AbstractPrctlFormula.h
-
4src/formula/Prctl/AbstractStateFormula.h
-
81src/formula/Prctl/BoundedEventually.h
-
105src/formula/Prctl/BoundedNaryUntil.h
-
116src/formula/Prctl/BoundedUntil.h
-
51src/formula/Prctl/CumulativeReward.h
-
63src/formula/Prctl/Eventually.h
-
63src/formula/Prctl/Globally.h
-
54src/formula/Prctl/InstantaneousReward.h
-
67src/formula/Prctl/Next.h
-
4src/formula/Prctl/Not.h
-
10src/formula/Prctl/Or.h
-
141src/formula/Prctl/ProbabilisticBoundOperator.h
-
115src/formula/Prctl/ProbabilisticNoBoundOperator.h
-
58src/formula/Prctl/ReachabilityReward.h
-
133src/formula/Prctl/RewardBoundOperator.h
-
108src/formula/Prctl/RewardNoBoundOperator.h
-
23src/formula/Prctl/SteadyStateReward.h
-
93src/formula/Prctl/Until.h
-
1src/modelchecker/prctl/AbstractModelChecker.h
@ -1,83 +0,0 @@ |
|||||
/* |
|
||||
* AbstractNoBoundOperator.h |
|
||||
* |
|
||||
* Created on: 16.04.2013 |
|
||||
* Author: thomas |
|
||||
*/ |
|
||||
|
|
||||
#ifndef STORM_FORMULA_PRCTL_ABSTRACTNOBOUNDOPERATOR_H_ |
|
||||
#define STORM_FORMULA_PRCTL_ABSTRACTNOBOUNDOPERATOR_H_ |
|
||||
|
|
||||
#include "src/formula/AbstractFormula.h" |
|
||||
#include "src/formula/abstract/IOptimizingOperator.h" |
|
||||
|
|
||||
namespace storm { |
|
||||
namespace property { |
|
||||
namespace prctl { |
|
||||
|
|
||||
template <class T> |
|
||||
class AbstractNoBoundOperator; |
|
||||
|
|
||||
/*! |
|
||||
* @brief Interface class for model checkers that support PathNoBoundOperator. |
|
||||
* |
|
||||
* All model checkers that support the formula class NoBoundOperator must inherit |
|
||||
* this pure virtual class. |
|
||||
*/ |
|
||||
template <class T> |
|
||||
class INoBoundOperatorModelChecker { |
|
||||
public: |
|
||||
/*! |
|
||||
* @brief Evaluates NoBoundOperator formula within a model checker. |
|
||||
* |
|
||||
* @param obj Formula object with subformulas. |
|
||||
* @return Result of the formula for every node. |
|
||||
*/ |
|
||||
virtual std::vector<T> checkNoBoundOperator(const AbstractNoBoundOperator<T>& obj) const = 0; |
|
||||
|
|
||||
|
|
||||
}; |
|
||||
|
|
||||
/*! |
|
||||
* Interface class for all PRCTL No bound operators |
|
||||
*/ |
|
||||
template <class T> |
|
||||
class AbstractNoBoundOperator: public storm::property::AbstractFormula<T>, |
|
||||
public virtual storm::property::IOptimizingOperator { |
|
||||
public: |
|
||||
AbstractNoBoundOperator() { |
|
||||
// Intentionally left empty. |
|
||||
|
|
||||
} |
|
||||
virtual ~AbstractNoBoundOperator() { |
|
||||
// Intentionally left empty |
|
||||
} |
|
||||
|
|
||||
/*! |
|
||||
* Clones the called object. |
|
||||
* |
|
||||
* Performs a "deep copy", i.e. the subtrees of the new object are clones of the original ones |
|
||||
* |
|
||||
* @note This function is not implemented in this class. |
|
||||
* @returns a new AND-object that is identical the called object. |
|
||||
*/ |
|
||||
virtual AbstractNoBoundOperator<T>* clone() const = 0; |
|
||||
|
|
||||
/*! |
|
||||
* Calls the model checker to check this formula. |
|
||||
* Needed to infer the correct type of formula class. |
|
||||
* |
|
||||
* @note This function should only be called in a generic check function of a model checker class. For other uses, |
|
||||
* the methods of the model checker should be used. |
|
||||
* |
|
||||
* @note This function is not implemented in this class. |
|
||||
* |
|
||||
* @returns A vector indicating the probability that the formula holds for each state. |
|
||||
*/ |
|
||||
virtual std::vector<T> check(const storm::modelchecker::prctl::AbstractModelChecker<T>& modelChecker, bool qualitative=false) const = 0; |
|
||||
}; |
|
||||
|
|
||||
} /* namespace prctl */ |
|
||||
} /* namespace property */ |
|
||||
} /* namespace storm */ |
|
||||
#endif /* STORM_FORMULA_PRCTL_ABSTRACTNOBOUNDOPERATOR_H_ */ |
|
@ -0,0 +1,31 @@ |
|||||
|
/* |
||||
|
* AbstractPrctlFormula.h |
||||
|
* |
||||
|
* Created on: 16.04.2013 |
||||
|
* Author: thomas |
||||
|
*/ |
||||
|
|
||||
|
#ifndef STORM_FORMULA_PRCTL_ABSTRACTPRCTLFORMULA_H_ |
||||
|
#define STORM_FORMULA_PRCTL_ABSTRACTPRCTLFORMULA_H_ |
||||
|
|
||||
|
#include "src/formula/AbstractFormula.h" |
||||
|
|
||||
|
namespace storm { |
||||
|
namespace property { |
||||
|
namespace prctl { |
||||
|
|
||||
|
/*! |
||||
|
* Interface class for all PRCTL root formulas. |
||||
|
*/ |
||||
|
template<class T> |
||||
|
class AbstractPrctlFormula : public virtual storm::property::AbstractFormula<T> { |
||||
|
public: |
||||
|
virtual ~AbstractPrctlFormula() { |
||||
|
// Intentionally left empty |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
} /* namespace prctl */ |
||||
|
} /* namespace property */ |
||||
|
} /* namespace storm */ |
||||
|
#endif /* ABSTRACTPRCTLFORMULA_H_ */ |
@ -1,115 +0,0 @@ |
|||||
/* |
|
||||
* ProbabilisticNoBoundOperator.h |
|
||||
* |
|
||||
* Created on: 12.12.2012 |
|
||||
* Author: thomas |
|
||||
*/ |
|
||||
|
|
||||
#ifndef STORM_FORMULA_PRCTL_PROBABILISTICNOBOUNDOPERATOR_H_ |
|
||||
#define STORM_FORMULA_PRCTL_PROBABILISTICNOBOUNDOPERATOR_H_ |
|
||||
|
|
||||
#include "AbstractPathFormula.h" |
|
||||
#include "AbstractNoBoundOperator.h" |
|
||||
#include "src/formula/abstract/ProbabilisticNoBoundOperator.h" |
|
||||
|
|
||||
namespace storm { |
|
||||
namespace property { |
|
||||
namespace prctl { |
|
||||
|
|
||||
/*! |
|
||||
* @brief |
|
||||
* Class for an abstract formula tree with a P (probablistic) operator without declaration of probabilities |
|
||||
* as root. |
|
||||
* |
|
||||
* Checking a formula with this operator as root returns the probabilities that the path formula holds |
|
||||
* (for each state) |
|
||||
* |
|
||||
* Has one Abstract path formula as sub formula/tree. |
|
||||
* |
|
||||
* @note |
|
||||
* This class is a hybrid of a state and path formula, and may only appear as the outermost operator. |
|
||||
* Hence, it is seen as neither a state nor a path formula, but is directly derived from AbstractFormula. |
|
||||
* |
|
||||
* @note |
|
||||
* This class does not contain a check() method like the other formula classes. |
|
||||
* The check method should only be called by the model checker to infer the correct check function for sub |
|
||||
* formulas. As this operator can only appear at the root, the method is not useful here. |
|
||||
* Use the checkProbabilisticNoBoundOperator method from the DtmcPrctlModelChecker class instead. |
|
||||
* |
|
||||
* The subtree is seen as part of the object and deleted with it |
|
||||
* (this behavior can be prevented by setting them to NULL before deletion) |
|
||||
* |
|
||||
* |
|
||||
* @see AbstractStateFormula |
|
||||
* @see AbstractPathFormula |
|
||||
* @see ProbabilisticOperator |
|
||||
* @see ProbabilisticIntervalOperator |
|
||||
* @see AbstractPrctlFormula |
|
||||
*/ |
|
||||
template <class T> |
|
||||
class ProbabilisticNoBoundOperator: public storm::property::abstract::ProbabilisticNoBoundOperator<T, AbstractPathFormula<T>>, |
|
||||
public AbstractNoBoundOperator<T> { |
|
||||
public: |
|
||||
/*! |
|
||||
* Empty constructor |
|
||||
*/ |
|
||||
ProbabilisticNoBoundOperator() { |
|
||||
// Intentionally left empty |
|
||||
} |
|
||||
|
|
||||
/*! |
|
||||
* Constructor |
|
||||
* |
|
||||
* @param pathFormula The child node. |
|
||||
*/ |
|
||||
ProbabilisticNoBoundOperator(AbstractPathFormula<T>* pathFormula) |
|
||||
: storm::property::abstract::ProbabilisticNoBoundOperator<T, AbstractPathFormula<T>>(pathFormula) { |
|
||||
// Intentionally left empty |
|
||||
} |
|
||||
|
|
||||
/*! |
|
||||
* Constructor |
|
||||
* |
|
||||
* @param pathFormula The child node. |
|
||||
*/ |
|
||||
ProbabilisticNoBoundOperator(AbstractPathFormula<T>* pathFormula, bool minimumOperator) |
|
||||
: storm::property::abstract::ProbabilisticNoBoundOperator<T, AbstractPathFormula<T>>(pathFormula, minimumOperator) { |
|
||||
// Intentionally left empty |
|
||||
} |
|
||||
|
|
||||
/*! |
|
||||
* Destructor |
|
||||
*/ |
|
||||
virtual ~ProbabilisticNoBoundOperator() { |
|
||||
// Intentionally left empty |
|
||||
} |
|
||||
|
|
||||
virtual AbstractNoBoundOperator<T>* clone() const override { |
|
||||
ProbabilisticNoBoundOperator<T>* result = new ProbabilisticNoBoundOperator<T>(); |
|
||||
if (this->pathFormulaIsSet()) { |
|
||||
result->setPathFormula(this->getPathFormula().clone()); |
|
||||
} |
|
||||
return result; |
|
||||
} |
|
||||
|
|
||||
/*! |
|
||||
* Calls the model checker to check this formula. |
|
||||
* Needed to infer the correct type of formula class. |
|
||||
* |
|
||||
* @note This function should only be called in a generic check function of a model checker class. For other uses, |
|
||||
* the methods of the model checker should be used. |
|
||||
* |
|
||||
* @note This function is not implemented in this class. |
|
||||
* |
|
||||
* @returns A vector indicating the probability that the formula holds for each state. |
|
||||
*/ |
|
||||
virtual std::vector<T> check(const storm::modelchecker::prctl::AbstractModelChecker<T>& modelChecker, bool qualitative=false) const override { |
|
||||
return this->getPathFormula().check(modelChecker, qualitative); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
} //namespace prctl |
|
||||
} //namespace property |
|
||||
} //namespace storm |
|
||||
|
|
||||
#endif /* STORM_FORMULA_PRCTL_PROBABILISTICNOBOUNDOPERATOR_H_ */ |
|
@ -1,108 +0,0 @@ |
|||||
/* |
|
||||
* RewardNoBoundOperator.h |
|
||||
* |
|
||||
* Created on: 25.12.2012 |
|
||||
* Author: Christian Dehnert |
|
||||
*/ |
|
||||
|
|
||||
#ifndef STORM_FORMULA_PRCTL_REWARDNOBOUNDOPERATOR_H_ |
|
||||
#define STORM_FORMULA_PRCTL_REWARDNOBOUNDOPERATOR_H_ |
|
||||
|
|
||||
#include "AbstractNoBoundOperator.h" |
|
||||
#include "AbstractPathFormula.h" |
|
||||
#include "src/formula/abstract/RewardNoBoundOperator.h" |
|
||||
|
|
||||
namespace storm { |
|
||||
namespace property { |
|
||||
namespace prctl { |
|
||||
|
|
||||
/*! |
|
||||
* @brief |
|
||||
* Class for an abstract formula tree with a R (reward) operator without declaration of reward values |
|
||||
* as root. |
|
||||
* |
|
||||
* Checking a formula with this operator as root returns the reward for the reward path formula for |
|
||||
* each state |
|
||||
* |
|
||||
* Has one Abstract path formula as sub formula/tree. |
|
||||
* |
|
||||
* @note |
|
||||
* This class is a hybrid of a state and path formula, and may only appear as the outermost operator. |
|
||||
* Hence, it is seen as neither a state nor a path formula, but is directly derived from AbstractFormula. |
|
||||
* |
|
||||
* @note |
|
||||
* This class does not contain a check() method like the other formula classes. |
|
||||
* The check method should only be called by the model checker to infer the correct check function for sub |
|
||||
* formulas. As this operator can only appear at the root, the method is not useful here. |
|
||||
* Use the checkRewardNoBoundOperator method from the DtmcPrctlModelChecker class instead. |
|
||||
* |
|
||||
* The subtree is seen as part of the object and deleted with it |
|
||||
* (this behavior can be prevented by setting them to NULL before deletion) |
|
||||
* |
|
||||
* |
|
||||
* @see AbstractStateFormula |
|
||||
* @see AbstractPathFormula |
|
||||
* @see ProbabilisticOperator |
|
||||
* @see ProbabilisticIntervalOperator |
|
||||
* @see AbstractPrctlFormula |
|
||||
*/ |
|
||||
template <class T> |
|
||||
class RewardNoBoundOperator: public storm::property::abstract::RewardNoBoundOperator<T, AbstractPathFormula<T>>, |
|
||||
public storm::property::prctl::AbstractNoBoundOperator<T> { |
|
||||
public: |
|
||||
/*! |
|
||||
* Empty constructor |
|
||||
*/ |
|
||||
RewardNoBoundOperator() { |
|
||||
// Intentionally left empty |
|
||||
} |
|
||||
|
|
||||
/*! |
|
||||
* Constructor |
|
||||
* |
|
||||
* @param pathFormula The child node. |
|
||||
*/ |
|
||||
RewardNoBoundOperator(AbstractPathFormula<T>* pathFormula) |
|
||||
: storm::property::abstract::RewardNoBoundOperator<T, AbstractPathFormula<T>>(pathFormula) { |
|
||||
// Intentionally left empty |
|
||||
} |
|
||||
|
|
||||
/*! |
|
||||
* Constructor |
|
||||
* |
|
||||
* @param pathFormula The child node. |
|
||||
*/ |
|
||||
RewardNoBoundOperator(AbstractPathFormula<T>* pathFormula, bool minimumOperator) |
|
||||
: storm::property::abstract::RewardNoBoundOperator<T, AbstractPathFormula<T>>(pathFormula, minimumOperator) { |
|
||||
// Intentionally left empty |
|
||||
} |
|
||||
|
|
||||
virtual AbstractNoBoundOperator<T>* clone() const override { |
|
||||
RewardNoBoundOperator<T>* result = new RewardNoBoundOperator<T>(); |
|
||||
if (this->pathFormulaIsSet()) { |
|
||||
result->setPathFormula(this->getPathFormula().clone()); |
|
||||
} |
|
||||
return result; |
|
||||
} |
|
||||
|
|
||||
/*! |
|
||||
* Calls the model checker to check this formula. |
|
||||
* Needed to infer the correct type of formula class. |
|
||||
* |
|
||||
* @note This function should only be called in a generic check function of a model checker class. For other uses, |
|
||||
* the methods of the model checker should be used. |
|
||||
* |
|
||||
* @note This function is not implemented in this class. |
|
||||
* |
|
||||
* @returns A vector indicating the probability that the formula holds for each state. |
|
||||
*/ |
|
||||
virtual std::vector<T> check(const storm::modelchecker::prctl::AbstractModelChecker<T>& modelChecker, bool qualitative=false) const override { |
|
||||
return this->getPathFormula().check(modelChecker, qualitative); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
} //namespace prctl |
|
||||
} //namespace property |
|
||||
} //namespace storm |
|
||||
|
|
||||
#endif /* STORM_FORMULA_PRCTL_REWARDNOBOUNDOPERATOR_H_ */ |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue