You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

114 lines
3.2 KiB

/*
* ProbabilisticBoundOperator.h
*
* Created on: 19.10.2012
* Author: Thomas Heinemann
*/
#ifndef STORM_FORMULA_ABSTRACT_PROBABILISTICBOUNDOPERATOR_H_
#define STORM_FORMULA_ABSTRACT_PROBABILISTICBOUNDOPERATOR_H_
#include "src/formula/abstract/AbstractFormula.h"
#include "src/formula/abstract/PathBoundOperator.h"
#include "src/formula/abstract/OptimizingOperator.h"
#include "utility/ConstTemplates.h"
namespace storm {
namespace property {
namespace abstract {
/*!
* @brief
* Class for an abstract formula tree with a P (probablistic) operator node over a probability interval
* as root.
*
* Has one Abstract path formula as sub formula/tree.
*
* @par Semantics
* The formula holds iff the probability that the path formula holds is inside the bounds
* specified in this operator
*
* 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)
*
* @tparam FormulaType The type of the subformula.
* The instantiation of FormulaType should be a subclass of AbstractFormula, as the functions
* "toString" and "conforms" of the subformulas are needed.
*
* @see AbstractFormula
* @see AbstractFormula
* @see ProbabilisticOperator
* @see ProbabilisticNoBoundsOperator
* @see AbstractFormula
*/
template<class T, class FormulaType>
class ProbabilisticBoundOperator : public PathBoundOperator<T, FormulaType> {
// Throw a compiler error if FormulaType is not a subclass of AbstractFormula.
static_assert(std::is_base_of<AbstractFormula<T>, FormulaType>::value,
"Instantiaton of FormulaType for storm::property::abstract::ProbabilisticBoundOperator<T,FormulaType> has to be a subtype of storm::property::abstract::AbstractFormula<T>");
public:
/*!
* Empty constructor
*/
ProbabilisticBoundOperator() : PathBoundOperator<T, FormulaType>
(LESS_EQUAL, storm::utility::constGetZero<T>(), nullptr) {
// Intentionally left empty
}
/*!
* Constructor
*
* @param comparisonRelation The relation to compare the actual value and the bound
* @param bound The bound for the probability
* @param pathFormula The child node
*/
ProbabilisticBoundOperator(
storm::property::ComparisonType comparisonRelation,
T bound,
FormulaType* pathFormula)
: PathBoundOperator<T, FormulaType>(comparisonRelation, bound, pathFormula) {
// Intentionally left empty
}
/*!
* Constructor
*
* @param comparisonRelation
* @param bound
* @param pathFormula
* @param minimumOperator
*/
ProbabilisticBoundOperator(
storm::property::ComparisonType comparisonRelation,
T bound,
FormulaType* pathFormula,
bool minimumOperator)
: PathBoundOperator<T, FormulaType>(comparisonRelation, bound, pathFormula, minimumOperator){
// Intentionally left empty
}
/*!
* Destructor
*/
virtual ~ProbabilisticBoundOperator() {
// Intentionally left empty
}
/*!
* @returns a string representation of the formula
*/
virtual std::string toString() const override {
std::string result = "P ";
result += PathBoundOperator<T, FormulaType>::toString();
return result;
}
};
} //namespace abstract
} //namespace property
} //namespace storm
#endif /* STORM_FORMULA_ABSTRACT_PROBABILISTICBOUNDOPERATOR_H_ */