Browse Source

Restructuring formula classes, part I

Sorted formulas into respective folders, depending on which logic they
belong to (or if they are abstract).

The Code is NOTadapted to the new structure yet.
main
Lanchid 12 years ago
parent
commit
38652f44e4
  1. 0
      src/formula/Csl/AbstractPathFormula.h
  2. 0
      src/formula/Csl/AbstractStateFormula.h
  3. 0
      src/formula/Csl/CumulativeReward.h
  4. 0
      src/formula/Csl/SteadyStateBoundOperator.h
  5. 0
      src/formula/Csl/SteadyStateNoBoundOperator.h
  6. 0
      src/formula/Csl/TimeBoundedEventually.h
  7. 0
      src/formula/Csl/TimeBoundedUntil.h
  8. 39
      src/formula/Ltl/AbstractLtlFormula.h
  9. 70
      src/formula/Prtl/AbstractPathFormula.h
  10. 68
      src/formula/Prtl/AbstractStateFormula.h
  11. 0
      src/formula/Prtl/InstantaneousReward.h
  12. 0
      src/formula/Prtl/ReachabilityReward.h
  13. 0
      src/formula/Prtl/RewardBoundOperator.h
  14. 0
      src/formula/Prtl/RewardNoBoundOperator.h
  15. 0
      src/formula/Prtl/SteadyStateReward.h
  16. 17
      src/formula/abstract/AbstractFormula.h
  17. 16
      src/formula/abstract/And.h
  18. 0
      src/formula/abstract/Ap.h
  19. 0
      src/formula/abstract/BoundedEventually.h
  20. 0
      src/formula/abstract/BoundedNaryUntil.h
  21. 0
      src/formula/abstract/BoundedUntil.h
  22. 0
      src/formula/abstract/Eventually.h
  23. 0
      src/formula/abstract/Globally.h
  24. 0
      src/formula/abstract/Next.h
  25. 0
      src/formula/abstract/Not.h
  26. 0
      src/formula/abstract/OptimizingOperator.h
  27. 0
      src/formula/abstract/Or.h
  28. 0
      src/formula/abstract/PathBoundOperator.h
  29. 0
      src/formula/abstract/PathNoBoundOperator.h
  30. 0
      src/formula/abstract/ProbabilisticBoundOperator.h
  31. 0
      src/formula/abstract/ProbabilisticNoBoundOperator.h
  32. 0
      src/formula/abstract/StateBoundOperator.h
  33. 0
      src/formula/abstract/StateNoBoundOperator.h
  34. 0
      src/formula/abstract/TimeBoundedOperator.h
  35. 0
      src/formula/abstract/Until.h

0
src/formula/AbstractPathFormula.h → src/formula/Csl/AbstractPathFormula.h

0
src/formula/AbstractStateFormula.h → src/formula/Csl/AbstractStateFormula.h

0
src/formula/CumulativeReward.h → src/formula/Csl/CumulativeReward.h

0
src/formula/SteadyStateBoundOperator.h → src/formula/Csl/SteadyStateBoundOperator.h

0
src/formula/SteadyStateNoBoundOperator.h → src/formula/Csl/SteadyStateNoBoundOperator.h

0
src/formula/TimeBoundedEventually.h → src/formula/Csl/TimeBoundedEventually.h

0
src/formula/TimeBoundedUntil.h → src/formula/Csl/TimeBoundedUntil.h

39
src/formula/Ltl/AbstractLtlFormula.h

@ -0,0 +1,39 @@
/*
* AbstractLtlFormula.h
*
* Created on: 15.04.2013
* Author: thomas
*/
#ifndef ABSTRACTLTLFORMULA_H_
#define ABSTRACTLTLFORMULA_H_
namespace storm {
namespace formula {
class AbstractLtlFormula {
public:
/**
* Empty destructor
*/
virtual ~AbstractLtlFormula() {
// Intentionally left empty
}
/*!
* 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::AbstractModelChecker<T>& modelChecker, bool qualitative) const = 0;
};
} /* namespace formula */
} /* namespace storm */
#endif /* ABSTRACTLTLFORMULA_H_ */

70
src/formula/Prtl/AbstractPathFormula.h

@ -0,0 +1,70 @@
/*
* AbstractPathFormula.h
*
* Created on: 19.10.2012
* Author: Thomas Heinemann
*/
#ifndef STORM_FORMULA_ABSTRACTPATHFORMULA_H_
#define STORM_FORMULA_ABSTRACTPATHFORMULA_H_
namespace storm { namespace formula {
template <class T> class AbstractPathFormula;
}}
#include "src/formula/AbstractFormula.h"
#include "src/modelchecker/ForwardDeclarations.h"
#include <vector>
#include <iostream>
#include <typeinfo>
namespace storm {
namespace formula {
/*!
* @brief
* Abstract base class for Abstract path formulas.
*
* @attention This class is abstract.
* @note Formula classes do not have copy constructors. The parameters of the constructors are usually the subtrees, so
* the syntax conflicts with copy constructors for unary operators. To produce an identical object, use the method
* clone().
*/
template <class T>
class AbstractPathFormula : public virtual AbstractFormula<T> {
public:
/*!
* empty destructor
*/
virtual ~AbstractPathFormula() { }
/*!
* 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 AbstractPathFormula<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::AbstractModelChecker<T>& modelChecker, bool qualitative) const = 0;
};
} //namespace formula
} //namespace storm
#endif /* STORM_FORMULA_ABSTRACTPATHFORMULA_H_ */

68
src/formula/Prtl/AbstractStateFormula.h

@ -0,0 +1,68 @@
/*
* AbstractStateFormula.h
*
* Created on: 19.10.2012
* Author: Thomas Heinemann
*/
#ifndef STORM_FORMULA_ABSTRACTSTATEFORMULA_H_
#define STORM_FORMULA_ABSTRACTSTATEFORMULA_H_
namespace storm { namespace formula {
template <class T> class AbstractStateFormula;
}}
#include "src/formula/AbstractFormula.h"
#include "src/storage/BitVector.h"
#include "src/modelchecker/ForwardDeclarations.h"
namespace storm {
namespace formula {
/*!
* @brief
* Abstract base class for Abstract state formulas.
*
* @attention This class is abstract.
* @note Formula classes do not have copy constructors. The parameters of the constructors are usually the subtrees, so
* the syntax conflicts with copy constructors for unary operators. To produce an identical object, use the method
* clone().
*/
template <class T>
class AbstractStateFormula : public AbstractFormula<T> {
public:
/*!
* empty destructor
*/
virtual ~AbstractStateFormula() { }
/*!
* 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 AbstractStateFormula<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 bit vector indicating all states that satisfy the formula represented by the called object.
*/
virtual storm::storage::BitVector *check(const storm::modelchecker::AbstractModelChecker<T>& modelChecker) const = 0; // {
};
} //namespace formula
} //namespace storm
#endif /* STORM_FORMULA_AbstractSTATEFORMULA_H_ */

0
src/formula/InstantaneousReward.h → src/formula/Prtl/InstantaneousReward.h

0
src/formula/ReachabilityReward.h → src/formula/Prtl/ReachabilityReward.h

0
src/formula/RewardBoundOperator.h → src/formula/Prtl/RewardBoundOperator.h

0
src/formula/RewardNoBoundOperator.h → src/formula/Prtl/RewardNoBoundOperator.h

0
src/formula/SteadyStateReward.h → src/formula/Prtl/SteadyStateReward.h

17
src/formula/AbstractFormula.h → src/formula/abstract/AbstractFormula.h

@ -5,21 +5,25 @@
* Author: Thomas Heinemann
*/
#ifndef STORM_FORMULA_ABSTRACTFORMULA_H_
#define STORM_FORMULA_ABSTRACTFORMULA_H_
#ifndef STORM_FORMULA_ABSTRACT_ABSTRACTFORMULA_H_
#define STORM_FORMULA_ABSTRACT_ABSTRACTFORMULA_H_
#include <string>
namespace storm { namespace formula {
namespace storm {
namespace formula {
namespace abstract {
template <class T> class AbstractFormula;
}}
}
}
}
#include "src/modelchecker/ForwardDeclarations.h"
#include "src/formula/AbstractFormulaChecker.h"
namespace storm {
namespace formula {
namespace abstract {
//abstract
/*!
@ -67,7 +71,8 @@ public:
virtual bool conforms(const AbstractFormulaChecker<T>& checker) const = 0;
};
} // namespace abstract
} // namespace formula
} // namespace storm
#endif /* STORM_FORMULA_ABSTRACTFORMULA_H_ */
#endif /* STORM_FORMULA_ABSTRACT_ABSTRACTFORMULA_H_ */

16
src/formula/And.h → src/formula/abstract/And.h

@ -5,10 +5,10 @@
* Author: Thomas Heinemann
*/
#ifndef STORM_FORMULA_AND_H_
#define STORM_FORMULA_AND_H_
#ifndef STORM_FORMULA_ABSTRACT_AND_H_
#define STORM_FORMULA_ABSTRACT_AND_H_
#include "src/formula/AbstractStateFormula.h"
#include "src/formula/abstract/AbstractFormula.h"
#include "src/formula/AbstractFormulaChecker.h"
#include "src/modelchecker/ForwardDeclarations.h"
#include <string>
@ -52,7 +52,7 @@ class IAndModelChecker {
* @see AbstractFormula
*/
template <class T>
class And : public AbstractStateFormula<T> {
class And : public AbstractFormula<T> {
public:
/*!
@ -71,7 +71,7 @@ public:
* @param left The left sub formula
* @param right The right sub formula
*/
And(AbstractStateFormula<T>* left, AbstractStateFormula<T>* right) {
And(AbstractFormula<T>* left, AbstractFormula<T>* right) {
this->left = left;
this->right = right;
}
@ -177,12 +177,12 @@ public:
}
private:
AbstractStateFormula<T>* left;
AbstractStateFormula<T>* right;
AbstractFormula<T>* left;
AbstractFormula<T>* right;
};
} //namespace formula
} //namespace storm
#endif /* STORM_FORMULA_AND_H_ */
#endif /* STORM_FORMULA_ABSTRACT_AND_H_ */

0
src/formula/Ap.h → src/formula/abstract/Ap.h

0
src/formula/BoundedEventually.h → src/formula/abstract/BoundedEventually.h

0
src/formula/BoundedNaryUntil.h → src/formula/abstract/BoundedNaryUntil.h

0
src/formula/BoundedUntil.h → src/formula/abstract/BoundedUntil.h

0
src/formula/Eventually.h → src/formula/abstract/Eventually.h

0
src/formula/Globally.h → src/formula/abstract/Globally.h

0
src/formula/Next.h → src/formula/abstract/Next.h

0
src/formula/Not.h → src/formula/abstract/Not.h

0
src/formula/OptimizingOperator.h → src/formula/abstract/OptimizingOperator.h

0
src/formula/Or.h → src/formula/abstract/Or.h

0
src/formula/PathBoundOperator.h → src/formula/abstract/PathBoundOperator.h

0
src/formula/PathNoBoundOperator.h → src/formula/abstract/PathNoBoundOperator.h

0
src/formula/ProbabilisticBoundOperator.h → src/formula/abstract/ProbabilisticBoundOperator.h

0
src/formula/ProbabilisticNoBoundOperator.h → src/formula/abstract/ProbabilisticNoBoundOperator.h

0
src/formula/StateBoundOperator.h → src/formula/abstract/StateBoundOperator.h

0
src/formula/StateNoBoundOperator.h → src/formula/abstract/StateNoBoundOperator.h

0
src/formula/TimeBoundedOperator.h → src/formula/abstract/TimeBoundedOperator.h

0
src/formula/Until.h → src/formula/abstract/Until.h

|||||||
100:0
Loading…
Cancel
Save