Browse Source
Further work on the formuolas.
Further work on the formuolas.
- Finished the third and last logic: Csl.
- Note that nothing compiles as of yet. This is due to the removal of the NoBoundOperators wich are expected to be replaced by filters.
Former-commit-id: d26ae768f7
tempestpy_adaptions
masawei
11 years ago
25 changed files with 1011 additions and 476 deletions
-
2src/formula/Csl.h
-
4src/formula/Csl/AbstractCslFormula.h
-
83src/formula/Csl/AbstractNoBoundOperator.h
-
4src/formula/Csl/AbstractPathFormula.h
-
12src/formula/Csl/AbstractStateFormula.h
-
96src/formula/Csl/And.h
-
42src/formula/Csl/Ap.h
-
63src/formula/Csl/Eventually.h
-
68src/formula/Csl/Globally.h
-
71src/formula/Csl/Next.h
-
63src/formula/Csl/Not.h
-
140src/formula/Csl/Or.h
-
136src/formula/Csl/ProbabilisticBoundOperator.h
-
115src/formula/Csl/ProbabilisticNoBoundOperator.h
-
121src/formula/Csl/SteadyStateBoundOperator.h
-
100src/formula/Csl/SteadyStateNoBoundOperator.h
-
111src/formula/Csl/TimeBoundedEventually.h
-
142src/formula/Csl/TimeBoundedUntil.h
-
96src/formula/Csl/Until.h
-
2src/formula/Prctl/AbstractStateFormula.h
-
5src/formula/Prctl/Globally.h
-
4src/formula/Prctl/Next.h
-
1src/formula/Prctl/Not.h
-
5src/formula/Prctl/Or.h
-
1src/modelchecker/csl/AbstractModelChecker.h
@ -1,83 +0,0 @@ |
|||||
/* |
|
||||
* AbstractNoBoundOperator.h |
|
||||
* |
|
||||
* Created on: 16.04.2013 |
|
||||
* Author: thomas |
|
||||
*/ |
|
||||
|
|
||||
#ifndef STORM_FORMULA_CSL_ABSTRACTNOBOUNDOPERATOR_H_ |
|
||||
#define STORM_FORMULA_CSL_ABSTRACTNOBOUNDOPERATOR_H_ |
|
||||
|
|
||||
#include "AbstractCslFormula.h" |
|
||||
#include "src/formula/abstract/IOptimizingOperator.h" |
|
||||
|
|
||||
namespace storm { |
|
||||
namespace property { |
|
||||
namespace csl { |
|
||||
|
|
||||
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 CSL No Bound operators. |
|
||||
*/ |
|
||||
template <class T> |
|
||||
class AbstractNoBoundOperator: public AbstractCslFormula<T>, |
|
||||
public virtual storm::property::abstract::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::csl::AbstractModelChecker<T>& modelChecker, bool qualitative=false) const = 0; |
|
||||
}; |
|
||||
|
|
||||
} /* namespace csl */ |
|
||||
} /* namespace property */ |
|
||||
} /* namespace storm */ |
|
||||
#endif /* STORM_FORMULA_CSL_ABSTRACTNOBOUNDOPERATOR_H_ */ |
|
@ -1,115 +0,0 @@ |
|||||
/* |
|
||||
* ProbabilisticNoBoundOperator.h |
|
||||
* |
|
||||
* Created on: 12.12.2012 |
|
||||
* Author: thomas |
|
||||
*/ |
|
||||
|
|
||||
#ifndef STORM_FORMULA_CSL_PROBABILISTICNOBOUNDOPERATOR_H_ |
|
||||
#define STORM_FORMULA_CSL_PROBABILISTICNOBOUNDOPERATOR_H_ |
|
||||
|
|
||||
#include "AbstractPathFormula.h" |
|
||||
#include "AbstractNoBoundOperator.h" |
|
||||
#include "src/formula/abstract/ProbabilisticNoBoundOperator.h" |
|
||||
|
|
||||
namespace storm { |
|
||||
namespace property { |
|
||||
namespace csl { |
|
||||
|
|
||||
/*! |
|
||||
* @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 DtmccslModelChecker 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 AbstractCslFormula |
|
||||
*/ |
|
||||
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::csl::AbstractModelChecker<T>& modelChecker, bool qualitative=false) const override { |
|
||||
return this->getPathFormula().check(modelChecker, qualitative); |
|
||||
} |
|
||||
}; |
|
||||
|
|
||||
} //namespace csl |
|
||||
} //namespace property |
|
||||
} //namespace storm |
|
||||
|
|
||||
#endif /* STORM_FORMULA_CSL_PROBABILISTICNOBOUNDOPERATOR_H_ */ |
|
@ -1,100 +0,0 @@ |
|||||
/* |
|
||||
* SteadyStateNoBoundOperator.h |
|
||||
* |
|
||||
* Created on: 09.04.2013 |
|
||||
* Author: thomas |
|
||||
*/ |
|
||||
|
|
||||
#ifndef STORM_FORMULA_CSL_STEADYSTATENOBOUNDOPERATOR_H_ |
|
||||
#define STORM_FORMULA_CSL_STEADYSTATENOBOUNDOPERATOR_H_ |
|
||||
|
|
||||
#include "AbstractStateFormula.h" |
|
||||
#include "AbstractNoBoundOperator.h" |
|
||||
#include "src/formula/abstract/SteadyStateNoBoundOperator.h" |
|
||||
|
|
||||
namespace storm { |
|
||||
namespace property { |
|
||||
namespace csl { |
|
||||
|
|
||||
template <class T> class SteadyStateNoBoundOperator; |
|
||||
|
|
||||
/*! |
|
||||
* @brief Interface class for model checkers that support SteadyStateOperator. |
|
||||
* |
|
||||
* All model checkers that support the formula class SteadyStateOperator must inherit |
|
||||
* this pure virtual class. |
|
||||
*/ |
|
||||
template <class T> |
|
||||
class ISteadyStateNoBoundOperatorModelChecker { |
|
||||
public: |
|
||||
/*! |
|
||||
* @brief Evaluates SteadyStateOperator formula within a model checker. |
|
||||
* |
|
||||
* @param obj Formula object with subformulas. |
|
||||
* @return Result of the formula for every node. |
|
||||
*/ |
|
||||
virtual std::vector<T> checkSteadyStateNoBoundOperator(const SteadyStateNoBoundOperator<T>& obj) const = 0; |
|
||||
}; |
|
||||
|
|
||||
template <class T> |
|
||||
class SteadyStateNoBoundOperator: public storm::property::abstract::SteadyStateNoBoundOperator<T, AbstractStateFormula<T>>, |
|
||||
public AbstractNoBoundOperator<T> { |
|
||||
public: |
|
||||
/*! |
|
||||
* Empty constructor |
|
||||
*/ |
|
||||
SteadyStateNoBoundOperator() : storm::property::abstract::SteadyStateNoBoundOperator<T, AbstractStateFormula<T>>() { |
|
||||
// Intentionally left empty |
|
||||
|
|
||||
} |
|
||||
|
|
||||
/*! |
|
||||
* Constructor |
|
||||
* |
|
||||
* @param stateFormula The state formula that forms the subtree |
|
||||
*/ |
|
||||
SteadyStateNoBoundOperator(AbstractStateFormula<T>* stateFormula) |
|
||||
: storm::property::abstract::SteadyStateNoBoundOperator<T, AbstractStateFormula<T>>(stateFormula) { |
|
||||
// Intentionally left empty |
|
||||
} |
|
||||
|
|
||||
/*! |
|
||||
* Destructor |
|
||||
*/ |
|
||||
~SteadyStateNoBoundOperator() { |
|
||||
// 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 |
|
||||
* |
|
||||
* @returns a new BoundedUntil-object that is identical the called object. |
|
||||
*/ |
|
||||
virtual AbstractNoBoundOperator <T>* clone() const override { |
|
||||
SteadyStateNoBoundOperator<T>* result = new SteadyStateNoBoundOperator<T>(); |
|
||||
result->setStateFormula(this->getStateFormula().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. |
|
||||
* |
|
||||
* @returns A vector indicating the probability that the formula holds for each state. |
|
||||
*/ |
|
||||
virtual std::vector<T> check(const storm::modelchecker::csl::AbstractModelChecker<T>& modelChecker, bool qualitative=false) const override { |
|
||||
return modelChecker.template as<ISteadyStateNoBoundOperatorModelChecker>()->checkSteadyStateNoBoundOperator(*this); |
|
||||
} |
|
||||
|
|
||||
}; |
|
||||
|
|
||||
} /* namespace csl */ |
|
||||
} /* namespace property */ |
|
||||
} /* namespace storm */ |
|
||||
|
|
||||
#endif /* STORM_FORMULA_CSL_STEADYSTATENOBOUNDOPERATOR_H_ */ |
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue