Browse Source

Renames the folder formula to properties and the namespace property to properties.

Former-commit-id: 236ed22c7d
main
masawei 11 years ago
parent
commit
d75e32b83e
  1. 16
      src/counterexamples/MILPMinimalLabelSetGenerator.h
  2. 12
      src/counterexamples/PathBasedSubsystemGenerator.h
  3. 16
      src/counterexamples/SMTMinimalCommandSetGenerator.h
  4. 38
      src/modelchecker/csl/AbstractModelChecker.h
  5. 16
      src/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.h
  6. 30
      src/modelchecker/ltl/AbstractModelChecker.h
  7. 50
      src/modelchecker/prctl/AbstractModelChecker.h
  8. 26
      src/modelchecker/prctl/SparseDtmcPrctlModelChecker.h
  9. 32
      src/modelchecker/prctl/SparseMdpPrctlModelChecker.h
  10. 76
      src/parser/CslParser.cpp
  11. 8
      src/parser/CslParser.h
  12. 4
      src/parser/LtlFileParser.cpp
  13. 6
      src/parser/LtlFileParser.h
  14. 104
      src/parser/LtlParser.cpp
  15. 8
      src/parser/LtlParser.h
  16. 6
      src/parser/PrctlFileParser.cpp
  17. 6
      src/parser/PrctlFileParser.h
  18. 130
      src/parser/PrctlParser.cpp
  19. 8
      src/parser/PrctlParser.h
  20. 8
      src/properties/AbstractFilter.h
  21. 12
      src/properties/AbstractFormula.h
  22. 2
      src/properties/ComparisonType.h
  23. 0
      src/properties/Csl.h
  24. 0
      src/properties/Ltl.h
  25. 0
      src/properties/Prctl.h
  26. 4
      src/properties/actions/AbstractAction.h
  27. 28
      src/properties/actions/BoundAction.h
  28. 18
      src/properties/actions/FormulaAction.h
  29. 6
      src/properties/actions/InvertAction.h
  30. 6
      src/properties/actions/RangeAction.h
  31. 6
      src/properties/actions/SortAction.h
  32. 22
      src/properties/csl/AbstractCslFormula.h
  33. 8
      src/properties/csl/AbstractPathFormula.h
  34. 8
      src/properties/csl/AbstractStateFormula.h
  35. 6
      src/properties/csl/And.h
  36. 6
      src/properties/csl/Ap.h
  37. 18
      src/properties/csl/CslFilter.h
  38. 8
      src/properties/csl/Eventually.h
  39. 8
      src/properties/csl/Globally.h
  40. 8
      src/properties/csl/Next.h
  41. 6
      src/properties/csl/Not.h
  42. 6
      src/properties/csl/Or.h
  43. 18
      src/properties/csl/ProbabilisticBoundOperator.h
  44. 8
      src/properties/csl/SteadyStateBoundOperator.h
  45. 13
      src/properties/csl/TimeBoundedEventually.h
  46. 15
      src/properties/csl/TimeBoundedUntil.h
  47. 8
      src/properties/csl/Until.h
  48. 8
      src/properties/ltl/AbstractLtlFormula.h
  49. 4
      src/properties/ltl/And.h
  50. 6
      src/properties/ltl/Ap.h
  51. 4
      src/properties/ltl/BoundedEventually.h
  52. 6
      src/properties/ltl/BoundedUntil.h
  53. 6
      src/properties/ltl/Eventually.h
  54. 4
      src/properties/ltl/Globally.h
  55. 14
      src/properties/ltl/LtlFilter.h
  56. 4
      src/properties/ltl/Next.h
  57. 4
      src/properties/ltl/Not.h
  58. 6
      src/properties/ltl/Or.h
  59. 4
      src/properties/ltl/Until.h
  60. 8
      src/properties/prctl/AbstractPathFormula.h
  61. 22
      src/properties/prctl/AbstractPrctlFormula.h
  62. 8
      src/properties/prctl/AbstractRewardPathFormula.h
  63. 8
      src/properties/prctl/AbstractStateFormula.h
  64. 6
      src/properties/prctl/And.h
  65. 6
      src/properties/prctl/Ap.h
  66. 8
      src/properties/prctl/BoundedEventually.h
  67. 8
      src/properties/prctl/BoundedNaryUntil.h
  68. 8
      src/properties/prctl/BoundedUntil.h
  69. 4
      src/properties/prctl/CumulativeReward.h
  70. 8
      src/properties/prctl/Eventually.h
  71. 8
      src/properties/prctl/Globally.h
  72. 4
      src/properties/prctl/InstantaneousReward.h
  73. 8
      src/properties/prctl/Next.h
  74. 4
      src/properties/prctl/Not.h
  75. 6
      src/properties/prctl/Or.h
  76. 24
      src/properties/prctl/PrctlFilter.h
  77. 14
      src/properties/prctl/ProbabilisticBoundOperator.h
  78. 4
      src/properties/prctl/ReachabilityReward.h
  79. 14
      src/properties/prctl/RewardBoundOperator.h
  80. 4
      src/properties/prctl/SteadyStateReward.h
  81. 4
      src/properties/prctl/Until.h
  82. 12
      src/storm.cpp
  83. 102
      test/functional/modelchecker/ActionTest.cpp
  84. 60
      test/functional/modelchecker/EigenDtmcPrctlModelCheckerTest.cpp
  85. 38
      test/functional/modelchecker/FilterTest.cpp
  86. 40
      test/functional/modelchecker/GmmxxDtmcPrctlModelCheckerTest.cpp
  87. 36
      test/functional/modelchecker/SparseMdpPrctlModelCheckerTest.cpp
  88. 34
      test/functional/parser/CslParserTest.cpp
  89. 26
      test/functional/parser/LtlParserTest.cpp
  90. 30
      test/functional/parser/PrctlParserTest.cpp
  91. 24
      test/performance/modelchecker/GmmxxDtmcPrctModelCheckerTest.cpp
  92. 50
      test/performance/modelchecker/SparseMdpPrctlModelCheckerTest.cpp

16
src/counterexamples/MILPMinimalLabelSetGenerator.h

@ -1000,35 +1000,35 @@ namespace storm {
* @param formulaPtr A pointer to a safety formula. The outermost operator must be a probabilistic bound operator with a strict upper bound. The nested
* formula can be either an unbounded until formula or an eventually formula.
*/
static void computeCounterexample(storm::ir::Program const& program, storm::models::Mdp<T> const& labeledMdp, std::shared_ptr<storm::property::prctl::AbstractPrctlFormula<double>> const & formulaPtr) {
static void computeCounterexample(storm::ir::Program const& program, storm::models::Mdp<T> const& labeledMdp, std::shared_ptr<storm::properties::prctl::AbstractPrctlFormula<double>> const & formulaPtr) {
std::cout << std::endl << "Generating minimal label counterexample for formula " << formulaPtr->toString() << std::endl;
// First, we need to check whether the current formula is an Until-Formula.
std::shared_ptr<storm::property::prctl::ProbabilisticBoundOperator<double>> probBoundFormula = std::dynamic_pointer_cast<storm::property::prctl::ProbabilisticBoundOperator<double>>(formulaPtr);
std::shared_ptr<storm::properties::prctl::ProbabilisticBoundOperator<double>> probBoundFormula = std::dynamic_pointer_cast<storm::properties::prctl::ProbabilisticBoundOperator<double>>(formulaPtr);
if (probBoundFormula.get() == nullptr) {
LOG4CPLUS_ERROR(logger, "Illegal formula " << probBoundFormula->toString() << " for counterexample generation.");
throw storm::exceptions::InvalidPropertyException() << "Illegal formula " << probBoundFormula->toString() << " for counterexample generation.";
}
if (probBoundFormula->getComparisonOperator() != storm::property::ComparisonType::LESS && probBoundFormula->getComparisonOperator() != storm::property::ComparisonType::LESS_EQUAL) {
if (probBoundFormula->getComparisonOperator() != storm::properties::ComparisonType::LESS && probBoundFormula->getComparisonOperator() != storm::properties::ComparisonType::LESS_EQUAL) {
LOG4CPLUS_ERROR(logger, "Illegal comparison operator in formula " << probBoundFormula->toString() << ". Only upper bounds are supported for counterexample generation.");
throw storm::exceptions::InvalidPropertyException() << "Illegal comparison operator in formula " << probBoundFormula->toString() << ". Only upper bounds are supported for counterexample generation.";
}
bool strictBound = !(probBoundFormula->getComparisonOperator() == storm::property::ComparisonType::LESS);
bool strictBound = !(probBoundFormula->getComparisonOperator() == storm::properties::ComparisonType::LESS);
// Now derive the probability threshold we need to exceed as well as the phi and psi states. Simultaneously, check whether the formula is of a valid shape.
double bound = probBoundFormula->getBound();
std::shared_ptr<storm::property::prctl::AbstractPathFormula<double>> pathFormula = probBoundFormula->getChild();
std::shared_ptr<storm::properties::prctl::AbstractPathFormula<double>> pathFormula = probBoundFormula->getChild();
storm::storage::BitVector phiStates;
storm::storage::BitVector psiStates;
storm::modelchecker::prctl::SparseMdpPrctlModelChecker<T> modelchecker(labeledMdp);
std::shared_ptr<storm::property::prctl::Until<double>> untilFormula = std::dynamic_pointer_cast<storm::property::prctl::Until<double>>(pathFormula);
std::shared_ptr<storm::properties::prctl::Until<double>> untilFormula = std::dynamic_pointer_cast<storm::properties::prctl::Until<double>>(pathFormula);
if(untilFormula.get() != nullptr) {
phiStates = untilFormula->getLeft()->check(modelchecker);
psiStates = untilFormula->getRight()->check(modelchecker);
} if (std::dynamic_pointer_cast<storm::property::prctl::Eventually<double>>(pathFormula).get() != nullptr) {
} if (std::dynamic_pointer_cast<storm::properties::prctl::Eventually<double>>(pathFormula).get() != nullptr) {
// If the nested formula was not an until formula, it remains to check whether it's an eventually formula.
std::shared_ptr<storm::property::prctl::Eventually<double>> eventuallyFormula = std::dynamic_pointer_cast<storm::property::prctl::Eventually<double>>(pathFormula);
std::shared_ptr<storm::properties::prctl::Eventually<double>> eventuallyFormula = std::dynamic_pointer_cast<storm::properties::prctl::Eventually<double>>(pathFormula);
phiStates = storm::storage::BitVector(labeledMdp.getNumberOfStates(), true);
psiStates = eventuallyFormula->getChild()->check(modelchecker);

12
src/counterexamples/PathBasedSubsystemGenerator.h

@ -375,7 +375,7 @@ public:
/*!
*
*/
static storm::models::Dtmc<T> computeCriticalSubsystem(storm::models::Dtmc<T> const & model, std::shared_ptr<storm::property::prctl::AbstractStateFormula<T>> const & stateFormula) {
static storm::models::Dtmc<T> computeCriticalSubsystem(storm::models::Dtmc<T> const & model, std::shared_ptr<storm::properties::prctl::AbstractStateFormula<T>> const & stateFormula) {
//-------------------------------------------------------------
// 1. Strip and handle formulas
@ -395,14 +395,14 @@ public:
// Strip bound operator
std::shared_ptr<storm::property::prctl::ProbabilisticBoundOperator<T>> boundOperator = std::dynamic_pointer_cast<storm::property::prctl::ProbabilisticBoundOperator<T>>(stateFormula);
std::shared_ptr<storm::properties::prctl::ProbabilisticBoundOperator<T>> boundOperator = std::dynamic_pointer_cast<storm::properties::prctl::ProbabilisticBoundOperator<T>>(stateFormula);
if(boundOperator == nullptr){
LOG4CPLUS_ERROR(logger, "No path bound operator at formula root.");
return model.getSubDtmc(subSys);
}
T bound = boundOperator->getBound();
std::shared_ptr<storm::property::prctl::AbstractPathFormula<T>> pathFormula = boundOperator->getChild();
std::shared_ptr<storm::properties::prctl::AbstractPathFormula<T>> pathFormula = boundOperator->getChild();
// get "init" labeled states
storm::storage::BitVector initStates = model.getLabeledStates("init");
@ -423,9 +423,9 @@ public:
storm::storage::BitVector allowedStates;
storm::storage::BitVector targetStates;
std::shared_ptr<storm::property::prctl::Eventually<T>> eventually = std::dynamic_pointer_cast<storm::property::prctl::Eventually<T>>(pathFormula);
std::shared_ptr<storm::property::prctl::Globally<T>> globally = std::dynamic_pointer_cast<storm::property::prctl::Globally<T>>(pathFormula);
std::shared_ptr<storm::property::prctl::Until<T>> until = std::dynamic_pointer_cast<storm::property::prctl::Until<T>>(pathFormula);
std::shared_ptr<storm::properties::prctl::Eventually<T>> eventually = std::dynamic_pointer_cast<storm::properties::prctl::Eventually<T>>(pathFormula);
std::shared_ptr<storm::properties::prctl::Globally<T>> globally = std::dynamic_pointer_cast<storm::properties::prctl::Globally<T>>(pathFormula);
std::shared_ptr<storm::properties::prctl::Until<T>> until = std::dynamic_pointer_cast<storm::properties::prctl::Until<T>>(pathFormula);
if(eventually.get() != nullptr) {
targetStates = eventually->getChild()->check(modelCheck);
allowedStates = storm::storage::BitVector(targetStates.size(), true);

16
src/counterexamples/SMTMinimalCommandSetGenerator.h

@ -1773,37 +1773,37 @@ namespace storm {
#endif
}
static void computeCounterexample(storm::ir::Program program, std::string const& constantDefinitionString, storm::models::Mdp<T> const& labeledMdp, std::shared_ptr<storm::property::prctl::AbstractPrctlFormula<double>> const & formulaPtr) {
static void computeCounterexample(storm::ir::Program program, std::string const& constantDefinitionString, storm::models::Mdp<T> const& labeledMdp, std::shared_ptr<storm::properties::prctl::AbstractPrctlFormula<double>> const & formulaPtr) {
#ifdef STORM_HAVE_Z3
std::cout << std::endl << "Generating minimal label counterexample for formula " << formulaPtr->toString() << std::endl;
// First, we need to check whether the current formula is an Until-Formula.
std::shared_ptr<storm::property::prctl::ProbabilisticBoundOperator<double>> probBoundFormula = std::dynamic_pointer_cast<storm::property::prctl::ProbabilisticBoundOperator<double>>(formulaPtr);
std::shared_ptr<storm::properties::prctl::ProbabilisticBoundOperator<double>> probBoundFormula = std::dynamic_pointer_cast<storm::properties::prctl::ProbabilisticBoundOperator<double>>(formulaPtr);
if (probBoundFormula.get() == nullptr) {
LOG4CPLUS_ERROR(logger, "Illegal formula " << probBoundFormula->toString() << " for counterexample generation.");
throw storm::exceptions::InvalidPropertyException() << "Illegal formula " << probBoundFormula->toString() << " for counterexample generation.";
}
// Check whether we were given an upper bound, because counterexample generation is limited to this case.
if (probBoundFormula->getComparisonOperator() != storm::property::ComparisonType::LESS && probBoundFormula->getComparisonOperator() != storm::property::ComparisonType::LESS_EQUAL) {
if (probBoundFormula->getComparisonOperator() != storm::properties::ComparisonType::LESS && probBoundFormula->getComparisonOperator() != storm::properties::ComparisonType::LESS_EQUAL) {
LOG4CPLUS_ERROR(logger, "Illegal comparison operator in formula " << probBoundFormula->toString() << ". Only upper bounds are supported for counterexample generation.");
throw storm::exceptions::InvalidPropertyException() << "Illegal comparison operator in formula " << probBoundFormula->toString() << ". Only upper bounds are supported for counterexample generation.";
}
bool strictBound = !(probBoundFormula->getComparisonOperator() == storm::property::ComparisonType::LESS);
bool strictBound = !(probBoundFormula->getComparisonOperator() == storm::properties::ComparisonType::LESS);
// Now derive the probability threshold we need to exceed as well as the phi and psi states. Simultaneously, check whether the formula is of a valid shape.
double bound = probBoundFormula->getBound();
std::shared_ptr<storm::property::prctl::AbstractPathFormula<double>> pathFormula = probBoundFormula->getPathFormula();
std::shared_ptr<storm::properties::prctl::AbstractPathFormula<double>> pathFormula = probBoundFormula->getPathFormula();
storm::storage::BitVector phiStates;
storm::storage::BitVector psiStates;
storm::modelchecker::prctl::SparseMdpPrctlModelChecker<T> modelchecker(labeledMdp);
std::shared_ptr<storm::property::prctl::Until<double>> untilFormula = std::dynamic_pointer_cast<storm::property::prctl::Until<double>>(pathFormula);
std::shared_ptr<storm::properties::prctl::Until<double>> untilFormula = std::dynamic_pointer_cast<storm::properties::prctl::Until<double>>(pathFormula);
if(untilFormula.get() != nullptr) {
phiStates = untilFormula->getLeft()->check(modelchecker);
psiStates = untilFormula->getRight()->check(modelchecker);
} if (std::dynamic_pointer_cast<storm::property::prctl::Eventually<double>>(pathFormula).get() != nullptr) {
} if (std::dynamic_pointer_cast<storm::properties::prctl::Eventually<double>>(pathFormula).get() != nullptr) {
// If the nested formula was not an until formula, it remains to check whether it's an eventually formula.
std::shared_ptr<storm::property::prctl::Eventually<double>> eventuallyFormula = std::dynamic_pointer_cast<storm::property::prctl::Eventually<double>>(pathFormula);
std::shared_ptr<storm::properties::prctl::Eventually<double>> eventuallyFormula = std::dynamic_pointer_cast<storm::properties::prctl::Eventually<double>>(pathFormula);
phiStates = storm::storage::BitVector(labeledMdp.getNumberOfStates(), true);
psiStates = eventuallyFormula->getChild()->check(modelchecker);

38
src/modelchecker/csl/AbstractModelChecker.h

@ -10,7 +10,7 @@
#include <stack>
#include "src/exceptions/InvalidPropertyException.h"
#include "src/formula/Csl.h"
#include "src/properties/Csl.h"
#include "src/storage/BitVector.h"
#include "src/models/AbstractModel.h"
@ -37,17 +37,17 @@ template<class Type>
class AbstractModelChecker :
// A list of interfaces the model checker supports. Typically, for each of the interfaces, a check method needs to
// be implemented that performs the corresponding check.
public virtual storm::property::csl::IApModelChecker<Type>,
public virtual storm::property::csl::IAndModelChecker<Type>,
public virtual storm::property::csl::IOrModelChecker<Type>,
public virtual storm::property::csl::INotModelChecker<Type>,
public virtual storm::property::csl::IUntilModelChecker<Type>,
public virtual storm::property::csl::IEventuallyModelChecker<Type>,
public virtual storm::property::csl::IGloballyModelChecker<Type>,
public virtual storm::property::csl::INextModelChecker<Type>,
public virtual storm::property::csl::ITimeBoundedUntilModelChecker<Type>,
public virtual storm::property::csl::ITimeBoundedEventuallyModelChecker<Type>,
public virtual storm::property::csl::IProbabilisticBoundOperatorModelChecker<Type> {
public virtual storm::properties::csl::IApModelChecker<Type>,
public virtual storm::properties::csl::IAndModelChecker<Type>,
public virtual storm::properties::csl::IOrModelChecker<Type>,
public virtual storm::properties::csl::INotModelChecker<Type>,
public virtual storm::properties::csl::IUntilModelChecker<Type>,
public virtual storm::properties::csl::IEventuallyModelChecker<Type>,
public virtual storm::properties::csl::IGloballyModelChecker<Type>,
public virtual storm::properties::csl::INextModelChecker<Type>,
public virtual storm::properties::csl::ITimeBoundedUntilModelChecker<Type>,
public virtual storm::properties::csl::ITimeBoundedEventuallyModelChecker<Type>,
public virtual storm::properties::csl::IProbabilisticBoundOperatorModelChecker<Type> {
public:
/*!
@ -112,7 +112,7 @@ public:
* @param formula The formula to be checked.
* @returns The set of states satisfying the formula represented by a bit vector.
*/
storm::storage::BitVector checkAp(storm::property::csl::Ap<Type> const& formula) const {
storm::storage::BitVector checkAp(storm::properties::csl::Ap<Type> const& formula) const {
if (formula.getAp() == "true") {
return storm::storage::BitVector(model.getNumberOfStates(), true);
} else if (formula.getAp() == "false") {
@ -133,7 +133,7 @@ public:
* @param formula The formula to be checked.
* @returns The set of states satisfying the formula represented by a bit vector.
*/
storm::storage::BitVector checkAnd(storm::property::csl::And<Type> const& formula) const {
storm::storage::BitVector checkAnd(storm::properties::csl::And<Type> const& formula) const {
storm::storage::BitVector result = formula.getLeft()->check(*this);
storm::storage::BitVector right = formula.getRight()->check(*this);
result &= right;
@ -146,7 +146,7 @@ public:
* @param formula The formula to check.
* @returns The set of states satisfying the formula represented by a bit vector.
*/
storm::storage::BitVector checkOr(storm::property::csl::Or<Type> const& formula) const {
storm::storage::BitVector checkOr(storm::properties::csl::Or<Type> const& formula) const {
storm::storage::BitVector result = formula.getLeft()->check(*this);
storm::storage::BitVector right = formula.getRight()->check(*this);
result |= right;
@ -159,7 +159,7 @@ public:
* @param formula The formula to check.
* @returns The set of states satisfying the formula represented by a bit vector.
*/
storm::storage::BitVector checkNot(const storm::property::csl::Not<Type>& formula) const {
storm::storage::BitVector checkNot(const storm::properties::csl::Not<Type>& formula) const {
storm::storage::BitVector result = formula.getChild()->check(*this);
result.complement();
return result;
@ -172,7 +172,7 @@ public:
* @param formula The formula to check.
* @returns The set of states satisfying the formula represented by a bit vector.
*/
virtual storm::storage::BitVector checkProbabilisticBoundOperator(storm::property::csl::ProbabilisticBoundOperator<Type> const& formula) const {
virtual storm::storage::BitVector checkProbabilisticBoundOperator(storm::properties::csl::ProbabilisticBoundOperator<Type> const& formula) const {
// First, we need to compute the probability for satisfying the path formula for each state.
std::vector<Type> quantitativeResult = formula.getChild()->check(*this, false);
@ -197,7 +197,7 @@ public:
* @param minimumOperator True iff minimum probabilities/rewards are to be computed.
* @returns The probabilities to satisfy the formula or the rewards accumulated by it, represented by a vector.
*/
virtual std::vector<Type> checkMinMaxOperator(storm::property::csl::AbstractPathFormula<Type> const & formula, bool minimumOperator) const {
virtual std::vector<Type> checkMinMaxOperator(storm::properties::csl::AbstractPathFormula<Type> const & formula, bool minimumOperator) const {
minimumOperatorStack.push(minimumOperator);
std::vector<Type> result = formula.check(*this, false);
minimumOperatorStack.pop();
@ -211,7 +211,7 @@ public:
* @param minimumOperator True iff minimum probabilities/rewards are to be computed.
* @returns The set of states satisfying the formula represented by a bit vector.
*/
virtual storm::storage::BitVector checkMinMaxOperator(storm::property::csl::AbstractStateFormula<Type> const & formula, bool minimumOperator) const {
virtual storm::storage::BitVector checkMinMaxOperator(storm::properties::csl::AbstractStateFormula<Type> const & formula, bool minimumOperator) const {
minimumOperatorStack.push(minimumOperator);
storm::storage::BitVector result = formula.check(*this);
minimumOperatorStack.pop();

16
src/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.h

@ -54,10 +54,10 @@ public:
* @param formula The formula to check.
* @returns The set of states satisfying the formula represented by a bit vector.
*/
virtual storm::storage::BitVector checkProbabilisticBoundOperator(storm::property::csl::ProbabilisticBoundOperator<ValueType> const& formula) const override{
virtual storm::storage::BitVector checkProbabilisticBoundOperator(storm::properties::csl::ProbabilisticBoundOperator<ValueType> const& formula) const override{
// For P< and P<= the MA satisfies the formula iff the probability maximizing scheduler is used.
// For P> and P>= " iff the probability minimizing " .
if(formula.getComparisonOperator() == storm::property::LESS || formula.getComparisonOperator() == storm::property::LESS_EQUAL) {
if(formula.getComparisonOperator() == storm::properties::LESS || formula.getComparisonOperator() == storm::properties::LESS_EQUAL) {
this->minimumOperatorStack.push(false);
}
else {
@ -84,7 +84,7 @@ public:
return result;
}
std::vector<ValueType> checkUntil(storm::property::csl::Until<ValueType> const& formula, bool qualitative) const {
std::vector<ValueType> checkUntil(storm::properties::csl::Until<ValueType> const& formula, bool qualitative) const {
// Test whether it is specified if the minimum or maximum probabilities are to be computed.
if(this->minimumOperatorStack.empty()) {
LOG4CPLUS_ERROR(logger, "Formula does not specify neither min nor max optimality, which is not meaningful over nondeterministic models.");
@ -100,11 +100,11 @@ public:
return storm::modelchecker::prctl::SparseMdpPrctlModelChecker<ValueType>::computeUnboundedUntilProbabilities(min, this->getModel().getTransitionMatrix(), this->getModel().getBackwardTransitions(), this->getModel().getInitialStates(), leftStates, rightStates, nondeterministicLinearEquationSolver, qualitative);
}
std::vector<ValueType> checkTimeBoundedUntil(storm::property::csl::TimeBoundedUntil<ValueType> const& formula, bool qualitative) const {
std::vector<ValueType> checkTimeBoundedUntil(storm::properties::csl::TimeBoundedUntil<ValueType> const& formula, bool qualitative) const {
throw storm::exceptions::NotImplementedException() << "Model checking Until formulas on Markov automata is not yet implemented.";
}
std::vector<ValueType> checkTimeBoundedEventually(storm::property::csl::TimeBoundedEventually<ValueType> const& formula, bool qualitative) const {
std::vector<ValueType> checkTimeBoundedEventually(storm::properties::csl::TimeBoundedEventually<ValueType> const& formula, bool qualitative) const {
// Test whether it is specified if the minimum or maximum probabilities are to be computed.
if(this->minimumOperatorStack.empty()) {
LOG4CPLUS_ERROR(logger, "Formula does not specify neither min nor max optimality, which is not meaningful over nondeterministic models.");
@ -115,11 +115,11 @@ public:
return this->checkTimeBoundedEventually(this->minimumOperatorStack.top(), goalStates, formula.getLowerBound(), formula.getUpperBound());
}
std::vector<ValueType> checkGlobally(storm::property::csl::Globally<ValueType> const& formula, bool qualitative) const {
std::vector<ValueType> checkGlobally(storm::properties::csl::Globally<ValueType> const& formula, bool qualitative) const {
throw storm::exceptions::NotImplementedException() << "Model checking Globally formulas on Markov automata is not yet implemented.";
}
std::vector<ValueType> checkEventually(storm::property::csl::Eventually<ValueType> const& formula, bool qualitative) const {
std::vector<ValueType> checkEventually(storm::properties::csl::Eventually<ValueType> const& formula, bool qualitative) const {
// Test whether it is specified if the minimum or maximum probabilities are to be computed.
if(this->minimumOperatorStack.empty()) {
LOG4CPLUS_ERROR(logger, "Formula does not specify neither min nor max optimality, which is not meaningful over nondeterministic models.");
@ -130,7 +130,7 @@ public:
return computeUnboundedUntilProbabilities(this->minimumOperatorStack.top(), storm::storage::BitVector(this->getModel().getNumberOfStates(), true), subFormulaStates, qualitative).first;
}
std::vector<ValueType> checkNext(storm::property::csl::Next<ValueType> const& formula, bool qualitative) const {
std::vector<ValueType> checkNext(storm::properties::csl::Next<ValueType> const& formula, bool qualitative) const {
throw storm::exceptions::NotImplementedException() << "Model checking Next formulas on Markov automata is not yet implemented.";
}

30
src/modelchecker/ltl/AbstractModelChecker.h

@ -9,7 +9,7 @@
#define STORM_MODELCHECKER_LTL_ABSTRACTMODELCHECKER_H_
#include "src/exceptions/InvalidPropertyException.h"
#include "src/formula/Ltl.h"
#include "src/properties/Ltl.h"
#include "src/storage/BitVector.h"
#include "src/models/AbstractModel.h"
@ -36,16 +36,16 @@ template<class Type>
class AbstractModelChecker :
// A list of interfaces the model checker supports. Typically, for each of the interfaces, a check method needs to
// be implemented that performs the corresponding check.
public virtual storm::property::ltl::IApModelChecker<Type>,
public virtual storm::property::ltl::IAndModelChecker<Type>,
public virtual storm::property::ltl::IOrModelChecker<Type>,
public virtual storm::property::ltl::INotModelChecker<Type>,
public virtual storm::property::ltl::IUntilModelChecker<Type>,
public virtual storm::property::ltl::IEventuallyModelChecker<Type>,
public virtual storm::property::ltl::IGloballyModelChecker<Type>,
public virtual storm::property::ltl::INextModelChecker<Type>,
public virtual storm::property::ltl::IBoundedUntilModelChecker<Type>,
public virtual storm::property::ltl::IBoundedEventuallyModelChecker<Type> {
public virtual storm::properties::ltl::IApModelChecker<Type>,
public virtual storm::properties::ltl::IAndModelChecker<Type>,
public virtual storm::properties::ltl::IOrModelChecker<Type>,
public virtual storm::properties::ltl::INotModelChecker<Type>,
public virtual storm::properties::ltl::IUntilModelChecker<Type>,
public virtual storm::properties::ltl::IEventuallyModelChecker<Type>,
public virtual storm::properties::ltl::IGloballyModelChecker<Type>,
public virtual storm::properties::ltl::INextModelChecker<Type>,
public virtual storm::properties::ltl::IBoundedUntilModelChecker<Type>,
public virtual storm::properties::ltl::IBoundedEventuallyModelChecker<Type> {
public:
/*!
@ -110,7 +110,7 @@ public:
* @param formula The formula to be checked.
* @returns The set of states satisfying the formula represented by a bit vector.
*/
virtual std::vector<Type> checkAp(storm::property::ltl::Ap<Type> const& formula) const = 0;
virtual std::vector<Type> checkAp(storm::properties::ltl::Ap<Type> const& formula) const = 0;
/*!
* Checks the given formula that is a logical "and" of two formulae.
@ -118,7 +118,7 @@ public:
* @param formula The formula to be checked.
* @returns The set of states satisfying the formula represented by a bit vector.
*/
virtual std::vector<Type> checkAnd(storm::property::ltl::And<Type> const& formula) const = 0;
virtual std::vector<Type> checkAnd(storm::properties::ltl::And<Type> const& formula) const = 0;
/*!
* Checks the given formula that is a logical "or" of two formulae.
@ -126,7 +126,7 @@ public:
* @param formula The formula to check.
* @returns The set of states satisfying the formula represented by a bit vector.
*/
virtual std::vector<Type> checkOr(storm::property::ltl::Or<Type> const& formula) const = 0;
virtual std::vector<Type> checkOr(storm::properties::ltl::Or<Type> const& formula) const = 0;
/*!
* Checks the given formula that is a logical "not" of a sub-formula.
@ -134,7 +134,7 @@ public:
* @param formula The formula to check.
* @returns The set of states satisfying the formula represented by a bit vector.
*/
virtual std::vector<Type> checkNot(const storm::property::ltl::Not<Type>& formula) const = 0;
virtual std::vector<Type> checkNot(const storm::properties::ltl::Not<Type>& formula) const = 0;
private:

50
src/modelchecker/prctl/AbstractModelChecker.h

@ -19,7 +19,7 @@ namespace prctl {
#include <stack>
#include "src/exceptions/InvalidPropertyException.h"
#include "src/formula/Prctl.h"
#include "src/properties/Prctl.h"
#include "src/storage/BitVector.h"
#include "src/models/AbstractModel.h"
#include "src/settings/Settings.h"
@ -47,21 +47,21 @@ template<class Type>
class AbstractModelChecker :
// A list of interfaces the model checker supports. Typically, for each of the interfaces, a check method needs to
// be implemented that performs the corresponding check.
public virtual storm::property::prctl::IApModelChecker<Type>,
public virtual storm::property::prctl::IAndModelChecker<Type>,
public virtual storm::property::prctl::IOrModelChecker<Type>,
public virtual storm::property::prctl::INotModelChecker<Type>,
public virtual storm::property::prctl::IUntilModelChecker<Type>,
public virtual storm::property::prctl::IEventuallyModelChecker<Type>,
public virtual storm::property::prctl::IGloballyModelChecker<Type>,
public virtual storm::property::prctl::INextModelChecker<Type>,
public virtual storm::property::prctl::IBoundedUntilModelChecker<Type>,
public virtual storm::property::prctl::IBoundedEventuallyModelChecker<Type>,
public virtual storm::property::prctl::IProbabilisticBoundOperatorModelChecker<Type>,
public virtual storm::property::prctl::IRewardBoundOperatorModelChecker<Type>,
public virtual storm::property::prctl::IReachabilityRewardModelChecker<Type>,
public virtual storm::property::prctl::ICumulativeRewardModelChecker<Type>,
public virtual storm::property::prctl::IInstantaneousRewardModelChecker<Type> {
public virtual storm::properties::prctl::IApModelChecker<Type>,
public virtual storm::properties::prctl::IAndModelChecker<Type>,
public virtual storm::properties::prctl::IOrModelChecker<Type>,
public virtual storm::properties::prctl::INotModelChecker<Type>,
public virtual storm::properties::prctl::IUntilModelChecker<Type>,
public virtual storm::properties::prctl::IEventuallyModelChecker<Type>,
public virtual storm::properties::prctl::IGloballyModelChecker<Type>,
public virtual storm::properties::prctl::INextModelChecker<Type>,
public virtual storm::properties::prctl::IBoundedUntilModelChecker<Type>,
public virtual storm::properties::prctl::IBoundedEventuallyModelChecker<Type>,
public virtual storm::properties::prctl::IProbabilisticBoundOperatorModelChecker<Type>,
public virtual storm::properties::prctl::IRewardBoundOperatorModelChecker<Type>,
public virtual storm::properties::prctl::IReachabilityRewardModelChecker<Type>,
public virtual storm::properties::prctl::ICumulativeRewardModelChecker<Type>,
public virtual storm::properties::prctl::IInstantaneousRewardModelChecker<Type> {
public:
/*!
@ -127,7 +127,7 @@ public:
* @param formula The formula to be checked.
* @return The set of states satisfying the formula represented by a bit vector.
*/
storm::storage::BitVector checkAp(storm::property::prctl::Ap<Type> const& formula) const {
storm::storage::BitVector checkAp(storm::properties::prctl::Ap<Type> const& formula) const {
if (formula.getAp() == "true") {
return storm::storage::BitVector(model.getNumberOfStates(), true);
} else if (formula.getAp() == "false") {
@ -148,7 +148,7 @@ public:
* @param formula The formula to be checked.
* @return The set of states satisfying the formula represented by a bit vector.
*/
storm::storage::BitVector checkAnd(storm::property::prctl::And<Type> const& formula) const {
storm::storage::BitVector checkAnd(storm::properties::prctl::And<Type> const& formula) const {
storm::storage::BitVector result = formula.getLeft()->check(*this);
storm::storage::BitVector right = formula.getRight()->check(*this);
result &= right;
@ -161,7 +161,7 @@ public:
* @param formula The formula to check.
* @return The set of states satisfying the formula represented by a bit vector.
*/
storm::storage::BitVector checkOr(storm::property::prctl::Or<Type> const& formula) const {
storm::storage::BitVector checkOr(storm::properties::prctl::Or<Type> const& formula) const {
storm::storage::BitVector result = formula.getLeft()->check(*this);
storm::storage::BitVector right = formula.getRight()->check(*this);
result |= right;
@ -174,7 +174,7 @@ public:
* @param formula The formula to check.
* @return The set of states satisfying the formula represented by a bit vector.
*/
storm::storage::BitVector checkNot(const storm::property::prctl::Not<Type>& formula) const {
storm::storage::BitVector checkNot(const storm::properties::prctl::Not<Type>& formula) const {
storm::storage::BitVector result = formula.getChild()->check(*this);
result.complement();
return result;
@ -187,7 +187,7 @@ public:
* @param formula The formula to check.
* @return The set of states satisfying the formula represented by a bit vector.
*/
virtual storm::storage::BitVector checkProbabilisticBoundOperator(storm::property::prctl::ProbabilisticBoundOperator<Type> const& formula) const {
virtual storm::storage::BitVector checkProbabilisticBoundOperator(storm::properties::prctl::ProbabilisticBoundOperator<Type> const& formula) const {
// First, we need to compute the probability for satisfying the path formula for each state.
std::vector<Type> quantitativeResult = formula.getChild()->check(*this, false);
@ -211,7 +211,7 @@ public:
* @param formula The formula to check.
* @return The set of states satisfying the formula represented by a bit vector.
*/
virtual storm::storage::BitVector checkRewardBoundOperator(const storm::property::prctl::RewardBoundOperator<Type>& formula) const {
virtual storm::storage::BitVector checkRewardBoundOperator(const storm::properties::prctl::RewardBoundOperator<Type>& formula) const {
// First, we need to compute the probability for satisfying the path formula for each state.
std::vector<Type> quantitativeResult = formula.getChild()->check(*this, false);
@ -236,7 +236,7 @@ public:
* @param optOperator True iff minimum probabilities are to be computed.
* @returns The probabilities to satisfy the formula, represented by a vector.
*/
virtual std::vector<Type> checkOptimizingOperator(storm::property::prctl::AbstractPathFormula<Type> const & formula, bool optOperator) const {
virtual std::vector<Type> checkOptimizingOperator(storm::properties::prctl::AbstractPathFormula<Type> const & formula, bool optOperator) const {
minimumOperatorStack.push(optOperator);
std::vector<Type> result = formula.check(*this, false);
minimumOperatorStack.pop();
@ -250,7 +250,7 @@ public:
* @param optOperator True iff minimum rewards are to be computed.
* @returns The the rewards accumulated by the formula, represented by a vector.
*/
virtual std::vector<Type> checkOptimizingOperator(storm::property::prctl::AbstractRewardPathFormula<Type> const & formula, bool optOperator) const {
virtual std::vector<Type> checkOptimizingOperator(storm::properties::prctl::AbstractRewardPathFormula<Type> const & formula, bool optOperator) const {
minimumOperatorStack.push(optOperator);
std::vector<Type> result = formula.check(*this, false);
minimumOperatorStack.pop();
@ -264,7 +264,7 @@ public:
* @param optOperator True iff minimum probabilities/rewards are to be computed.
* @returns The set of states satisfying the formula represented by a bit vector.
*/
virtual storm::storage::BitVector checkOptimizingOperator(storm::property::prctl::AbstractStateFormula<Type> const & formula, bool optOperator) const {
virtual storm::storage::BitVector checkOptimizingOperator(storm::properties::prctl::AbstractStateFormula<Type> const & formula, bool optOperator) const {
minimumOperatorStack.push(optOperator);
storm::storage::BitVector result = formula.check(*this);
minimumOperatorStack.pop();

26
src/modelchecker/prctl/SparseDtmcPrctlModelChecker.h

@ -71,7 +71,7 @@ public:
* @returns The probabilities for the given formula to hold on every state of the model associated with this model
* checker. If the qualitative flag is set, exact probabilities might not be computed.
*/
virtual std::vector<Type> checkBoundedUntil(storm::property::prctl::BoundedUntil<Type> const& formula, bool qualitative) const {
virtual std::vector<Type> checkBoundedUntil(storm::properties::prctl::BoundedUntil<Type> const& formula, bool qualitative) const {
return this->checkBoundedUntil(formula.getLeft()->check(*this), formula.getRight()->check(*this), formula.getBound(), qualitative);
}
@ -145,7 +145,7 @@ public:
* @returns The probabilities for the given formula to hold on every state of the model associated with this model
* checker. If the qualitative flag is set, exact probabilities might not be computed.
*/
virtual std::vector<Type> checkNext(storm::property::prctl::Next<Type> const& formula, bool qualitative) const {
virtual std::vector<Type> checkNext(storm::properties::prctl::Next<Type> const& formula, bool qualitative) const {
// First, we need to compute the states that satisfy the child formula of the next-formula.
storm::storage::BitVector nextStates = formula.getChild()->check(*this);
@ -174,7 +174,7 @@ public:
* @returns The probabilities for the given formula to hold on every state of the model associated with this model
* checker. If the qualitative flag is set, exact probabilities might not be computed.
*/
virtual std::vector<Type> checkBoundedEventually(storm::property::prctl::BoundedEventually<Type> const& formula, bool qualitative) const {
virtual std::vector<Type> checkBoundedEventually(storm::properties::prctl::BoundedEventually<Type> const& formula, bool qualitative) const {
return this->checkBoundedUntil(storm::storage::BitVector(this->getModel().getNumberOfStates(), true), formula.getChild()->check(*this), formula.getBound(), qualitative);
}
@ -189,9 +189,9 @@ public:
* @returns The probabilities for the given formula to hold on every state of the model associated with this model
* checker. If the qualitative flag is set, exact probabilities might not be computed.
*/
virtual std::vector<Type> checkEventually(storm::property::prctl::Eventually<Type> const& formula, bool qualitative) const {
virtual std::vector<Type> checkEventually(storm::properties::prctl::Eventually<Type> const& formula, bool qualitative) const {
// Create equivalent temporary until formula and check it.
storm::property::prctl::Until<Type> temporaryUntilFormula(std::shared_ptr<storm::property::prctl::Ap<Type>>(new storm::property::prctl::Ap<Type>("true")), formula.getChild());
storm::properties::prctl::Until<Type> temporaryUntilFormula(std::shared_ptr<storm::properties::prctl::Ap<Type>>(new storm::properties::prctl::Ap<Type>("true")), formula.getChild());
return this->checkUntil(temporaryUntilFormula, qualitative);
}
@ -206,9 +206,9 @@ public:
* @returns The probabilities for the given formula to hold on every state of the model associated with this model
* checker. If the qualitative flag is set, exact probabilities might not be computed.
*/
virtual std::vector<Type> checkGlobally(storm::property::prctl::Globally<Type> const& formula, bool qualitative) const {
virtual std::vector<Type> checkGlobally(storm::properties::prctl::Globally<Type> const& formula, bool qualitative) const {
// Create "equivalent" (equivalent up to negation) temporary eventually formula and check it.
storm::property::prctl::Eventually<Type> temporaryEventuallyFormula(std::shared_ptr<storm::property::prctl::Not<Type>>(new storm::property::prctl::Not<Type>(formula.getChild())));
storm::properties::prctl::Eventually<Type> temporaryEventuallyFormula(std::shared_ptr<storm::properties::prctl::Not<Type>>(new storm::properties::prctl::Not<Type>(formula.getChild())));
std::vector<Type> result = this->checkEventually(temporaryEventuallyFormula, qualitative);
// Now subtract the resulting vector from the constant one vector to obtain final result.
@ -228,7 +228,7 @@ public:
* @returns The probabilities for the given formula to hold on every state of the model associated with this model
* checker. If the qualitative flag is set, exact probabilities might not be computed.
*/
virtual std::vector<Type> checkUntil(storm::property::prctl::Until<Type> const& formula, bool qualitative) const {
virtual std::vector<Type> checkUntil(storm::properties::prctl::Until<Type> const& formula, bool qualitative) const {
return this->checkUntil(formula.getLeft()->check(*this), formula.getRight()->check(*this), qualitative);
}
@ -319,7 +319,7 @@ public:
* @returns The reward values for the given formula for every state of the model associated with this model
* checker. If the qualitative flag is set, exact values might not be computed.
*/
virtual std::vector<Type> checkInstantaneousReward(storm::property::prctl::InstantaneousReward<Type> const& formula, bool qualitative) const {
virtual std::vector<Type> checkInstantaneousReward(storm::properties::prctl::InstantaneousReward<Type> const& formula, bool qualitative) const {
// Only compute the result if the model has a state-based reward model.
if (!this->getModel().hasStateRewards()) {
LOG4CPLUS_ERROR(logger, "Missing (state-based) reward model for formula.");
@ -350,7 +350,7 @@ public:
* @returns The reward values for the given formula for every state of the model associated with this model
* checker. If the qualitative flag is set, exact values might not be computed.
*/
virtual std::vector<Type> checkCumulativeReward(storm::property::prctl::CumulativeReward<Type> const& formula, bool qualitative) const {
virtual std::vector<Type> checkCumulativeReward(storm::properties::prctl::CumulativeReward<Type> const& formula, bool qualitative) const {
// Only compute the result if the model has at least one reward model.
if (!this->getModel().hasStateRewards() && !this->getModel().hasTransitionRewards()) {
LOG4CPLUS_ERROR(logger, "Missing reward model for formula.");
@ -397,7 +397,7 @@ public:
* @returns The reward values for the given formula for every state of the model associated with this model
* checker. If the qualitative flag is set, exact values might not be computed.
*/
virtual std::vector<Type> checkReachabilityReward(storm::property::prctl::ReachabilityReward<Type> const& formula, bool qualitative) const {
virtual std::vector<Type> checkReachabilityReward(storm::properties::prctl::ReachabilityReward<Type> const& formula, bool qualitative) const {
// Only compute the result if the model has at least one reward model.
if (!this->getModel().hasStateRewards() && !this->getModel().hasTransitionRewards()) {
LOG4CPLUS_ERROR(logger, "Missing reward model for formula. Skipping formula");
@ -491,7 +491,7 @@ public:
* @param optOperator True iff minimum probabilities/rewards are to be computed.
* @returns The probabilities to satisfy the formula or the rewards accumulated by it, represented by a vector.
*/
virtual std::vector<Type> checkOptimizingOperator(storm::property::prctl::AbstractPathFormula<Type> const & formula, bool optOperator) const override {
virtual std::vector<Type> checkOptimizingOperator(storm::properties::prctl::AbstractPathFormula<Type> const & formula, bool optOperator) const override {
LOG4CPLUS_WARN(logger, "Formula contains min/max operator, which is not meaningful over deterministic models.");
@ -509,7 +509,7 @@ public:
* @param optOperator True iff minimum probabilities/rewards are to be computed.
* @returns The set of states satisfying the formula represented by a bit vector.
*/
virtual storm::storage::BitVector checkOptimizingOperator(storm::property::prctl::AbstractStateFormula<Type> const & formula, bool optOperator) const override {
virtual storm::storage::BitVector checkOptimizingOperator(storm::properties::prctl::AbstractStateFormula<Type> const & formula, bool optOperator) const override {
LOG4CPLUS_WARN(logger, "Formula contains min/max operator, which is not meaningful over deterministic models.");

32
src/modelchecker/prctl/SparseMdpPrctlModelChecker.h

@ -75,11 +75,11 @@ namespace storm {
* @param formula The formula to check.
* @return The set of states satisfying the formula represented by a bit vector.
*/
virtual storm::storage::BitVector checkProbabilisticBoundOperator(storm::property::prctl::ProbabilisticBoundOperator<Type> const& formula) const override {
virtual storm::storage::BitVector checkProbabilisticBoundOperator(storm::properties::prctl::ProbabilisticBoundOperator<Type> const& formula) const override {
// For P< and P<= the MDP satisfies the formula iff the probability maximizing scheduler is used.
// For P> and P>= " iff the probability minimizing " .
if(formula.getComparisonOperator() == storm::property::LESS || formula.getComparisonOperator() == storm::property::LESS_EQUAL) {
if(formula.getComparisonOperator() == storm::properties::LESS || formula.getComparisonOperator() == storm::properties::LESS_EQUAL) {
this->minimumOperatorStack.push(false);
}
else {
@ -112,11 +112,11 @@ namespace storm {
* @param formula The formula to check.
* @return The set of states satisfying the formula represented by a bit vector.
*/
virtual storm::storage::BitVector checkRewardBoundOperator(const storm::property::prctl::RewardBoundOperator<Type>& formula) const override {
virtual storm::storage::BitVector checkRewardBoundOperator(const storm::properties::prctl::RewardBoundOperator<Type>& formula) const override {
// For R< and R<= the MDP satisfies the formula iff the reward maximizing scheduler is used.
// For R> and R>= " iff the reward minimizing " .
if(formula.getComparisonOperator() == storm::property::LESS || formula.getComparisonOperator() == storm::property::LESS_EQUAL) {
if(formula.getComparisonOperator() == storm::properties::LESS || formula.getComparisonOperator() == storm::properties::LESS_EQUAL) {
this->minimumOperatorStack.push(false);
}
else {
@ -218,7 +218,7 @@ namespace storm {
* @return The probabilities for the given formula to hold on every state of the model associated with this model
* checker. If the qualitative flag is set, exact probabilities might not be computed.
*/
virtual std::vector<Type> checkBoundedUntil(storm::property::prctl::BoundedUntil<Type> const& formula, bool qualitative) const {
virtual std::vector<Type> checkBoundedUntil(storm::properties::prctl::BoundedUntil<Type> const& formula, bool qualitative) const {
return checkBoundedUntil(formula.getLeft()->check(*this), formula.getRight()->check(*this), formula.getBound(), qualitative);
}
@ -260,7 +260,7 @@ namespace storm {
* @return The probabilities for the given formula to hold on every state of the model associated with this model
* checker. If the qualitative flag is set, exact probabilities might not be computed.
*/
virtual std::vector<Type> checkNext(const storm::property::prctl::Next<Type>& formula, bool qualitative) const {
virtual std::vector<Type> checkNext(const storm::properties::prctl::Next<Type>& formula, bool qualitative) const {
return checkNext(formula.getChild()->check(*this), qualitative);
}
@ -275,9 +275,9 @@ namespace storm {
* @returns The probabilities for the given formula to hold on every state of the model associated with this model
* checker. If the qualitative flag is set, exact probabilities might not be computed.
*/
virtual std::vector<Type> checkBoundedEventually(const storm::property::prctl::BoundedEventually<Type>& formula, bool qualitative) const {
virtual std::vector<Type> checkBoundedEventually(const storm::properties::prctl::BoundedEventually<Type>& formula, bool qualitative) const {
// Create equivalent temporary bounded until formula and check it.
storm::property::prctl::BoundedUntil<Type> temporaryBoundedUntilFormula(std::shared_ptr<storm::property::prctl::Ap<Type>>(new storm::property::prctl::Ap<Type>("true")), formula.getChild(), formula.getBound());
storm::properties::prctl::BoundedUntil<Type> temporaryBoundedUntilFormula(std::shared_ptr<storm::properties::prctl::Ap<Type>>(new storm::properties::prctl::Ap<Type>("true")), formula.getChild(), formula.getBound());
return this->checkBoundedUntil(temporaryBoundedUntilFormula, qualitative);
}
@ -292,9 +292,9 @@ namespace storm {
* @returns The probabilities for the given formula to hold on every state of the model associated with this model
* checker. If the qualitative flag is set, exact probabilities might not be computed.
*/
virtual std::vector<Type> checkEventually(const storm::property::prctl::Eventually<Type>& formula, bool qualitative) const {
virtual std::vector<Type> checkEventually(const storm::properties::prctl::Eventually<Type>& formula, bool qualitative) const {
// Create equivalent temporary until formula and check it.
storm::property::prctl::Until<Type> temporaryUntilFormula(std::shared_ptr<storm::property::prctl::Ap<Type>>(new storm::property::prctl::Ap<Type>("true")), formula.getChild());
storm::properties::prctl::Until<Type> temporaryUntilFormula(std::shared_ptr<storm::properties::prctl::Ap<Type>>(new storm::properties::prctl::Ap<Type>("true")), formula.getChild());
return this->checkUntil(temporaryUntilFormula, qualitative);
}
@ -309,9 +309,9 @@ namespace storm {
* @returns The probabilities for the given formula to hold on every state of the model associated with this model
* checker. If the qualitative flag is set, exact probabilities might not be computed.
*/
virtual std::vector<Type> checkGlobally(const storm::property::prctl::Globally<Type>& formula, bool qualitative) const {
virtual std::vector<Type> checkGlobally(const storm::properties::prctl::Globally<Type>& formula, bool qualitative) const {
// Create "equivalent" temporary eventually formula and check it.
storm::property::prctl::Eventually<Type> temporaryEventuallyFormula(std::shared_ptr<storm::property::prctl::Not<Type>>(new storm::property::prctl::Not<Type>(formula.getChild())));
storm::properties::prctl::Eventually<Type> temporaryEventuallyFormula(std::shared_ptr<storm::properties::prctl::Not<Type>>(new storm::properties::prctl::Not<Type>(formula.getChild())));
std::vector<Type> result = this->checkEventually(temporaryEventuallyFormula, qualitative);
// Now subtract the resulting vector from the constant one vector to obtain final result.
@ -333,7 +333,7 @@ namespace storm {
* @return The probabilities for the given formula to hold on every state of the model associated with this model
* checker. If the qualitative flag is set, exact probabilities might not be computed.
*/
virtual std::vector<Type> checkUntil(const storm::property::prctl::Until<Type>& formula, bool qualitative) const {
virtual std::vector<Type> checkUntil(const storm::properties::prctl::Until<Type>& formula, bool qualitative) const {
// First test if it is specified if the minimum or maximum probabilities are to be computed.
if(this->minimumOperatorStack.empty()) {
LOG4CPLUS_ERROR(logger, "Formula does not specify neither min nor max optimality, which is not meaningful over nondeterministic models.");
@ -438,7 +438,7 @@ namespace storm {
* @return The reward values for the given formula for every state of the model associated with this model
* checker. If the qualitative flag is set, exact values might not be computed.
*/
virtual std::vector<Type> checkInstantaneousReward(const storm::property::prctl::InstantaneousReward<Type>& formula, bool qualitative) const {
virtual std::vector<Type> checkInstantaneousReward(const storm::properties::prctl::InstantaneousReward<Type>& formula, bool qualitative) const {
// Only compute the result if the model has a state-based reward model.
if (!this->getModel().hasStateRewards()) {
LOG4CPLUS_ERROR(logger, "Missing (state-based) reward model for formula.");
@ -470,7 +470,7 @@ namespace storm {
* @return The reward values for the given formula for every state of the model associated with this model
* checker. If the qualitative flag is set, exact values might not be computed.
*/
virtual std::vector<Type> checkCumulativeReward(const storm::property::prctl::CumulativeReward<Type>& formula, bool qualitative) const {
virtual std::vector<Type> checkCumulativeReward(const storm::properties::prctl::CumulativeReward<Type>& formula, bool qualitative) const {
// Only compute the result if the model has at least one reward model.
if (!this->getModel().hasStateRewards() && !this->getModel().hasTransitionRewards()) {
LOG4CPLUS_ERROR(logger, "Missing reward model for formula.");
@ -518,7 +518,7 @@ namespace storm {
* @return The reward values for the given formula for every state of the model associated with this model
* checker. If the qualitative flag is set, exact values might not be computed.
*/
virtual std::vector<Type> checkReachabilityReward(const storm::property::prctl::ReachabilityReward<Type>& formula, bool qualitative) const {
virtual std::vector<Type> checkReachabilityReward(const storm::properties::prctl::ReachabilityReward<Type>& formula, bool qualitative) const {
// First test whether it is specified if the minimum or maximum probabilities are to be computed.
if(this->minimumOperatorStack.empty()) {
LOG4CPLUS_ERROR(logger, "Formula does not specify neither min nor max optimality, which is not meaningful over nondeterministic models.");

76
src/parser/CslParser.cpp

@ -10,12 +10,12 @@
#include "src/utility/constants.h"
// The action class headers.
#include "src/formula/actions/AbstractAction.h"
#include "src/formula/actions/BoundAction.h"
#include "src/formula/actions/InvertAction.h"
#include "src/formula/actions/FormulaAction.h"
#include "src/formula/actions/RangeAction.h"
#include "src/formula/actions/SortAction.h"
#include "src/properties/actions/AbstractAction.h"
#include "src/properties/actions/BoundAction.h"
#include "src/properties/actions/InvertAction.h"
#include "src/properties/actions/FormulaAction.h"
#include "src/properties/actions/RangeAction.h"
#include "src/properties/actions/SortAction.h"
// If the parser fails due to ill-formed data, this exception is thrown.
#include "src/exceptions/WrongFormatException.h"
@ -41,7 +41,7 @@ typedef std::string::const_iterator BaseIteratorType;
typedef boost::spirit::classic::position_iterator2<BaseIteratorType> PositionIteratorType;
namespace qi = boost::spirit::qi;
namespace phoenix = boost::phoenix;
namespace csl = storm::property::csl;
namespace csl = storm::properties::csl;
namespace storm {
namespace parser {
@ -52,13 +52,13 @@ struct CslParser::CslGrammar : qi::grammar<Iterator, std::shared_ptr<csl::CslFil
//This block contains helper rules that may be used several times
freeIdentifierName = qi::lexeme[qi::alpha >> *(qi::alnum | qi::char_('_'))];
comparisonType = (
(qi::lit(">="))[qi::_val = storm::property::GREATER_EQUAL] |
(qi::lit(">"))[qi::_val = storm::property::GREATER] |
(qi::lit("<="))[qi::_val = storm::property::LESS_EQUAL] |
(qi::lit("<"))[qi::_val = storm::property::LESS]);
(qi::lit(">="))[qi::_val = storm::properties::GREATER_EQUAL] |
(qi::lit(">"))[qi::_val = storm::properties::GREATER] |
(qi::lit("<="))[qi::_val = storm::properties::LESS_EQUAL] |
(qi::lit("<"))[qi::_val = storm::properties::LESS]);
sortingCategory = (
(qi::lit("index"))[qi::_val = storm::property::action::SortAction<double>::INDEX] |
(qi::lit("value"))[qi::_val = storm::property::action::SortAction<double>::VALUE]
(qi::lit("index"))[qi::_val = storm::properties::action::SortAction<double>::INDEX] |
(qi::lit("value"))[qi::_val = storm::properties::action::SortAction<double>::VALUE]
);
//Comment: Empty line or line starting with "//"
comment = (qi::lit("//") >> *(qi::char_))[qi::_val = nullptr];
@ -136,43 +136,43 @@ struct CslParser::CslGrammar : qi::grammar<Iterator, std::shared_ptr<csl::CslFil
noBoundOperator.name("no bound operator");
probabilisticNoBoundOperator =
(qi::lit("P") >> qi::lit("min") >> qi::lit("=") > qi::lit("?") >> pathFormula)[qi::_val =
MAKE(csl::CslFilter<double>, qi::_1, storm::property::MINIMIZE)] |
MAKE(csl::CslFilter<double>, qi::_1, storm::properties::MINIMIZE)] |
(qi::lit("P") >> qi::lit("max") >> qi::lit("=") > qi::lit("?") >> pathFormula)[qi::_val =
MAKE(csl::CslFilter<double>, qi::_1, storm::property::MAXIMIZE)] |
MAKE(csl::CslFilter<double>, qi::_1, storm::properties::MAXIMIZE)] |
(qi::lit("P") >> qi::lit("=") > qi::lit("?") >> pathFormula)[qi::_val =
MAKE(csl::CslFilter<double>, qi::_1)];
probabilisticNoBoundOperator.name("probabilistic no bound operator");
steadyStateNoBoundOperator = (qi::lit("S") >> qi::lit("=") > qi::lit("?") >> stateFormula )[qi::_val =
MAKE(csl::CslFilter<double>, qi::_1, storm::property::UNDEFINED, true)];
MAKE(csl::CslFilter<double>, qi::_1, storm::properties::UNDEFINED, true)];
steadyStateNoBoundOperator.name("steady state no bound operator");
// This block defines rules for parsing filter actions.
boundAction = (qi::lit("bound") > qi::lit("(") >> comparisonType >> qi::lit(",") >> qi::double_ >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::BoundAction<double> ,qi::_1, qi::_2)];
MAKE(storm::properties::action::BoundAction<double> ,qi::_1, qi::_2)];
boundAction.name("bound action");
invertAction = qi::lit("invert")[qi::_val = MAKE(storm::property::action::InvertAction<double>, )];
invertAction = qi::lit("invert")[qi::_val = MAKE(storm::properties::action::InvertAction<double>, )];
invertAction.name("invert action");
formulaAction = (qi::lit("formula") > qi::lit("(") >> stateFormula >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::FormulaAction<double>, qi::_1)];
MAKE(storm::properties::action::FormulaAction<double>, qi::_1)];
formulaAction.name("formula action");
rangeAction = (
(qi::lit("range") >> qi::lit("(") >> qi::uint_ >> qi::lit(",") > qi::uint_ >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::RangeAction<double>, qi::_1, qi::_2)] |
MAKE(storm::properties::action::RangeAction<double>, qi::_1, qi::_2)] |
(qi::lit("range") >> qi::lit("(") >> qi::uint_ >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::RangeAction<double>, qi::_1, qi::_1 + 1)]
MAKE(storm::properties::action::RangeAction<double>, qi::_1, qi::_1 + 1)]
);
rangeAction.name("range action");
sortAction = (
(qi::lit("sort") >> qi::lit("(") >> sortingCategory >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::SortAction<double>, qi::_1)] |
MAKE(storm::properties::action::SortAction<double>, qi::_1)] |
(qi::lit("sort") >> qi::lit("(") >> sortingCategory >> qi::lit(", ") >> (qi::lit("ascending") | qi::lit("asc")) > qi::lit(")"))[qi::_val =
MAKE(storm::property::action::SortAction<double>, qi::_1, true)] |
MAKE(storm::properties::action::SortAction<double>, qi::_1, true)] |
(qi::lit("sort") >> qi::lit("(") >> sortingCategory >> qi::lit(", ") >> (qi::lit("descending") | qi::lit("desc")) > qi::lit(")"))[qi::_val =
MAKE(storm::property::action::SortAction<double>, qi::_1, false)]
MAKE(storm::properties::action::SortAction<double>, qi::_1, false)]
);
sortAction.name("sort action");
@ -182,9 +182,9 @@ struct CslParser::CslGrammar : qi::grammar<Iterator, std::shared_ptr<csl::CslFil
filter = (qi::lit("filter") >> qi::lit("[") >> +abstractAction >> qi::lit("]") >> qi::lit("(") >> formula >> qi::lit(")"))[qi::_val =
MAKE(csl::CslFilter<double>, qi::_2, qi::_1)] |
(qi::lit("filter") >> qi::lit("[") >> qi::lit("max") > +abstractAction >> qi::lit("]") >> qi::lit("(") >> formula >> qi::lit(")"))[qi::_val =
MAKE(csl::CslFilter<double>, qi::_2, qi::_1, storm::property::MAXIMIZE)] |
MAKE(csl::CslFilter<double>, qi::_2, qi::_1, storm::properties::MAXIMIZE)] |
(qi::lit("filter") >> qi::lit("[") >> qi::lit("min") > +abstractAction >> qi::lit("]") >> qi::lit("(") >> formula >> qi::lit(")"))[qi::_val =
MAKE(csl::CslFilter<double>, qi::_2, qi::_1, storm::property::MINIMIZE)] |
MAKE(csl::CslFilter<double>, qi::_2, qi::_1, storm::properties::MINIMIZE)] |
(noBoundOperator)[qi::_val =
qi::_1] |
(formula)[qi::_val =
@ -204,12 +204,12 @@ struct CslParser::CslGrammar : qi::grammar<Iterator, std::shared_ptr<csl::CslFil
qi::rule<Iterator, std::shared_ptr<csl::CslFilter<double>>(), Skipper> probabilisticNoBoundOperator;
qi::rule<Iterator, std::shared_ptr<csl::CslFilter<double>>(), Skipper> steadyStateNoBoundOperator;
qi::rule<Iterator, std::shared_ptr<storm::property::action::AbstractAction<double>>(), Skipper> abstractAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::BoundAction<double>>(), Skipper> boundAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::InvertAction<double>>(), Skipper> invertAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::FormulaAction<double>>(), Skipper> formulaAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::RangeAction<double>>(), Skipper> rangeAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::SortAction<double>>(), Skipper> sortAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::AbstractAction<double>>(), Skipper> abstractAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::BoundAction<double>>(), Skipper> boundAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::InvertAction<double>>(), Skipper> invertAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::FormulaAction<double>>(), Skipper> formulaAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::RangeAction<double>>(), Skipper> rangeAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::SortAction<double>>(), Skipper> sortAction;
qi::rule<Iterator, std::shared_ptr<csl::AbstractCslFormula<double>>(), Skipper> formula;
qi::rule<Iterator, std::shared_ptr<csl::AbstractCslFormula<double>>(), Skipper> comment;
@ -229,17 +229,17 @@ struct CslParser::CslGrammar : qi::grammar<Iterator, std::shared_ptr<csl::CslFil
qi::rule<Iterator, std::shared_ptr<csl::Eventually<double>>(), Skipper> eventually;
qi::rule<Iterator, std::shared_ptr<csl::Next<double>>(), Skipper> next;
qi::rule<Iterator, std::shared_ptr<csl::Globally<double>>(), Skipper> globally;
qi::rule<Iterator, std::shared_ptr<csl::TimeBoundedUntil<double>>(), qi::locals< std::shared_ptr<storm::property::csl::AbstractStateFormula<double>>>, Skipper> timeBoundedUntil;
qi::rule<Iterator, std::shared_ptr<csl::Until<double>>(), qi::locals< std::shared_ptr<storm::property::csl::AbstractStateFormula<double>>>, Skipper> until;
qi::rule<Iterator, std::shared_ptr<csl::TimeBoundedUntil<double>>(), qi::locals< std::shared_ptr<storm::properties::csl::AbstractStateFormula<double>>>, Skipper> timeBoundedUntil;
qi::rule<Iterator, std::shared_ptr<csl::Until<double>>(), qi::locals< std::shared_ptr<storm::properties::csl::AbstractStateFormula<double>>>, Skipper> until;
qi::rule<Iterator, std::string(), Skipper> freeIdentifierName;
qi::rule<Iterator, storm::property::ComparisonType(), Skipper> comparisonType;
qi::rule<Iterator, storm::property::action::SortAction<double>::SortingCategory(), Skipper> sortingCategory;
qi::rule<Iterator, storm::properties::ComparisonType(), Skipper> comparisonType;
qi::rule<Iterator, storm::properties::action::SortAction<double>::SortingCategory(), Skipper> sortingCategory;
};
std::shared_ptr<storm::property::csl::CslFilter<double>> CslParser::parseCslFormula(std::string formulaString) {
std::shared_ptr<storm::properties::csl::CslFilter<double>> CslParser::parseCslFormula(std::string formulaString) {
// Prepare iterators to input.
BaseIteratorType stringIteratorBegin = formulaString.begin();
BaseIteratorType stringIteratorEnd = formulaString.end();
@ -248,7 +248,7 @@ std::shared_ptr<storm::property::csl::CslFilter<double>> CslParser::parseCslForm
// Prepare resulting intermediate representation of input.
std::shared_ptr<storm::property::csl::CslFilter<double>> result_pointer(nullptr);
std::shared_ptr<storm::properties::csl::CslFilter<double>> result_pointer(nullptr);
CslGrammar<PositionIteratorType, BOOST_TYPEOF(boost::spirit::ascii::space)> grammar;

8
src/parser/CslParser.h

@ -8,8 +8,8 @@
#ifndef STORM_PARSER_CSLPARSER_H_
#define STORM_PARSER_CSLPARSER_H_
#include "src/formula/Csl.h"
#include "src/formula/csl/CslFilter.h"
#include "src/properties/Csl.h"
#include "src/properties/csl/CslFilter.h"
#include <functional>
namespace storm {
@ -25,7 +25,7 @@ public:
/*!
* Reads a CSL formula from its string representation and parses it into a formula tree, consisting of
* classes in the namespace storm::property.
* classes in the namespace storm::properties.
*
* If the string could not be parsed successfully, it will throw a wrongFormatException.
*
@ -33,7 +33,7 @@ public:
* @throw wrongFormatException If the input could not be parsed successfully.
* @return A CslFilter maintaining the parsed formula.
*/
static std::shared_ptr<storm::property::csl::CslFilter<double>> parseCslFormula(std::string formulaString);
static std::shared_ptr<storm::properties::csl::CslFilter<double>> parseCslFormula(std::string formulaString);
private:

4
src/parser/LtlFileParser.cpp

@ -15,7 +15,7 @@
namespace storm {
namespace parser {
std::list<std::shared_ptr<storm::property::ltl::LtlFilter<double>>> LtlFileParser::parseLtlFile(std::string filename) {
std::list<std::shared_ptr<storm::properties::ltl::LtlFilter<double>>> LtlFileParser::parseLtlFile(std::string filename) {
// Open file
std::ifstream inputFileStream(filename, std::ios::in);
@ -24,7 +24,7 @@ std::list<std::shared_ptr<storm::property::ltl::LtlFilter<double>>> LtlFileParse
throw storm::exceptions::FileIoException() << message << filename;
}
std::list<std::shared_ptr<storm::property::ltl::LtlFilter<double>>> result;
std::list<std::shared_ptr<storm::properties::ltl::LtlFilter<double>>> result;
while(!inputFileStream.eof()) {
std::string line;

6
src/parser/LtlFileParser.h

@ -8,8 +8,8 @@
#ifndef LTLFILEPARSER_H_
#define LTLFILEPARSER_H_
#include "formula/Ltl.h"
#include "src/formula/ltl/LtlFilter.h"
#include "properties/Ltl.h"
#include "src/properties/ltl/LtlFilter.h"
#include <list>
@ -25,7 +25,7 @@ public:
* @param filename Name and path to the file in which the formula strings can be found.
* @return The list of parsed formulas.
*/
static std::list<std::shared_ptr<storm::property::ltl::LtlFilter<double>>> parseLtlFile(std::string filename);
static std::list<std::shared_ptr<storm::properties::ltl::LtlFilter<double>>> parseLtlFile(std::string filename);
};
} //namespace parser

104
src/parser/LtlParser.cpp

@ -11,11 +11,11 @@
#include "src/utility/constants.h"
// The action class headers.
#include "src/formula/actions/AbstractAction.h"
#include "src/formula/actions/BoundAction.h"
#include "src/formula/actions/InvertAction.h"
#include "src/formula/actions/RangeAction.h"
#include "src/formula/actions/SortAction.h"
#include "src/properties/actions/AbstractAction.h"
#include "src/properties/actions/BoundAction.h"
#include "src/properties/actions/InvertAction.h"
#include "src/properties/actions/RangeAction.h"
#include "src/properties/actions/SortAction.h"
// If the parser fails due to ill-formed data, this exception is thrown.
#include "src/exceptions/WrongFormatException.h"
@ -41,7 +41,7 @@ typedef std::string::const_iterator BaseIteratorType;
typedef boost::spirit::classic::position_iterator2<BaseIteratorType> PositionIteratorType;
namespace qi = boost::spirit::qi;
namespace phoenix = boost::phoenix;
namespace ltl = storm::property::ltl;
namespace ltl = storm::properties::ltl;
namespace storm {
@ -49,18 +49,18 @@ namespace storm {
namespace parser {
template<typename Iterator, typename Skipper>
struct LtlParser::LtlGrammar : qi::grammar<Iterator, std::shared_ptr<storm::property::ltl::LtlFilter<double>>(), Skipper > {
struct LtlParser::LtlGrammar : qi::grammar<Iterator, std::shared_ptr<storm::properties::ltl::LtlFilter<double>>(), Skipper > {
LtlGrammar() : LtlGrammar::base_type(start) {
//This block contains helper rules that may be used several times
freeIdentifierName = qi::lexeme[qi::alpha >> *(qi::alnum | qi::char_('_'))];
comparisonType = (
(qi::lit(">="))[qi::_val = storm::property::GREATER_EQUAL] |
(qi::lit(">"))[qi::_val = storm::property::GREATER] |
(qi::lit("<="))[qi::_val = storm::property::LESS_EQUAL] |
(qi::lit("<"))[qi::_val = storm::property::LESS]);
(qi::lit(">="))[qi::_val = storm::properties::GREATER_EQUAL] |
(qi::lit(">"))[qi::_val = storm::properties::GREATER] |
(qi::lit("<="))[qi::_val = storm::properties::LESS_EQUAL] |
(qi::lit("<"))[qi::_val = storm::properties::LESS]);
sortingCategory = (
(qi::lit("index"))[qi::_val = storm::property::action::SortAction<double>::INDEX] |
(qi::lit("value"))[qi::_val = storm::property::action::SortAction<double>::VALUE]
(qi::lit("index"))[qi::_val = storm::properties::action::SortAction<double>::INDEX] |
(qi::lit("value"))[qi::_val = storm::properties::action::SortAction<double>::VALUE]
);
// Comment: Empty line or line starting with "//"
comment = (qi::lit("//") >> *(qi::char_))[qi::_val = nullptr];
@ -110,27 +110,27 @@ struct LtlParser::LtlGrammar : qi::grammar<Iterator, std::shared_ptr<storm::prop
// This block defines rules for parsing filter actions.
boundAction = (qi::lit("bound") > qi::lit("(") >> comparisonType >> qi::lit(",") >> qi::double_ >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::BoundAction<double> ,qi::_1, qi::_2)];
MAKE(storm::properties::action::BoundAction<double> ,qi::_1, qi::_2)];
boundAction.name("bound action");
invertAction = qi::lit("invert")[qi::_val = MAKE(storm::property::action::InvertAction<double>, )];
invertAction = qi::lit("invert")[qi::_val = MAKE(storm::properties::action::InvertAction<double>, )];
invertAction.name("invert action");
rangeAction = (
(qi::lit("range") >> qi::lit("(") >> qi::uint_ >> qi::lit(",") > qi::uint_ >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::RangeAction<double>, qi::_1, qi::_2)] |
MAKE(storm::properties::action::RangeAction<double>, qi::_1, qi::_2)] |
(qi::lit("range") >> qi::lit("(") >> qi::uint_ >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::RangeAction<double>, qi::_1, qi::_1 + 1)]
MAKE(storm::properties::action::RangeAction<double>, qi::_1, qi::_1 + 1)]
);
rangeAction.name("range action");
sortAction = (
(qi::lit("sort") >> qi::lit("(") >> sortingCategory >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::SortAction<double>, qi::_1)] |
MAKE(storm::properties::action::SortAction<double>, qi::_1)] |
(qi::lit("sort") >> qi::lit("(") >> sortingCategory >> qi::lit(", ") >> (qi::lit("ascending") | qi::lit("asc")) > qi::lit(")"))[qi::_val =
MAKE(storm::property::action::SortAction<double>, qi::_1, true)] |
MAKE(storm::properties::action::SortAction<double>, qi::_1, true)] |
(qi::lit("sort") >> qi::lit("(") >> sortingCategory >> qi::lit(", ") >> (qi::lit("descending") | qi::lit("desc")) > qi::lit(")"))[qi::_val =
MAKE(storm::property::action::SortAction<double>, qi::_1, false)]
MAKE(storm::properties::action::SortAction<double>, qi::_1, false)]
);
sortAction.name("sort action");
@ -140,9 +140,9 @@ struct LtlParser::LtlGrammar : qi::grammar<Iterator, std::shared_ptr<storm::prop
filter = (qi::lit("filter") >> qi::lit("[") >> +abstractAction >> qi::lit("]") > qi::lit("(") >> formula >> qi::lit(")"))[qi::_val =
MAKE(ltl::LtlFilter<double>, qi::_2, qi::_1)] |
(qi::lit("filter") >> qi::lit("[") >> qi::lit("max") > +abstractAction >> qi::lit("]") >> qi::lit("(") >> formula >> qi::lit(")"))[qi::_val =
MAKE(ltl::LtlFilter<double>, qi::_2, qi::_1, storm::property::MAXIMIZE)] |
MAKE(ltl::LtlFilter<double>, qi::_2, qi::_1, storm::properties::MAXIMIZE)] |
(qi::lit("filter") >> qi::lit("[") >> qi::lit("min") > +abstractAction >> qi::lit("]") >> qi::lit("(") >> formula >> qi::lit(")"))[qi::_val =
MAKE(ltl::LtlFilter<double>, qi::_2, qi::_1, storm::property::MINIMIZE)] |
MAKE(ltl::LtlFilter<double>, qi::_2, qi::_1, storm::properties::MINIMIZE)] |
(formula)[qi::_val =
MAKE(ltl::LtlFilter<double>, qi::_1)];
filter.name("LTL formula filter");
@ -151,39 +151,39 @@ struct LtlParser::LtlGrammar : qi::grammar<Iterator, std::shared_ptr<storm::prop
start.name("start");
}
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::LtlFilter<double>>(), Skipper> start;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::LtlFilter<double>>(), Skipper> filter;
qi::rule<Iterator, std::shared_ptr<storm::property::action::AbstractAction<double>>(), Skipper> abstractAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::BoundAction<double>>(), Skipper> boundAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::InvertAction<double>>(), Skipper> invertAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::RangeAction<double>>(), Skipper> rangeAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::SortAction<double>>(), Skipper> sortAction;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::AbstractLtlFormula<double>>(), Skipper> comment;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::AbstractLtlFormula<double>>(), Skipper> formula;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::AbstractLtlFormula<double>>(), Skipper> atomicLtlFormula;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::AbstractLtlFormula<double>>(), Skipper> andFormula;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::AbstractLtlFormula<double>>(), Skipper> untilFormula;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::AbstractLtlFormula<double>>(), Skipper> atomicProposition;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::AbstractLtlFormula<double>>(), Skipper> orFormula;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::AbstractLtlFormula<double>>(), Skipper> notFormula;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::AbstractLtlFormula<double>>(), Skipper> pathFormula;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::BoundedEventually<double>>(), Skipper> boundedEventually;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::Eventually<double>>(), Skipper> eventually;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::Globally<double>>(), Skipper> globally;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::Next<double>>(), Skipper> next;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::AbstractLtlFormula<double>>(), qi::locals< std::shared_ptr<storm::property::ltl::AbstractLtlFormula<double>>>, Skipper> boundedUntil;
qi::rule<Iterator, std::shared_ptr<storm::property::ltl::AbstractLtlFormula<double>>(), qi::locals< std::shared_ptr<storm::property::ltl::AbstractLtlFormula<double>>>, Skipper> until;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::LtlFilter<double>>(), Skipper> start;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::LtlFilter<double>>(), Skipper> filter;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::AbstractAction<double>>(), Skipper> abstractAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::BoundAction<double>>(), Skipper> boundAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::InvertAction<double>>(), Skipper> invertAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::RangeAction<double>>(), Skipper> rangeAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::SortAction<double>>(), Skipper> sortAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::AbstractLtlFormula<double>>(), Skipper> comment;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::AbstractLtlFormula<double>>(), Skipper> formula;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::AbstractLtlFormula<double>>(), Skipper> atomicLtlFormula;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::AbstractLtlFormula<double>>(), Skipper> andFormula;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::AbstractLtlFormula<double>>(), Skipper> untilFormula;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::AbstractLtlFormula<double>>(), Skipper> atomicProposition;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::AbstractLtlFormula<double>>(), Skipper> orFormula;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::AbstractLtlFormula<double>>(), Skipper> notFormula;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::AbstractLtlFormula<double>>(), Skipper> pathFormula;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::BoundedEventually<double>>(), Skipper> boundedEventually;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::Eventually<double>>(), Skipper> eventually;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::Globally<double>>(), Skipper> globally;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::Next<double>>(), Skipper> next;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::AbstractLtlFormula<double>>(), qi::locals< std::shared_ptr<storm::properties::ltl::AbstractLtlFormula<double>>>, Skipper> boundedUntil;
qi::rule<Iterator, std::shared_ptr<storm::properties::ltl::AbstractLtlFormula<double>>(), qi::locals< std::shared_ptr<storm::properties::ltl::AbstractLtlFormula<double>>>, Skipper> until;
qi::rule<Iterator, std::string(), Skipper> freeIdentifierName;
qi::rule<Iterator, storm::property::ComparisonType(), Skipper> comparisonType;
qi::rule<Iterator, storm::property::action::SortAction<double>::SortingCategory(), Skipper> sortingCategory;
qi::rule<Iterator, storm::properties::ComparisonType(), Skipper> comparisonType;
qi::rule<Iterator, storm::properties::action::SortAction<double>::SortingCategory(), Skipper> sortingCategory;
};
std::shared_ptr<storm::property::ltl::LtlFilter<double>> LtlParser::parseLtlFormula(std::string formulaString) {
std::shared_ptr<storm::properties::ltl::LtlFilter<double>> LtlParser::parseLtlFormula(std::string formulaString) {
// Prepare iterators to input.
BaseIteratorType stringIteratorBegin = formulaString.begin();
BaseIteratorType stringIteratorEnd = formulaString.end();
@ -192,7 +192,7 @@ std::shared_ptr<storm::property::ltl::LtlFilter<double>> LtlParser::parseLtlForm
// Prepare resulting intermediate representation of input.
std::shared_ptr<storm::property::ltl::LtlFilter<double>> result_pointer(nullptr);
std::shared_ptr<storm::properties::ltl::LtlFilter<double>> result_pointer(nullptr);
LtlGrammar<PositionIteratorType, BOOST_TYPEOF(boost::spirit::ascii::space)> grammar;

8
src/parser/LtlParser.h

@ -8,8 +8,8 @@
#ifndef STORM_PARSER_LTLPARSER_H_
#define STORM_PARSER_LTLPARSER_H_
#include "src/formula/Ltl.h"
#include "src/formula/ltl/LtlFilter.h"
#include "src/properties/Ltl.h"
#include "src/properties/ltl/LtlFilter.h"
namespace storm {
namespace parser {
@ -24,7 +24,7 @@ public:
/*!
* Reads a LTL formula from its string representation and parses it into a formula tree, consisting of
* classes in the namespace storm::property.
* classes in the namespace storm::properties.
*
* If the string could not be parsed successfully, it will throw a wrongFormatException.
*
@ -32,7 +32,7 @@ public:
* @throw wrongFormatException If the input could not be parsed successfully.
* @return A LtlFilter maintaining the parsed formula.
*/
static std::shared_ptr<storm::property::ltl::LtlFilter<double>> parseLtlFormula(std::string formulaString);
static std::shared_ptr<storm::properties::ltl::LtlFilter<double>> parseLtlFormula(std::string formulaString);
private:

6
src/parser/PrctlFileParser.cpp

@ -14,7 +14,7 @@
namespace storm {
namespace parser {
std::list<std::shared_ptr<storm::property::prctl::PrctlFilter<double>>> PrctlFileParser::parsePrctlFile(std::string filename) {
std::list<std::shared_ptr<storm::properties::prctl::PrctlFilter<double>>> PrctlFileParser::parsePrctlFile(std::string filename) {
// Open file
std::ifstream inputFileStream;
inputFileStream.open(filename, std::ios::in);
@ -24,12 +24,12 @@ std::list<std::shared_ptr<storm::property::prctl::PrctlFilter<double>>> PrctlFil
throw storm::exceptions::FileIoException() << message << filename;
}
std::list<std::shared_ptr<storm::property::prctl::PrctlFilter<double>>> result;
std::list<std::shared_ptr<storm::properties::prctl::PrctlFilter<double>>> result;
std::string line;
//The while loop reads the input file line by line
while (std::getline(inputFileStream, line)) {
std::shared_ptr<storm::property::prctl::PrctlFilter<double>> formula = PrctlParser::parsePrctlFormula(line);
std::shared_ptr<storm::properties::prctl::PrctlFilter<double>> formula = PrctlParser::parsePrctlFormula(line);
if (formula != nullptr) {
//lines containing comments will be skipped.
LOG4CPLUS_INFO(logger, "Parsed formula \"" + line + "\" into \"" + formula->toString() + "\"");

6
src/parser/PrctlFileParser.h

@ -8,8 +8,8 @@
#ifndef STORM_PARSER_PRCTLFILEPARSER_H_
#define STORM_PARSER_PRCTLFILEPARSER_H_
#include "formula/Prctl.h"
#include "src/formula/prctl/PrctlFilter.h"
#include "properties/Prctl.h"
#include "src/properties/prctl/PrctlFilter.h"
#include <list>
@ -25,7 +25,7 @@ public:
* @param filename Name and path to the file in which the formula strings can be found.
* @return The list of parsed formulas
*/
static std::list<std::shared_ptr<storm::property::prctl::PrctlFilter<double>>> parsePrctlFile(std::string filename);
static std::list<std::shared_ptr<storm::properties::prctl::PrctlFilter<double>>> parsePrctlFile(std::string filename);
};

130
src/parser/PrctlParser.cpp

@ -3,12 +3,12 @@
#include "src/utility/constants.h"
// The action class headers.
#include "src/formula/actions/AbstractAction.h"
#include "src/formula/actions/BoundAction.h"
#include "src/formula/actions/InvertAction.h"
#include "src/formula/actions/FormulaAction.h"
#include "src/formula/actions/RangeAction.h"
#include "src/formula/actions/SortAction.h"
#include "src/properties/actions/AbstractAction.h"
#include "src/properties/actions/BoundAction.h"
#include "src/properties/actions/InvertAction.h"
#include "src/properties/actions/FormulaAction.h"
#include "src/properties/actions/RangeAction.h"
#include "src/properties/actions/SortAction.h"
// If the parser fails due to ill-formed data, this exception is thrown.
#include "src/exceptions/WrongFormatException.h"
@ -35,7 +35,7 @@ typedef std::string::const_iterator BaseIteratorType;
typedef boost::spirit::classic::position_iterator2<BaseIteratorType> PositionIteratorType;
namespace qi = boost::spirit::qi;
namespace phoenix = boost::phoenix;
namespace prctl = storm::property::prctl;
namespace prctl = storm::properties::prctl;
namespace storm {
@ -43,18 +43,18 @@ namespace storm {
namespace parser {
template<typename Iterator, typename Skipper>
struct PrctlParser::PrctlGrammar : qi::grammar<Iterator, std::shared_ptr<storm::property::prctl::PrctlFilter<double>>(), Skipper > {
struct PrctlParser::PrctlGrammar : qi::grammar<Iterator, std::shared_ptr<storm::properties::prctl::PrctlFilter<double>>(), Skipper > {
PrctlGrammar() : PrctlGrammar::base_type(start) {
// This block contains helper rules that may be used several times
freeIdentifierName = qi::lexeme[qi::alpha >> *(qi::alnum | qi::char_('_'))];
comparisonType = (
(qi::lit(">="))[qi::_val = storm::property::GREATER_EQUAL] |
(qi::lit(">"))[qi::_val = storm::property::GREATER] |
(qi::lit("<="))[qi::_val = storm::property::LESS_EQUAL] |
(qi::lit("<"))[qi::_val = storm::property::LESS]);
(qi::lit(">="))[qi::_val = storm::properties::GREATER_EQUAL] |
(qi::lit(">"))[qi::_val = storm::properties::GREATER] |
(qi::lit("<="))[qi::_val = storm::properties::LESS_EQUAL] |
(qi::lit("<"))[qi::_val = storm::properties::LESS]);
sortingCategory = (
(qi::lit("index"))[qi::_val = storm::property::action::SortAction<double>::INDEX] |
(qi::lit("value"))[qi::_val = storm::property::action::SortAction<double>::VALUE]
(qi::lit("index"))[qi::_val = storm::properties::action::SortAction<double>::INDEX] |
(qi::lit("value"))[qi::_val = storm::properties::action::SortAction<double>::VALUE]
);
// Comment: Empty line or line starting with "//"
comment = (qi::lit("//") >> *(qi::char_))[qi::_val = nullptr];
@ -133,9 +133,9 @@ struct PrctlParser::PrctlGrammar : qi::grammar<Iterator, std::shared_ptr<storm::
noBoundOperator.name("no bound operator");
probabilisticNoBoundOperator = (
(qi::lit("P") >> qi::lit("min") >> qi::lit("=") > qi::lit("?") >> pathFormula )[qi::_val =
MAKE(prctl::PrctlFilter<double>, qi::_1, storm::property::MINIMIZE)] |
MAKE(prctl::PrctlFilter<double>, qi::_1, storm::properties::MINIMIZE)] |
(qi::lit("P") >> qi::lit("max") >> qi::lit("=") > qi::lit("?") >> pathFormula )[qi::_val =
MAKE(prctl::PrctlFilter<double>, qi::_1, storm::property::MAXIMIZE)] |
MAKE(prctl::PrctlFilter<double>, qi::_1, storm::properties::MAXIMIZE)] |
(qi::lit("P") >> qi::lit("=") > qi::lit("?") >> pathFormula )[qi::_val =
MAKE(prctl::PrctlFilter<double>, qi::_1)]
);
@ -143,9 +143,9 @@ struct PrctlParser::PrctlGrammar : qi::grammar<Iterator, std::shared_ptr<storm::
rewardNoBoundOperator = (
(qi::lit("R") >> qi::lit("min") >> qi::lit("=") > qi::lit("?") >> rewardPathFormula )[qi::_val =
MAKE(prctl::PrctlFilter<double>, qi::_1, storm::property::MINIMIZE)] |
MAKE(prctl::PrctlFilter<double>, qi::_1, storm::properties::MINIMIZE)] |
(qi::lit("R") >> qi::lit("max") >> qi::lit("=") > qi::lit("?") >> rewardPathFormula )[qi::_val =
MAKE(prctl::PrctlFilter<double>, qi::_1, storm::property::MAXIMIZE)] |
MAKE(prctl::PrctlFilter<double>, qi::_1, storm::properties::MAXIMIZE)] |
(qi::lit("R") >> qi::lit("=") > qi::lit("?") >> rewardPathFormula )[qi::_val =
MAKE(prctl::PrctlFilter<double>, qi::_1)]
@ -155,31 +155,31 @@ struct PrctlParser::PrctlGrammar : qi::grammar<Iterator, std::shared_ptr<storm::
// This block defines rules for parsing filter actions.
boundAction = (qi::lit("bound") > qi::lit("(") >> comparisonType >> qi::lit(",") >> qi::double_ >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::BoundAction<double> ,qi::_1, qi::_2)];
MAKE(storm::properties::action::BoundAction<double> ,qi::_1, qi::_2)];
boundAction.name("bound action");
invertAction = qi::lit("invert")[qi::_val = MAKE(storm::property::action::InvertAction<double>, )];
invertAction = qi::lit("invert")[qi::_val = MAKE(storm::properties::action::InvertAction<double>, )];
invertAction.name("invert action");
formulaAction = (qi::lit("formula") > qi::lit("(") >> stateFormula >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::FormulaAction<double>, qi::_1)];
MAKE(storm::properties::action::FormulaAction<double>, qi::_1)];
formulaAction.name("formula action");
rangeAction = (
(qi::lit("range") >> qi::lit("(") >> qi::uint_ >> qi::lit(",") > qi::uint_ >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::RangeAction<double>, qi::_1, qi::_2)] |
MAKE(storm::properties::action::RangeAction<double>, qi::_1, qi::_2)] |
(qi::lit("range") >> qi::lit("(") >> qi::uint_ >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::RangeAction<double>, qi::_1, qi::_1 + 1)]
MAKE(storm::properties::action::RangeAction<double>, qi::_1, qi::_1 + 1)]
);
rangeAction.name("range action");
sortAction = (
(qi::lit("sort") >> qi::lit("(") >> sortingCategory >> qi::lit(")"))[qi::_val =
MAKE(storm::property::action::SortAction<double>, qi::_1)] |
MAKE(storm::properties::action::SortAction<double>, qi::_1)] |
(qi::lit("sort") >> qi::lit("(") >> sortingCategory >> qi::lit(", ") >> (qi::lit("ascending") | qi::lit("asc")) > qi::lit(")"))[qi::_val =
MAKE(storm::property::action::SortAction<double>, qi::_1, true)] |
MAKE(storm::properties::action::SortAction<double>, qi::_1, true)] |
(qi::lit("sort") >> qi::lit("(") >> sortingCategory >> qi::lit(", ") >> (qi::lit("descending") | qi::lit("desc")) > qi::lit(")"))[qi::_val =
MAKE(storm::property::action::SortAction<double>, qi::_1, false)]
MAKE(storm::properties::action::SortAction<double>, qi::_1, false)]
);
sortAction.name("sort action");
@ -189,9 +189,9 @@ struct PrctlParser::PrctlGrammar : qi::grammar<Iterator, std::shared_ptr<storm::
filter = (qi::lit("filter") >> qi::lit("[") >> +abstractAction >> qi::lit("]") > qi::lit("(") >> formula >> qi::lit(")"))[qi::_val =
MAKE(prctl::PrctlFilter<double>, qi::_2, qi::_1)] |
(qi::lit("filter") >> qi::lit("[") >> qi::lit("max") > +abstractAction >> qi::lit("]") >> qi::lit("(") >> formula >> qi::lit(")"))[qi::_val =
MAKE(prctl::PrctlFilter<double>, qi::_2, qi::_1, storm::property::MAXIMIZE)] |
MAKE(prctl::PrctlFilter<double>, qi::_2, qi::_1, storm::properties::MAXIMIZE)] |
(qi::lit("filter") >> qi::lit("[") >> qi::lit("min") > +abstractAction >> qi::lit("]") >> qi::lit("(") >> formula >> qi::lit(")"))[qi::_val =
MAKE(prctl::PrctlFilter<double>, qi::_2, qi::_1, storm::property::MINIMIZE)] |
MAKE(prctl::PrctlFilter<double>, qi::_2, qi::_1, storm::properties::MINIMIZE)] |
(noBoundOperator)[qi::_val =
qi::_1] |
(formula)[qi::_val =
@ -203,54 +203,54 @@ struct PrctlParser::PrctlGrammar : qi::grammar<Iterator, std::shared_ptr<storm::
}
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::PrctlFilter<double>>(), Skipper> start;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::PrctlFilter<double>>(), Skipper> filter;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::PrctlFilter<double>>(), Skipper> start;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::PrctlFilter<double>>(), Skipper> filter;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::PrctlFilter<double>>(), Skipper> noBoundOperator;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::PrctlFilter<double>>(), Skipper> probabilisticNoBoundOperator;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::PrctlFilter<double>>(), Skipper> rewardNoBoundOperator;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::PrctlFilter<double>>(), Skipper> noBoundOperator;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::PrctlFilter<double>>(), Skipper> probabilisticNoBoundOperator;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::PrctlFilter<double>>(), Skipper> rewardNoBoundOperator;
qi::rule<Iterator, std::shared_ptr<storm::property::action::AbstractAction<double>>(), Skipper> abstractAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::BoundAction<double>>(), Skipper> boundAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::InvertAction<double>>(), Skipper> invertAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::FormulaAction<double>>(), Skipper> formulaAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::RangeAction<double>>(), Skipper> rangeAction;
qi::rule<Iterator, std::shared_ptr<storm::property::action::SortAction<double>>(), Skipper> sortAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::AbstractAction<double>>(), Skipper> abstractAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::BoundAction<double>>(), Skipper> boundAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::InvertAction<double>>(), Skipper> invertAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::FormulaAction<double>>(), Skipper> formulaAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::RangeAction<double>>(), Skipper> rangeAction;
qi::rule<Iterator, std::shared_ptr<storm::properties::action::SortAction<double>>(), Skipper> sortAction;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::AbstractPrctlFormula<double>>(), Skipper> formula;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::AbstractPrctlFormula<double>>(), Skipper> comment;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::AbstractPrctlFormula<double>>(), Skipper> formula;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::AbstractPrctlFormula<double>>(), Skipper> comment;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::AbstractStateFormula<double>>(), Skipper> stateFormula;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::AbstractStateFormula<double>>(), Skipper> atomicStateFormula;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::AbstractStateFormula<double>>(), Skipper> stateFormula;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::AbstractStateFormula<double>>(), Skipper> atomicStateFormula;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::AbstractStateFormula<double>>(), Skipper> andFormula;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::AbstractStateFormula<double>>(), Skipper> atomicProposition;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::AbstractStateFormula<double>>(), Skipper> orFormula;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::AbstractStateFormula<double>>(), Skipper> notFormula;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::ProbabilisticBoundOperator<double>>(), Skipper> probabilisticBoundOperator;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::RewardBoundOperator<double>>(), Skipper> rewardBoundOperator;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::AbstractStateFormula<double>>(), Skipper> andFormula;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::AbstractStateFormula<double>>(), Skipper> atomicProposition;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::AbstractStateFormula<double>>(), Skipper> orFormula;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::AbstractStateFormula<double>>(), Skipper> notFormula;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::ProbabilisticBoundOperator<double>>(), Skipper> probabilisticBoundOperator;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::RewardBoundOperator<double>>(), Skipper> rewardBoundOperator;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::AbstractPathFormula<double>>(), Skipper> pathFormula;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::BoundedEventually<double>>(), Skipper> boundedEventually;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::Eventually<double>>(), Skipper> eventually;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::Next<double>>(), Skipper> next;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::Globally<double>>(), Skipper> globally;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::BoundedUntil<double>>(), qi::locals< std::shared_ptr<storm::property::prctl::AbstractStateFormula<double>>>, Skipper> boundedUntil;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::Until<double>>(), qi::locals< std::shared_ptr<storm::property::prctl::AbstractStateFormula<double>>>, Skipper> until;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::AbstractPathFormula<double>>(), Skipper> pathFormula;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::BoundedEventually<double>>(), Skipper> boundedEventually;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::Eventually<double>>(), Skipper> eventually;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::Next<double>>(), Skipper> next;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::Globally<double>>(), Skipper> globally;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::BoundedUntil<double>>(), qi::locals< std::shared_ptr<storm::properties::prctl::AbstractStateFormula<double>>>, Skipper> boundedUntil;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::Until<double>>(), qi::locals< std::shared_ptr<storm::properties::prctl::AbstractStateFormula<double>>>, Skipper> until;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::AbstractRewardPathFormula<double>>(), Skipper> rewardPathFormula;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::CumulativeReward<double>>(), Skipper> cumulativeReward;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::ReachabilityReward<double>>(), Skipper> reachabilityReward;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::InstantaneousReward<double>>(), Skipper> instantaneousReward;
qi::rule<Iterator, std::shared_ptr<storm::property::prctl::SteadyStateReward<double>>(), Skipper> steadyStateReward;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::AbstractRewardPathFormula<double>>(), Skipper> rewardPathFormula;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::CumulativeReward<double>>(), Skipper> cumulativeReward;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::ReachabilityReward<double>>(), Skipper> reachabilityReward;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::InstantaneousReward<double>>(), Skipper> instantaneousReward;
qi::rule<Iterator, std::shared_ptr<storm::properties::prctl::SteadyStateReward<double>>(), Skipper> steadyStateReward;
qi::rule<Iterator, std::string(), Skipper> freeIdentifierName;
qi::rule<Iterator, storm::property::ComparisonType(), Skipper> comparisonType;
qi::rule<Iterator, storm::property::action::SortAction<double>::SortingCategory(), Skipper> sortingCategory;
qi::rule<Iterator, storm::properties::ComparisonType(), Skipper> comparisonType;
qi::rule<Iterator, storm::properties::action::SortAction<double>::SortingCategory(), Skipper> sortingCategory;
};
std::shared_ptr<storm::property::prctl::PrctlFilter<double>> PrctlParser::parsePrctlFormula(std::string formulaString) {
std::shared_ptr<storm::properties::prctl::PrctlFilter<double>> PrctlParser::parsePrctlFormula(std::string formulaString) {
// Prepare iterators to input.
BaseIteratorType stringIteratorBegin = formulaString.begin();
BaseIteratorType stringIteratorEnd = formulaString.end();
@ -259,7 +259,7 @@ std::shared_ptr<storm::property::prctl::PrctlFilter<double>> PrctlParser::parseP
// Prepare resulting intermediate representation of input.
std::shared_ptr<storm::property::prctl::PrctlFilter<double>> result_pointer(nullptr);
std::shared_ptr<storm::properties::prctl::PrctlFilter<double>> result_pointer(nullptr);
PrctlGrammar<PositionIteratorType, BOOST_TYPEOF(boost::spirit::ascii::space)> grammar;

8
src/parser/PrctlParser.h

@ -1,8 +1,8 @@
#ifndef STORM_PARSER_PRCTLPARSER_H_
#define STORM_PARSER_PRCTLPARSER_H_
#include "src/formula/Prctl.h"
#include "src/formula/prctl/PrctlFilter.h"
#include "src/properties/Prctl.h"
#include "src/properties/prctl/PrctlFilter.h"
namespace storm {
namespace parser {
@ -17,7 +17,7 @@ public:
/*!
* Reads a Prctl formula from its string representation and parses it into a formula tree, consisting of
* classes in the namespace storm::property.
* classes in the namespace storm::properties.
*
* If the string could not be parsed successfully, it will throw a wrongFormatException.
*
@ -25,7 +25,7 @@ public:
* @throw wrongFormatException If the input could not be parsed successfully
* @return A PrctlFilter maintaining the parsed formula. If the line just contained a comment a nullptr will be returned instead.
*/
static std::shared_ptr<storm::property::prctl::PrctlFilter<double>> parsePrctlFormula(std::string formulaString);
static std::shared_ptr<storm::properties::prctl::PrctlFilter<double>> parsePrctlFormula(std::string formulaString);
private:

8
src/formula/AbstractFilter.h → src/properties/AbstractFilter.h

@ -10,11 +10,11 @@
#include <vector>
#include <string>
#include "src/formula/AbstractFormula.h"
#include "src/formula/actions/AbstractAction.h"
#include "src/properties/AbstractFormula.h"
#include "src/properties/actions/AbstractAction.h"
namespace storm {
namespace property {
namespace properties {
/*!
* This enum contains value indicating which kind of scheduler is to be used
@ -215,7 +215,7 @@ protected:
OptimizingOperator opt;
};
} //namespace property
} //namespace properties
} //namespace storm

12
src/formula/AbstractFormula.h → src/properties/AbstractFormula.h

@ -12,21 +12,19 @@
#include <memory>
namespace storm {
namespace property {
namespace properties {
template <class T> class AbstractFormula;
} //namespace property
} //namespace properties
} //namespace storm
namespace storm {
namespace property {
// do properties
namespace properties {
/*!
* This is the abstract base class for every formula class in every logic.
*
* There are currently three implemented logics Ltl, Csl and Pctl.
* The implementation of these logics can be found in the namespaces storm::property::<logic>
* The implementation of these logics can be found in the namespaces storm::properties::<logic>
* where <logic> is one of ltl, pctl and csl.
*
* @note While formula classes do have copy constructors using a copy constructor
@ -66,7 +64,7 @@ public:
}
};
} // namespace property
} // namespace properties
} // namespace storm
#endif /* STORM_FORMULA_ABSTRACTFORMULA_H_ */

2
src/formula/ComparisonType.h → src/properties/ComparisonType.h

@ -9,7 +9,7 @@
#define STORM_FORMULA_COMPARISONTYPE_H_
namespace storm {
namespace property {
namespace properties {
/*!
* An enum representing the greater- and less-than operators in both

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

0
src/formula/Ltl.h → src/properties/Ltl.h

0
src/formula/Prctl.h → src/properties/Prctl.h

4
src/formula/actions/AbstractAction.h → src/properties/actions/AbstractAction.h

@ -16,7 +16,7 @@
#include "src/modelchecker/ltl/AbstractModelChecker.h"
namespace storm {
namespace property {
namespace properties {
namespace action {
/*!
@ -141,7 +141,7 @@ public:
};
} //namespace action
} //namespace property
} //namespace properties
} //namespace storm

28
src/formula/actions/BoundAction.h → src/properties/actions/BoundAction.h

@ -8,12 +8,12 @@
#ifndef STORM_FORMULA_ACTION_BOUNDACTION_H_
#define STORM_FORMULA_ACTION_BOUNDACTION_H_
#include "src/formula/actions/AbstractAction.h"
#include "src/formula/ComparisonType.h"
#include "src/properties/actions/AbstractAction.h"
#include "src/properties/ComparisonType.h"
#include "src/exceptions/InvalidArgumentException.h"
namespace storm {
namespace property {
namespace properties {
namespace action {
/*!
@ -34,7 +34,7 @@ public:
* Constructs an empty BoundAction.
* The bound is set to >= 0. Thus, all states will be selected by the action.
*/
BoundAction() : comparisonOperator(storm::property::GREATER_EQUAL), bound(0) {
BoundAction() : comparisonOperator(storm::properties::GREATER_EQUAL), bound(0) {
//Intentionally left empty.
}
@ -44,7 +44,7 @@ public:
* @param comparisonOperator The operator used to make the comparison between the bound and the modelchecking values for each state.
* @param bound The bound to compare the modelchecking values against.
*/
BoundAction(storm::property::ComparisonType comparisonOperator, T bound) : comparisonOperator(comparisonOperator), bound(bound) {
BoundAction(storm::properties::ComparisonType comparisonOperator, T bound) : comparisonOperator(comparisonOperator), bound(bound) {
//Intentionally left empty.
}
@ -148,16 +148,16 @@ private:
for(uint_fast64_t i = 0; i < result.pathResult.size(); i++) {
if(result.selection[i]) {
switch(comparisonOperator) {
case storm::property::GREATER_EQUAL:
case storm::properties::GREATER_EQUAL:
out.set(i, result.pathResult[i] >= bound);
break;
case storm::property::GREATER:
case storm::properties::GREATER:
out.set(i, result.pathResult[i] > bound);
break;
case storm::property::LESS_EQUAL:
case storm::properties::LESS_EQUAL:
out.set(i, result.pathResult[i] <= bound);
break;
case storm::property::LESS:
case storm::properties::LESS:
out.set(i, result.pathResult[i] < bound);
break;
default:
@ -173,16 +173,16 @@ private:
for(uint_fast64_t i = 0; i < result.stateMap.size(); i++) {
if(result.selection[i]) {
switch(comparisonOperator) {
case storm::property::GREATER_EQUAL:
case storm::properties::GREATER_EQUAL:
out.set(i, result.stateResult[i] >= bound);
break;
case storm::property::GREATER:
case storm::properties::GREATER:
out.set(i, result.stateResult[i] > bound);
break;
case storm::property::LESS_EQUAL:
case storm::properties::LESS_EQUAL:
out.set(i, result.stateResult[i] <= bound);
break;
case storm::property::LESS:
case storm::properties::LESS:
out.set(i, result.stateResult[i] < bound);
break;
default:
@ -198,7 +198,7 @@ private:
}
// The operator used to make the comparison between the bound and the modelchecking values for each state at time of evaluation.
storm::property::ComparisonType comparisonOperator;
storm::properties::ComparisonType comparisonOperator;
// The bound to compare the modelchecking values against during evaluation.
T bound;

18
src/formula/actions/FormulaAction.h → src/properties/actions/FormulaAction.h

@ -8,15 +8,15 @@
#ifndef STORM_FORMULA_ACTION_FORMULAACTION_H_
#define STORM_FORMULA_ACTION_FORMULAACTION_H_
#include "src/formula/actions/AbstractAction.h"
#include "src/formula/prctl/AbstractStateFormula.h"
#include "src/formula/csl/AbstractStateFormula.h"
#include "src/properties/actions/AbstractAction.h"
#include "src/properties/prctl/AbstractStateFormula.h"
#include "src/properties/csl/AbstractStateFormula.h"
#include <string>
namespace storm {
namespace property {
namespace properties {
namespace action {
/*!
@ -48,7 +48,7 @@ public:
*
* @param prctlFormula The Prctl state formula used to filter the selection during evaluation.
*/
FormulaAction(std::shared_ptr<storm::property::prctl::AbstractStateFormula<T>> const & prctlFormula) : prctlFormula(prctlFormula), cslFormula(nullptr) {
FormulaAction(std::shared_ptr<storm::properties::prctl::AbstractStateFormula<T>> const & prctlFormula) : prctlFormula(prctlFormula), cslFormula(nullptr) {
//Intentionally left empty.
}
@ -57,7 +57,7 @@ public:
*
* @param cslFormula The Csl state formula used to filter the selection during evaluation.
*/
FormulaAction(std::shared_ptr<storm::property::csl::AbstractStateFormula<T>> const & cslFormula) : prctlFormula(nullptr), cslFormula(cslFormula) {
FormulaAction(std::shared_ptr<storm::properties::csl::AbstractStateFormula<T>> const & cslFormula) : prctlFormula(nullptr), cslFormula(cslFormula) {
//Intentionally left empty.
}
@ -126,15 +126,15 @@ public:
private:
// The Prctl state formula used during evaluation.
std::shared_ptr<storm::property::prctl::AbstractStateFormula<T>> prctlFormula;
std::shared_ptr<storm::properties::prctl::AbstractStateFormula<T>> prctlFormula;
// The Csl state formula used during evaluation.
std::shared_ptr<storm::property::csl::AbstractStateFormula<T>> cslFormula;
std::shared_ptr<storm::properties::csl::AbstractStateFormula<T>> cslFormula;
};
} //namespace action
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_ACTION_FORMULAACTION_H_ */

6
src/formula/actions/InvertAction.h → src/properties/actions/InvertAction.h

@ -8,10 +8,10 @@
#ifndef STORM_FORMULA_ACTION_INVERTACTION_H_
#define STORM_FORMULA_ACTION_INVERTACTION_H_
#include "src/formula/actions/AbstractAction.h"
#include "src/properties/actions/AbstractAction.h"
namespace storm {
namespace property {
namespace properties {
namespace action {
/*!
@ -103,7 +103,7 @@ private:
};
} //namespace action
} //namespace property
} //namespace properties
} //namespace storm

6
src/formula/actions/RangeAction.h → src/properties/actions/RangeAction.h

@ -8,10 +8,10 @@
#ifndef STORM_FORMULA_ACTION_RANGEACTION_H_
#define STORM_FORMULA_ACTION_RANGEACTION_H_
#include "src/formula/actions/AbstractAction.h"
#include "src/properties/actions/AbstractAction.h"
namespace storm {
namespace property {
namespace properties {
namespace action {
/*!
@ -149,7 +149,7 @@ private:
};
} //namespace action
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_ACTION_RANGEACTION_H_ */

6
src/formula/actions/SortAction.h → src/properties/actions/SortAction.h

@ -8,11 +8,11 @@
#ifndef STORM_FORMULA_ACTION_SORTACTION_H_
#define STORM_FORMULA_ACTION_SORTACTION_H_
#include "src/formula/actions/AbstractAction.h"
#include "src/properties/actions/AbstractAction.h"
#include <cctype>
namespace storm {
namespace property {
namespace properties {
namespace action {
/*!
@ -225,7 +225,7 @@ private:
};
} //namespace action
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_ACTION_SORTACTION_H_ */

22
src/formula/csl/AbstractCslFormula.h → src/properties/csl/AbstractCslFormula.h

@ -8,10 +8,10 @@
#ifndef STORM_FORMULA_CSL_ABSTRACTCSLFORMULA_H_
#define STORM_FORMULA_CSL_ABSTRACTCSLFORMULA_H_
#include "src/formula/AbstractFormula.h"
#include "src/properties/AbstractFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
// Forward declarations.
@ -25,7 +25,7 @@ template <class T> class Until;
}
namespace storm {
namespace property {
namespace properties {
namespace csl {
/*!
@ -37,7 +37,7 @@ namespace csl {
* the original and the copy.
*/
template <class T>
class AbstractCslFormula : public virtual storm::property::AbstractFormula<T>{
class AbstractCslFormula : public virtual storm::properties::AbstractFormula<T>{
public:
/*!
@ -59,23 +59,23 @@ public:
bool isProbEventuallyAP() const {
// Test if a probabilistic bound operator is at the root.
if(dynamic_cast<storm::property::csl::ProbabilisticBoundOperator<T> const *>(this) == nullptr) {
if(dynamic_cast<storm::properties::csl::ProbabilisticBoundOperator<T> const *>(this) == nullptr) {
return false;
}
auto probFormula = dynamic_cast<storm::property::csl::ProbabilisticBoundOperator<T> const *>(this);
auto probFormula = dynamic_cast<storm::properties::csl::ProbabilisticBoundOperator<T> const *>(this);
// Check if the direct subformula of the probabilistic bound operator is an eventually or until formula.
if(std::dynamic_pointer_cast<storm::property::csl::Eventually<T>>(probFormula->getChild()).get() != nullptr) {
if(std::dynamic_pointer_cast<storm::properties::csl::Eventually<T>>(probFormula->getChild()).get() != nullptr) {
// Get the subformula and check if its subformulas are propositional.
auto eventuallyFormula = std::dynamic_pointer_cast<storm::property::csl::Eventually<T>>(probFormula->getChild());
auto eventuallyFormula = std::dynamic_pointer_cast<storm::properties::csl::Eventually<T>>(probFormula->getChild());
return eventuallyFormula->getChild()->isPropositional();
}
else if(std::dynamic_pointer_cast<storm::property::csl::Until<T>>(probFormula->getChild()).get() != nullptr) {
else if(std::dynamic_pointer_cast<storm::properties::csl::Until<T>>(probFormula->getChild()).get() != nullptr) {
// Get the subformula and check if its subformulas are propositional.
auto untilFormula = std::dynamic_pointer_cast<storm::property::csl::Until<T>>(probFormula->getChild());
auto untilFormula = std::dynamic_pointer_cast<storm::properties::csl::Until<T>>(probFormula->getChild());
return untilFormula->getLeft()->isPropositional() && untilFormula->getRight()->isPropositional();
}
@ -84,6 +84,6 @@ public:
};
} /* namespace csl */
} /* namespace property */
} /* namespace properties */
} /* namespace storm */
#endif /* STORM_FORMULA_CSL_ABSTRACTCSLFORMULA_H_ */

8
src/formula/csl/AbstractPathFormula.h → src/properties/csl/AbstractPathFormula.h

@ -8,7 +8,7 @@
#ifndef STORM_FORMULA_CSL_ABSTRACTPATHFORMULA_H_
#define STORM_FORMULA_CSL_ABSTRACTPATHFORMULA_H_
#include "src/formula/csl/AbstractCslFormula.h"
#include "src/properties/csl/AbstractCslFormula.h"
#include "src/modelchecker/csl/ForwardDeclarations.h"
#include <vector>
@ -16,7 +16,7 @@
#include <typeinfo>
namespace storm {
namespace property {
namespace properties {
namespace csl {
/*!
@ -26,7 +26,7 @@ namespace csl {
* The result of a modelchecking process on such a formula is a vector representing the satisfaction probabilities for each state of the model.
*/
template <class T>
class AbstractPathFormula : public virtual storm::property::csl::AbstractCslFormula<T> {
class AbstractPathFormula : public virtual storm::properties::csl::AbstractCslFormula<T> {
public:
@ -63,7 +63,7 @@ public:
};
} //namespace csl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_CSL_ABSTRACTPATHFORMULA_H_ */

8
src/formula/csl/AbstractStateFormula.h → src/properties/csl/AbstractStateFormula.h

@ -8,19 +8,19 @@
#ifndef STORM_FORMULA_CSL_ABSTRACTSTATEFORMULA_H_
#define STORM_FORMULA_CSL_ABSTRACTSTATEFORMULA_H_
#include "src/formula/csl/AbstractCslFormula.h"
#include "src/properties/csl/AbstractCslFormula.h"
#include "src/storage/BitVector.h"
#include "src/modelchecker/csl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
/*!
* Abstract base class for Csl state formulas.
*/
template <class T>
class AbstractStateFormula : public storm::property::csl::AbstractCslFormula<T> {
class AbstractStateFormula : public storm::properties::csl::AbstractCslFormula<T> {
public:
@ -57,7 +57,7 @@ public:
};
} //namespace csl
} //namespace property
} //namespace properties
} //namespace storm

6
src/formula/csl/And.h → src/properties/csl/And.h

@ -8,12 +8,12 @@
#ifndef STORM_FORMULA_CSL_AND_H_
#define STORM_FORMULA_CSL_AND_H_
#include "src/formula/csl/AbstractStateFormula.h"
#include "src/properties/csl/AbstractStateFormula.h"
#include "src/modelchecker/csl/ForwardDeclarations.h"
#include <string>
namespace storm {
namespace property {
namespace properties {
namespace csl {
// Forward declaration for the interface class.
@ -209,7 +209,7 @@ private:
} //namespace csl
} //namespace property
} //namespace properties
} //namespace storm

6
src/formula/csl/Ap.h → src/properties/csl/Ap.h

@ -8,11 +8,11 @@
#ifndef STORM_FORMULA_CSL_AP_H_
#define STORM_FORMULA_CSL_AP_H_
#include "src/formula/csl/AbstractStateFormula.h"
#include "src/properties/csl/AbstractStateFormula.h"
#include "src/modelchecker/csl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
// Forward declaration for the interface class.
@ -134,7 +134,7 @@ private:
} //namespace abstract
} //namespace property
} //namespace properties
} //namespace storm

18
src/formula/csl/CslFilter.h → src/properties/csl/CslFilter.h

@ -8,16 +8,16 @@
#ifndef STORM_FORMULA_PRCTL_CSLFILTER_H_
#define STORM_FORMULA_PRCTL_CSLFILTER_H_
#include "src/formula/AbstractFilter.h"
#include "src/formula/csl/AbstractCslFormula.h"
#include "src/formula/csl/AbstractPathFormula.h"
#include "src/formula/csl/AbstractStateFormula.h"
#include "src/properties/AbstractFilter.h"
#include "src/properties/csl/AbstractCslFormula.h"
#include "src/properties/csl/AbstractPathFormula.h"
#include "src/properties/csl/AbstractStateFormula.h"
#include "src/modelchecker/csl/AbstractModelChecker.h"
#include "src/formula/actions/AbstractAction.h"
#include "src/properties/actions/AbstractAction.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
/*!
@ -27,10 +27,10 @@ namespace csl {
* Additionally it maintains a list of filter actions that are used to further manipulate the modelchecking results and prepare them for output.
*/
template <class T>
class CslFilter : public storm::property::AbstractFilter<T> {
class CslFilter : public storm::properties::AbstractFilter<T> {
// Convenience typedef to make the code more readable.
typedef typename storm::property::action::AbstractAction<T>::Result Result;
typedef typename storm::properties::action::AbstractAction<T>::Result Result;
public:
@ -408,7 +408,7 @@ private:
};
} //namespace csl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_CSL_CSLFILTER_H_ */

8
src/formula/csl/Eventually.h → src/properties/csl/Eventually.h

@ -8,12 +8,12 @@
#ifndef STORM_FORMULA_CSL_EVENTUALLY_H_
#define STORM_FORMULA_CSL_EVENTUALLY_H_
#include "src/formula/csl/AbstractPathFormula.h"
#include "src/formula/csl/AbstractStateFormula.h"
#include "src/properties/csl/AbstractPathFormula.h"
#include "src/properties/csl/AbstractStateFormula.h"
#include "src/modelchecker/csl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
// Forward declaration for the interface class.
@ -164,7 +164,7 @@ private:
};
} //namespace csl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_CSL_EVENTUALLY_H_ */

8
src/formula/csl/Globally.h → src/properties/csl/Globally.h

@ -8,12 +8,12 @@
#ifndef STORM_FORMULA_CSL_GLOBALLY_H_
#define STORM_FORMULA_CSL_GLOBALLY_H_
#include "src/formula/csl/AbstractPathFormula.h"
#include "src/formula/csl/AbstractStateFormula.h"
#include "src/properties/csl/AbstractPathFormula.h"
#include "src/properties/csl/AbstractStateFormula.h"
#include "src/modelchecker/csl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
// Forward declaration for the interface class.
@ -163,7 +163,7 @@ private:
};
} //namespace csl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_CSL_GLOBALLY_H_ */

8
src/formula/csl/Next.h → src/properties/csl/Next.h

@ -8,11 +8,11 @@
#ifndef STORM_FORMULA_CSL_NEXT_H_
#define STORM_FORMULA_CSL_NEXT_H_
#include "src/formula/csl/AbstractPathFormula.h"
#include "src/formula/csl/AbstractStateFormula.h"
#include "src/properties/csl/AbstractPathFormula.h"
#include "src/properties/csl/AbstractStateFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
// Forward declaration for the interface class.
@ -162,7 +162,7 @@ private:
};
} //namespace csl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_CSL_NEXT_H_ */

6
src/formula/csl/Not.h → src/properties/csl/Not.h

@ -8,11 +8,11 @@
#ifndef STORM_FORMULA_CSL_NOT_H_
#define STORM_FORMULA_CSL_NOT_H_
#include "src/formula/csl/AbstractStateFormula.h"
#include "src/properties/csl/AbstractStateFormula.h"
#include "src/modelchecker/csl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
// Forward declaration for the interface class.
@ -166,7 +166,7 @@ private:
};
} //namespace csl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_CSL_NOT_H_ */

6
src/formula/csl/Or.h → src/properties/csl/Or.h

@ -8,10 +8,10 @@
#ifndef STORM_FORMULA_CSL_OR_H_
#define STORM_FORMULA_CSL_OR_H_
#include "src/formula/csl/AbstractStateFormula.h"
#include "src/properties/csl/AbstractStateFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
// Forward declaration for the interface class.
@ -206,7 +206,7 @@ private:
};
} //namespace csl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_CSL_OR_H_ */

18
src/formula/csl/ProbabilisticBoundOperator.h → src/properties/csl/ProbabilisticBoundOperator.h

@ -8,13 +8,13 @@
#ifndef STORM_FORMULA_CSL_PROBABILISTICBOUNDOPERATOR_H_
#define STORM_FORMULA_CSL_PROBABILISTICBOUNDOPERATOR_H_
#include "src/formula/csl/AbstractStateFormula.h"
#include "src/formula/csl/AbstractPathFormula.h"
#include "src/formula/ComparisonType.h"
#include "src/properties/csl/AbstractStateFormula.h"
#include "src/properties/csl/AbstractPathFormula.h"
#include "src/properties/ComparisonType.h"
#include "utility/constants.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
// Forward declaration for the interface class.
@ -82,7 +82,7 @@ public:
* @param bound The bound for the probability.
* @param child The child formula subtree.
*/
ProbabilisticBoundOperator(storm::property::ComparisonType comparisonOperator, T bound, std::shared_ptr<AbstractPathFormula<T>> const & child)
ProbabilisticBoundOperator(storm::properties::ComparisonType comparisonOperator, T bound, std::shared_ptr<AbstractPathFormula<T>> const & child)
: comparisonOperator(comparisonOperator), bound(bound), child(child) {
// Intentionally left empty.
}
@ -175,7 +175,7 @@ public:
*
* @returns An enum value representing the comparison relation.
*/
storm::property::ComparisonType const getComparisonOperator() const {
storm::properties::ComparisonType const getComparisonOperator() const {
return comparisonOperator;
}
@ -184,7 +184,7 @@ public:
*
* @param comparisonOperator An enum value representing the new comparison relation.
*/
void setComparisonOperator(storm::property::ComparisonType comparisonOperator) {
void setComparisonOperator(storm::properties::ComparisonType comparisonOperator) {
this->comparisonOperator = comparisonOperator;
}
@ -225,7 +225,7 @@ public:
private:
// The operator used to indicate the kind of bound that is to be met.
storm::property::ComparisonType comparisonOperator;
storm::properties::ComparisonType comparisonOperator;
// The probability bound.
T bound;
@ -235,7 +235,7 @@ private:
};
} //namespace csl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_CSL_PROBABILISTICBOUNDOPERATOR_H_ */

8
src/formula/csl/SteadyStateBoundOperator.h → src/properties/csl/SteadyStateBoundOperator.h

@ -9,10 +9,10 @@
#define STORM_FORMULA_CSL_STEADYSTATEOPERATOR_H_
#include "AbstractStateFormula.h"
#include "src/formula/ComparisonType.h"
#include "src/properties/ComparisonType.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
// Forward declaration for the interface class.
@ -78,7 +78,7 @@ public:
* @param bound The bound for the probability.
* @param child The child formula subtree.
*/
SteadyStateBoundOperator(storm::property::ComparisonType comparisonOperator, T bound, std::shared_ptr<AbstractStateFormula<T>> const & child)
SteadyStateBoundOperator(storm::properties::ComparisonType comparisonOperator, T bound, std::shared_ptr<AbstractStateFormula<T>> const & child)
: comparisonOperator(comparisonOperator), bound(bound), child(child) {
// Intentionally left empty
}
@ -228,7 +228,7 @@ private:
};
} //namespace csl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_CSL_STEADYSTATEOPERATOR_H_ */

13
src/formula/csl/TimeBoundedEventually.h → src/properties/csl/TimeBoundedEventually.h

@ -8,11 +8,11 @@
#ifndef STORM_FORMULA_CSL_TIMEBOUNDEDEVENTUALLY_H_
#define STORM_FORMULA_CSL_TIMEBOUNDEDEVENTUALLY_H_
#include "src/formula/csl/AbstractPathFormula.h"
#include "src/formula/csl/AbstractStateFormula.h"
#include "src/properties/csl/AbstractPathFormula.h"
#include "src/properties/csl/AbstractStateFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
// Forward declaration for the interface class.
@ -68,7 +68,7 @@ public:
* Creates a TimeBoundedEventually node without a subnode.
* The resulting object will not represent a complete formula!
*/
TimeBoundedEventually() : lowerBound(0), upperBound(0), child(nullptr) {
TimeBoundedEventually() : child(nullptr), lowerBound(0), upperBound(0) {
// Intentionally left empty.
}
@ -98,7 +98,8 @@ public:
* @returns A new TimeBoundedEventually object that is a deep copy of the called object.
*/
virtual std::shared_ptr<AbstractPathFormula<T>> clone() const override {
std::shared_ptr<TimeBoundedEventually<T>> result(new TimeBoundedEventually<T>(lowerBound, upperBound));
auto result = std::make_shared<TimeBoundedEventually<T>>();
result->setInterval(lowerBound, upperBound);
if (this->isChildSet()) {
result->setChild(child->clone());
}
@ -212,7 +213,7 @@ private:
};
} /* namespace csl */
} /* namespace property */
} /* namespace properties */
} /* namespace storm */
#endif /* STORM_FORMULA_CSL_TIMEBOUNDEDEVENTUALLY_H_ */

15
src/formula/csl/TimeBoundedUntil.h → src/properties/csl/TimeBoundedUntil.h

@ -8,11 +8,11 @@
#ifndef STORM_FORMULA_CSL_TIMEBOUNDEDUNTIL_H_
#define STORM_FORMULA_CSL_TIMEBOUNDEDUNTIL_H_
#include "src/formula/csl/AbstractPathFormula.h"
#include "src/formula/csl/AbstractStateFormula.h"
#include "src/properties/csl/AbstractPathFormula.h"
#include "src/properties/csl/AbstractStateFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
// Forward declaration for the interface class.
@ -70,8 +70,8 @@ public:
* Creates a TimeBoundedUntil node without a subnode.
* The resulting object will not represent a complete formula!
*/
TimeBoundedUntil() : lowerBound(0), upperBound(0), left(nullptr), right(nullptr) {
setInterval(lowerBound, upperBound);
TimeBoundedUntil() : left(nullptr), right(nullptr), lowerBound(0), upperBound(0) {
// Intentionally left empty.
}
/*!
@ -100,7 +100,8 @@ public:
* @returns A new TimeBoundedUntil object that is a deep copy of the called object.
*/
virtual std::shared_ptr<AbstractPathFormula<T>> clone() const override {
std::shared_ptr<TimeBoundedUntil<T>> result(new TimeBoundedUntil<T>(lowerBound, upperBound));
auto result = std::make_shared<TimeBoundedUntil<T>>();
result->setInterval(lowerBound, upperBound);
if (this->isLeftSet()) {
result->setLeft(left->clone());
}
@ -249,7 +250,7 @@ private:
};
} /* namespace csl */
} /* namespace property */
} /* namespace properties */
} /* namespace storm */
#endif /* STORM_FORMULA_CSL_TIMEBOUNDEDUNTIL_H_ */

8
src/formula/csl/Until.h → src/properties/csl/Until.h

@ -8,11 +8,11 @@
#ifndef STORM_FORMULA_CSL_UNTIL_H_
#define STORM_FORMULA_CSL_UNTIL_H_
#include "src/formula/csl/AbstractPathFormula.h"
#include "src/formula/csl/AbstractStateFormula.h"
#include "src/properties/csl/AbstractPathFormula.h"
#include "src/properties/csl/AbstractStateFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace csl {
// Forward declaration for the interface class.
@ -199,7 +199,7 @@ private:
};
} //namespace csl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_CSL_UNTIL_H_ */

8
src/formula/ltl/AbstractLtlFormula.h → src/properties/ltl/AbstractLtlFormula.h

@ -10,10 +10,10 @@
#include <vector>
#include "src/modelchecker/ltl/ForwardDeclarations.h"
#include "src/formula/AbstractFormula.h"
#include "src/properties/AbstractFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace ltl {
/*!
@ -25,7 +25,7 @@ namespace ltl {
* the original and the copy.
*/
template <class T>
class AbstractLtlFormula : public virtual storm::property::AbstractFormula<T> {
class AbstractLtlFormula : public virtual storm::properties::AbstractFormula<T> {
public:
/*!
@ -59,6 +59,6 @@ public:
};
} /* namespace ltl */
} /* namespace property */
} /* namespace properties */
} /* namespace storm */
#endif /* STORM_LTL_ABSTRACTLTLFORMULA_H_ */

4
src/formula/ltl/And.h → src/properties/ltl/And.h

@ -13,7 +13,7 @@
#include <string>
namespace storm {
namespace property {
namespace properties {
namespace ltl {
// Forward declaration for the interface class.
@ -209,7 +209,7 @@ private:
} //namespace ltl
} //namespace property
} //namespace properties
} //namespace storm

6
src/formula/ltl/Ap.h → src/properties/ltl/Ap.h

@ -11,7 +11,7 @@
#include "AbstractLtlFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace ltl {
// Forward declaration for the interface class.
@ -51,7 +51,7 @@ class IApModelChecker {
* @see AbstractLtlFormula
*/
template <class T>
class Ap: public storm::property::ltl::AbstractLtlFormula<T> {
class Ap: public storm::properties::ltl::AbstractLtlFormula<T> {
public:
@ -131,6 +131,6 @@ private:
};
} /* namespace ltl */
} /* namespace property */
} /* namespace properties */
} /* namespace storm */
#endif /* STORM_FORMULA_LTL_AP_H_ */

4
src/formula/ltl/BoundedEventually.h → src/properties/ltl/BoundedEventually.h

@ -14,7 +14,7 @@
#include "src/modelchecker/ltl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace ltl {
// Forward declaration for the interface class.
@ -190,7 +190,7 @@ private:
};
} //namespace ltl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_LTL_BOUNDEDUNTIL_H_ */

6
src/formula/ltl/BoundedUntil.h → src/properties/ltl/BoundedUntil.h

@ -8,13 +8,13 @@
#ifndef STORM_FORMULA_LTL_BOUNDEDUNTIL_H_
#define STORM_FORMULA_LTL_BOUNDEDUNTIL_H_
#include "src/formula/ltl/AbstractLtlFormula.h"
#include "src/properties/ltl/AbstractLtlFormula.h"
#include <cstdint>
#include <string>
#include "src/modelchecker/ltl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace ltl {
// Forward declaration for the interface class.
@ -223,7 +223,7 @@ private:
};
} //namespace ltl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_LTL_BOUNDEDUNTIL_H_ */

6
src/formula/ltl/Eventually.h → src/properties/ltl/Eventually.h

@ -8,11 +8,11 @@
#ifndef STORM_FORMULA_LTL_EVENTUALLY_H_
#define STORM_FORMULA_LTL_EVENTUALLY_H_
#include "src/formula/ltl/AbstractLtlFormula.h"
#include "src/properties/ltl/AbstractLtlFormula.h"
#include "src/modelchecker/ltl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace ltl {
// Forward declaration for the interface class.
@ -159,7 +159,7 @@ private:
};
} //namespace ltl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_LTL_EVENTUALLY_H_ */

4
src/formula/ltl/Globally.h → src/properties/ltl/Globally.h

@ -12,7 +12,7 @@
#include "src/modelchecker/ltl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace ltl {
// Forward declaration for the interface class.
@ -159,7 +159,7 @@ private:
};
} //namespace ltl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_LTL_GLOBALLY_H_ */

14
src/formula/ltl/LtlFilter.h → src/properties/ltl/LtlFilter.h

@ -8,14 +8,14 @@
#ifndef STORM_FORMULA_LTL_LTLFILTER_H_
#define STORM_FORMULA_LTL_LTLFILTER_H_
#include "src/formula/AbstractFilter.h"
#include "src/properties/AbstractFilter.h"
#include "src/modelchecker/ltl/AbstractModelChecker.h"
#include "src/formula/ltl/AbstractLtlFormula.h"
#include "src/formula/actions/AbstractAction.h"
#include "src/properties/ltl/AbstractLtlFormula.h"
#include "src/properties/actions/AbstractAction.h"
#include "src/exceptions/NotImplementedException.h"
namespace storm {
namespace property {
namespace properties {
namespace ltl {
/*!
@ -25,10 +25,10 @@ namespace ltl {
* Additionally it maintains a list of filter actions that are used to further manipulate the modelchecking results and prepare them for output.
*/
template <class T>
class LtlFilter : public storm::property::AbstractFilter<T> {
class LtlFilter : public storm::properties::AbstractFilter<T> {
// Convenience typedef to make the code more readable.
typedef typename storm::property::action::AbstractAction<T>::Result Result;
typedef typename storm::properties::action::AbstractAction<T>::Result Result;
public:
@ -275,7 +275,7 @@ private:
} //namespace ltl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_LTL_LTLFILTER_H_ */

4
src/formula/ltl/Next.h → src/properties/ltl/Next.h

@ -11,7 +11,7 @@
#include "AbstractLtlFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace ltl {
// Forward declaration for the interface class.
@ -158,7 +158,7 @@ private:
};
} //namespace ltl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_LTL_NEXT_H_ */

4
src/formula/ltl/Not.h → src/properties/ltl/Not.h

@ -11,7 +11,7 @@
#include "AbstractLtlFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace ltl {
// Forward declaration for the interface class.
@ -165,7 +165,7 @@ private:
};
} //namespace ltl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_LTL_NOT_H_ */

6
src/formula/ltl/Or.h → src/properties/ltl/Or.h

@ -11,7 +11,7 @@
#include "AbstractLtlFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace ltl {
// Forward declaration for the interface class.
@ -57,7 +57,7 @@ class IOrModelChecker {
* @see AbstractLtlFormula
*/
template <class T>
class Or: public storm::property::ltl::AbstractLtlFormula<T> {
class Or: public storm::properties::ltl::AbstractLtlFormula<T> {
public:
@ -205,6 +205,6 @@ private:
};
} /* namespace ltl */
} /* namespace property */
} /* namespace properties */
} /* namespace storm */
#endif /* OR_H_ */

4
src/formula/ltl/Until.h → src/properties/ltl/Until.h

@ -11,7 +11,7 @@
#include "AbstractLtlFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace ltl {
// Forward declaration for the interface class.
@ -194,7 +194,7 @@ private:
};
} //namespace ltl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_LTL_UNTIL_H_ */

8
src/formula/prctl/AbstractPathFormula.h → src/properties/prctl/AbstractPathFormula.h

@ -8,7 +8,7 @@
#ifndef STORM_FORMULA_PRCTL_ABSTRACTPATHFORMULA_H_
#define STORM_FORMULA_PRCTL_ABSTRACTPATHFORMULA_H_
#include "src/formula/prctl/AbstractPrctlFormula.h"
#include "src/properties/prctl/AbstractPrctlFormula.h"
#include "src/modelchecker/prctl/ForwardDeclarations.h"
#include <vector>
@ -16,7 +16,7 @@
#include <typeinfo>
namespace storm {
namespace property {
namespace properties {
namespace prctl {
/*!
@ -26,7 +26,7 @@ namespace prctl {
* The result of a modelchecking process on such a formula is a vector representing the satisfaction probabilities for each state of the model.
*/
template <class T>
class AbstractPathFormula : public virtual storm::property::prctl::AbstractPrctlFormula<T> {
class AbstractPathFormula : public virtual storm::properties::prctl::AbstractPrctlFormula<T> {
public:
@ -63,7 +63,7 @@ public:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_ABSTRACTPATHFORMULA_H_ */

22
src/formula/prctl/AbstractPrctlFormula.h → src/properties/prctl/AbstractPrctlFormula.h

@ -8,10 +8,10 @@
#ifndef STORM_FORMULA_PRCTL_ABSTRACTPRCTLFORMULA_H_
#define STORM_FORMULA_PRCTL_ABSTRACTPRCTLFORMULA_H_
#include "src/formula/AbstractFormula.h"
#include "src/properties/AbstractFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declarations.
@ -25,7 +25,7 @@ template <class T> class Until;
}
namespace storm {
namespace property {
namespace properties {
namespace prctl {
/*!
@ -37,7 +37,7 @@ namespace prctl {
* the original and the copy.
*/
template<class T>
class AbstractPrctlFormula : public virtual storm::property::AbstractFormula<T> {
class AbstractPrctlFormula : public virtual storm::properties::AbstractFormula<T> {
public:
/*!
@ -59,23 +59,23 @@ public:
bool isProbEventuallyAP() const {
// Test if a probabilistic bound operator is at the root.
if(dynamic_cast<storm::property::prctl::ProbabilisticBoundOperator<T> const *>(this) == nullptr) {
if(dynamic_cast<storm::properties::prctl::ProbabilisticBoundOperator<T> const *>(this) == nullptr) {
return false;
}
auto probFormula = dynamic_cast<storm::property::prctl::ProbabilisticBoundOperator<T> const *>(this);
auto probFormula = dynamic_cast<storm::properties::prctl::ProbabilisticBoundOperator<T> const *>(this);
// Check if the direct subformula of the probabilistic bound operator is an eventually or until formula.
if(std::dynamic_pointer_cast<storm::property::prctl::Eventually<T>>(probFormula->getChild()).get() != nullptr) {
if(std::dynamic_pointer_cast<storm::properties::prctl::Eventually<T>>(probFormula->getChild()).get() != nullptr) {
// Get the subformula and check if its subformulas are propositional.
auto eventuallyFormula = std::dynamic_pointer_cast<storm::property::prctl::Eventually<T>>(probFormula->getChild());
auto eventuallyFormula = std::dynamic_pointer_cast<storm::properties::prctl::Eventually<T>>(probFormula->getChild());
return eventuallyFormula->getChild()->isPropositional();
}
else if(std::dynamic_pointer_cast<storm::property::prctl::Until<T>>(probFormula->getChild()).get() != nullptr) {
else if(std::dynamic_pointer_cast<storm::properties::prctl::Until<T>>(probFormula->getChild()).get() != nullptr) {
// Get the subformula and check if its subformulas are propositional.
auto untilFormula = std::dynamic_pointer_cast<storm::property::prctl::Until<T>>(probFormula->getChild());
auto untilFormula = std::dynamic_pointer_cast<storm::properties::prctl::Until<T>>(probFormula->getChild());
return untilFormula->getLeft()->isPropositional() && untilFormula->getRight()->isPropositional();
}
@ -84,6 +84,6 @@ public:
};
} /* namespace prctl */
} /* namespace property */
} /* namespace properties */
} /* namespace storm */
#endif /* ABSTRACTPRCTLFORMULA_H_ */

8
src/formula/prctl/AbstractRewardPathFormula.h → src/properties/prctl/AbstractRewardPathFormula.h

@ -8,10 +8,10 @@
#ifndef STORM_FORMULA_PRCTL_ABSTRACTREWARDPATHFORMULA_H_
#define STORM_FORMULA_PRCTL_ABSTRACTREWARDPATHFORMULA_H_
#include "src/formula/prctl/AbstractPrctlFormula.h"
#include "src/properties/prctl/AbstractPrctlFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
/*!
@ -25,7 +25,7 @@ namespace prctl {
* @see AbstractPrctlFormula
*/
template <class T>
class AbstractRewardPathFormula : public virtual storm::property::prctl::AbstractPrctlFormula<T> {
class AbstractRewardPathFormula : public virtual storm::properties::prctl::AbstractPrctlFormula<T> {
public:
@ -62,7 +62,7 @@ public:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm

8
src/formula/prctl/AbstractStateFormula.h → src/properties/prctl/AbstractStateFormula.h

@ -8,19 +8,19 @@
#ifndef STORM_FORMULA_PRCTL_ABSTRACTSTATEFORMULA_H_
#define STORM_FORMULA_PRCTL_ABSTRACTSTATEFORMULA_H_
#include "src/formula/prctl/AbstractPrctlFormula.h"
#include "src/properties/prctl/AbstractPrctlFormula.h"
#include "src/storage/BitVector.h"
#include "src/modelchecker/prctl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
/*!
* Abstract base class for Prctl state formulas.
*/
template <class T>
class AbstractStateFormula : public storm::property::prctl::AbstractPrctlFormula<T> {
class AbstractStateFormula : public storm::properties::prctl::AbstractPrctlFormula<T> {
public:
@ -57,7 +57,7 @@ public:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm

6
src/formula/prctl/And.h → src/properties/prctl/And.h

@ -8,12 +8,12 @@
#ifndef STORM_FORMULA_PRCTL_AND_H_
#define STORM_FORMULA_PRCTL_AND_H_
#include "src/formula/prctl/AbstractStateFormula.h"
#include "src/properties/prctl/AbstractStateFormula.h"
#include "src/modelchecker/prctl/ForwardDeclarations.h"
#include <string>
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -210,7 +210,7 @@ private:
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm

6
src/formula/prctl/Ap.h → src/properties/prctl/Ap.h

@ -8,11 +8,11 @@
#ifndef STORM_FORMULA_PRCTL_AP_H_
#define STORM_FORMULA_PRCTL_AP_H_
#include "src/formula/prctl/AbstractStateFormula.h"
#include "src/properties/prctl/AbstractStateFormula.h"
#include "src/modelchecker/prctl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -134,7 +134,7 @@ private:
} //namespace abstract
} //namespace property
} //namespace properties
} //namespace storm

8
src/formula/prctl/BoundedEventually.h → src/properties/prctl/BoundedEventually.h

@ -8,14 +8,14 @@
#ifndef STORM_FORMULA_PRCTL_BOUNDEDEVENTUALLY_H_
#define STORM_FORMULA_PRCTL_BOUNDEDEVENTUALLY_H_
#include "src/formula/prctl/AbstractPathFormula.h"
#include "src/formula/prctl/AbstractStateFormula.h"
#include "src/properties/prctl/AbstractPathFormula.h"
#include "src/properties/prctl/AbstractStateFormula.h"
#include <cstdint>
#include <string>
#include "src/modelchecker/prctl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl{
// Forward declaration for the interface class.
@ -191,7 +191,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_BOUNDEDUNTIL_H_ */

8
src/formula/prctl/BoundedNaryUntil.h → src/properties/prctl/BoundedNaryUntil.h

@ -8,8 +8,8 @@
#ifndef STORM_FORMULA_PRCTL_BOUNDEDNARYUNTIL_H_
#define STORM_FORMULA_PRCTL_BOUNDEDNARYUNTIL_H_
#include "src/formula/prctl/AbstractPathFormula.h"
#include "src/formula/prctl/AbstractStateFormula.h"
#include "src/properties/prctl/AbstractPathFormula.h"
#include "src/properties/prctl/AbstractStateFormula.h"
#include <cstdint>
#include <string>
#include <vector>
@ -18,7 +18,7 @@
#include "src/modelchecker/prctl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -226,7 +226,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_BOUNDEDNARYUNTIL_H_ */

8
src/formula/prctl/BoundedUntil.h → src/properties/prctl/BoundedUntil.h

@ -8,14 +8,14 @@
#ifndef STORM_FORMULA_PRCTL_BOUNDEDUNTIL_H_
#define STORM_FORMULA_PRCTL_BOUNDEDUNTIL_H_
#include "src/formula/prctl/AbstractPathFormula.h"
#include "src/formula/prctl/AbstractStateFormula.h"
#include "src/properties/prctl/AbstractPathFormula.h"
#include "src/properties/prctl/AbstractStateFormula.h"
#include <cstdint>
#include <string>
#include "src/modelchecker/prctl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -227,7 +227,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_BOUNDEDUNTIL_H_ */

4
src/formula/prctl/CumulativeReward.h → src/properties/prctl/CumulativeReward.h

@ -12,7 +12,7 @@
#include <string>
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -142,7 +142,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_INSTANTANEOUSREWARD_H_ */

8
src/formula/prctl/Eventually.h → src/properties/prctl/Eventually.h

@ -8,12 +8,12 @@
#ifndef STORM_FORMULA_PRCTL_EVENTUALLY_H_
#define STORM_FORMULA_PRCTL_EVENTUALLY_H_
#include "src/formula/prctl/AbstractPathFormula.h"
#include "src/formula/prctl/AbstractStateFormula.h"
#include "src/properties/prctl/AbstractPathFormula.h"
#include "src/properties/prctl/AbstractStateFormula.h"
#include "src/modelchecker/prctl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -163,7 +163,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_EVENTUALLY_H_ */

8
src/formula/prctl/Globally.h → src/properties/prctl/Globally.h

@ -8,12 +8,12 @@
#ifndef STORM_FORMULA_PRCTL_GLOBALLY_H_
#define STORM_FORMULA_PRCTL_GLOBALLY_H_
#include "src/formula/prctl/AbstractPathFormula.h"
#include "src/formula/prctl/AbstractStateFormula.h"
#include "src/properties/prctl/AbstractPathFormula.h"
#include "src/properties/prctl/AbstractStateFormula.h"
#include "src/modelchecker/prctl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -163,7 +163,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_GLOBALLY_H_ */

4
src/formula/prctl/InstantaneousReward.h → src/properties/prctl/InstantaneousReward.h

@ -13,7 +13,7 @@
#include <string>
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -143,7 +143,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_INSTANTANEOUSREWARD_H_ */

8
src/formula/prctl/Next.h → src/properties/prctl/Next.h

@ -8,11 +8,11 @@
#ifndef STORM_FORMULA_PRCTL_NEXT_H_
#define STORM_FORMULA_PRCTL_NEXT_H_
#include "src/formula/prctl/AbstractPathFormula.h"
#include "src/formula/prctl/AbstractStateFormula.h"
#include "src/properties/prctl/AbstractPathFormula.h"
#include "src/properties/prctl/AbstractStateFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -162,7 +162,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_NEXT_H_ */

4
src/formula/prctl/Not.h → src/properties/prctl/Not.h

@ -12,7 +12,7 @@
#include "src/modelchecker/prctl/ForwardDeclarations.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -167,7 +167,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_NOT_H_ */

6
src/formula/prctl/Or.h → src/properties/prctl/Or.h

@ -8,10 +8,10 @@
#ifndef STORM_FORMULA_PRCTL_OR_H_
#define STORM_FORMULA_PRCTL_OR_H_
#include "src/formula/prctl/AbstractStateFormula.h"
#include "src/properties/prctl/AbstractStateFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -207,7 +207,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_OR_H_ */

24
src/formula/prctl/PrctlFilter.h → src/properties/prctl/PrctlFilter.h

@ -8,18 +8,18 @@
#ifndef STORM_FORMULA_PRCTL_PRCTLFILTER_H_
#define STORM_FORMULA_PRCTL_PRCTLFILTER_H_
#include "src/formula/AbstractFilter.h"
#include "src/formula/prctl/AbstractPrctlFormula.h"
#include "src/formula/prctl/AbstractPathFormula.h"
#include "src/formula/prctl/AbstractStateFormula.h"
#include "src/properties/AbstractFilter.h"
#include "src/properties/prctl/AbstractPrctlFormula.h"
#include "src/properties/prctl/AbstractPathFormula.h"
#include "src/properties/prctl/AbstractStateFormula.h"
#include "src/modelchecker/prctl/AbstractModelChecker.h"
#include "src/formula/actions/AbstractAction.h"
#include "src/properties/actions/AbstractAction.h"
#include <algorithm>
#include <memory>
namespace storm {
namespace property {
namespace properties {
namespace prctl {
/*!
@ -29,10 +29,10 @@ namespace prctl {
* Additionally it maintains a list of filter actions that are used to further manipulate the modelchecking results and prepare them for output.
*/
template <class T>
class PrctlFilter : public storm::property::AbstractFilter<T> {
class PrctlFilter : public storm::properties::AbstractFilter<T> {
// Convenience typedef to make the code more readable.
typedef typename storm::property::action::AbstractAction<T>::Result Result;
typedef typename storm::properties::action::AbstractAction<T>::Result Result;
public:
@ -271,7 +271,7 @@ private:
if(this->opt != UNDEFINED) {
// If it is specified that min/max probabilities/rewards should be computed, call the appropriate method of the model checker.
result.stateResult = modelchecker.checkOptimizingOperator(*formula, this->opt == storm::property::MINIMIZE ? true : false);
result.stateResult = modelchecker.checkOptimizingOperator(*formula, this->opt == storm::properties::MINIMIZE ? true : false);
} else {
result.stateResult = formula->check(modelchecker);
}
@ -295,7 +295,7 @@ private:
if(this->opt != UNDEFINED) {
// If it is specified that min/max probabilities/rewards should be computed, call the appropriate method of the model checker.
result.pathResult = modelchecker.checkOptimizingOperator(*formula, this->opt == storm::property::MINIMIZE ? true : false);
result.pathResult = modelchecker.checkOptimizingOperator(*formula, this->opt == storm::properties::MINIMIZE ? true : false);
} else {
result.pathResult = formula->check(modelchecker, false);
}
@ -319,7 +319,7 @@ private:
if(this->opt != UNDEFINED) {
// If it is specified that min/max probabilities/rewards should be computed, call the appropriate method of the model checker.
result.pathResult = modelchecker.checkOptimizingOperator(*formula, this->opt == storm::property::MINIMIZE ? true : false);
result.pathResult = modelchecker.checkOptimizingOperator(*formula, this->opt == storm::properties::MINIMIZE ? true : false);
} else {
result.pathResult = formula->check(modelchecker, false);
}
@ -428,7 +428,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm

14
src/formula/prctl/ProbabilisticBoundOperator.h → src/properties/prctl/ProbabilisticBoundOperator.h

@ -11,10 +11,10 @@
#include "AbstractStateFormula.h"
#include "AbstractPathFormula.h"
#include "utility/constants.h"
#include "src/formula/ComparisonType.h"
#include "src/properties/ComparisonType.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -83,7 +83,7 @@ public:
* @param bound The bound for the probability.
* @param child The child formula subtree.
*/
ProbabilisticBoundOperator(storm::property::ComparisonType comparisonOperator, T bound, std::shared_ptr<AbstractPathFormula<T>> const & child)
ProbabilisticBoundOperator(storm::properties::ComparisonType comparisonOperator, T bound, std::shared_ptr<AbstractPathFormula<T>> const & child)
: comparisonOperator(comparisonOperator), bound(bound), child(child) {
// Intentionally left empty.
}
@ -176,7 +176,7 @@ public:
*
* @returns An enum value representing the comparison relation.
*/
storm::property::ComparisonType const getComparisonOperator() const {
storm::properties::ComparisonType const getComparisonOperator() const {
return comparisonOperator;
}
@ -185,7 +185,7 @@ public:
*
* @param comparisonOperator An enum value representing the new comparison relation.
*/
void setComparisonOperator(storm::property::ComparisonType comparisonOperator) {
void setComparisonOperator(storm::properties::ComparisonType comparisonOperator) {
this->comparisonOperator = comparisonOperator;
}
@ -226,7 +226,7 @@ public:
private:
// The operator used to indicate the kind of bound that is to be met.
storm::property::ComparisonType comparisonOperator;
storm::properties::ComparisonType comparisonOperator;
// The probability bound.
T bound;
@ -236,7 +236,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_PROBABILISTICBOUNDOPERATOR_H_ */

4
src/formula/prctl/ReachabilityReward.h → src/properties/prctl/ReachabilityReward.h

@ -12,7 +12,7 @@
#include "AbstractStateFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -164,7 +164,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_REACHABILITYREWARD_H_ */

14
src/formula/prctl/RewardBoundOperator.h → src/properties/prctl/RewardBoundOperator.h

@ -11,10 +11,10 @@
#include "AbstractRewardPathFormula.h"
#include "AbstractStateFormula.h"
#include "utility/constants.h"
#include "src/formula/ComparisonType.h"
#include "src/properties/ComparisonType.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -84,7 +84,7 @@ public:
* @param bound The bound for the rewards.
* @param child The child formula subtree.
*/
RewardBoundOperator(storm::property::ComparisonType comparisonOperator, T bound, std::shared_ptr<AbstractRewardPathFormula<T>> const & child)
RewardBoundOperator(storm::properties::ComparisonType comparisonOperator, T bound, std::shared_ptr<AbstractRewardPathFormula<T>> const & child)
: comparisonOperator(comparisonOperator), bound(bound), child(child) {
// Intentionally left empty
}
@ -177,7 +177,7 @@ public:
*
* @returns An enum value representing the comparison relation.
*/
storm::property::ComparisonType const getComparisonOperator() const {
storm::properties::ComparisonType const getComparisonOperator() const {
return comparisonOperator;
}
@ -186,7 +186,7 @@ public:
*
* @param comparisonOperator An enum value representing the new comparison relation.
*/
void setComparisonOperator(storm::property::ComparisonType comparisonOperator) {
void setComparisonOperator(storm::properties::ComparisonType comparisonOperator) {
this->comparisonOperator = comparisonOperator;
}
@ -227,7 +227,7 @@ public:
private:
// The operator used to indicate the kind of bound that is to be met.
storm::property::ComparisonType comparisonOperator;
storm::properties::ComparisonType comparisonOperator;
// The reward bound.
T bound;
@ -237,7 +237,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_REWARDBOUNDOPERATOR_H_ */

4
src/formula/prctl/SteadyStateReward.h → src/properties/prctl/SteadyStateReward.h

@ -12,7 +12,7 @@
#include <string>
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -109,6 +109,6 @@ public:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_STEADYSTATEREWARD_H_ */

4
src/formula/prctl/Until.h → src/properties/prctl/Until.h

@ -12,7 +12,7 @@
#include "AbstractStateFormula.h"
namespace storm {
namespace property {
namespace properties {
namespace prctl {
// Forward declaration for the interface class.
@ -199,7 +199,7 @@ private:
};
} //namespace prctl
} //namespace property
} //namespace properties
} //namespace storm
#endif /* STORM_FORMULA_PRCTL_UNTIL_H_ */

12
src/storm.cpp

@ -40,7 +40,7 @@
#include "src/parser/MarkovAutomatonParser.h"
#include "src/parser/PrctlParser.h"
#include "src/utility/ErrorHandling.h"
#include "src/formula/Prctl.h"
#include "src/properties/Prctl.h"
#include "src/utility/vector.h"
#include "src/settings/Settings.h"
@ -285,7 +285,7 @@ void checkPrctlFormulae(storm::modelchecker::prctl::AbstractModelChecker<double>
if (s->isSet("prctl")) {
std::string const chosenPrctlFile = s->getOptionByLongName("prctl").getArgument(0).getValueAsString();
LOG4CPLUS_INFO(logger, "Parsing prctl file: " << chosenPrctlFile << ".");
std::list<std::shared_ptr<storm::property::prctl::PrctlFilter<double>>> formulaList = storm::parser::PrctlFileParser::parsePrctlFile(chosenPrctlFile);
std::list<std::shared_ptr<storm::properties::prctl::PrctlFilter<double>>> formulaList = storm::parser::PrctlFileParser::parsePrctlFile(chosenPrctlFile);
for (auto formula : formulaList) {
formula->check(modelchecker);
@ -338,7 +338,7 @@ void checkPrctlFormulae(storm::modelchecker::prctl::AbstractModelChecker<double>
std::string const chosenPrctlFile = s->getOptionByLongName("prctl").getArgument(0).getValueAsString();
LOG4CPLUS_INFO(logger, "Parsing prctl file: " << chosenPrctlFile << ".");
std::list<std::shared_ptr<storm::property::prctl::PrctlFilter<double>>> formulaList = storm::parser::PrctlFileParser::parsePrctlFile(chosenPrctlFile);
std::list<std::shared_ptr<storm::properties::prctl::PrctlFilter<double>>> formulaList = storm::parser::PrctlFileParser::parsePrctlFile(chosenPrctlFile);
// Test for each formula if a counterexample can be generated for it.
if(formulaList.size() == 0) {
@ -368,12 +368,12 @@ void checkPrctlFormulae(storm::modelchecker::prctl::AbstractModelChecker<double>
for (auto formula : formulaList) {
// First check if it is a formula type for which a counterexample can be generated.
if (std::dynamic_pointer_cast<storm::property::prctl::AbstractStateFormula<double>>(formula->getChild()).get() == nullptr) {
if (std::dynamic_pointer_cast<storm::properties::prctl::AbstractStateFormula<double>>(formula->getChild()).get() == nullptr) {
LOG4CPLUS_ERROR(logger, "Unexpected kind of formula. Expected a state formula.");
continue;
}
std::shared_ptr<storm::property::prctl::AbstractStateFormula<double>> stateForm = std::static_pointer_cast<storm::property::prctl::AbstractStateFormula<double>>(formula->getChild());
std::shared_ptr<storm::properties::prctl::AbstractStateFormula<double>> stateForm = std::static_pointer_cast<storm::properties::prctl::AbstractStateFormula<double>>(formula->getChild());
// Do some output
std::cout << "Generating counterexample for formula " << fIndex << ":" << std::endl;
@ -548,7 +548,7 @@ int main(const int argc, const char* argv[]) {
// Now parse the property file and receive the list of parsed formulas.
std::string const& propertyFile = s->getOptionByLongName("mincmd").getArgumentByName("propertyFile").getValueAsString();
std::list<std::shared_ptr<storm::property::prctl::PrctlFilter<double>>> formulaList = storm::parser::PrctlFileParser::parsePrctlFile(propertyFile);
std::list<std::shared_ptr<storm::properties::prctl::PrctlFilter<double>>> formulaList = storm::parser::PrctlFileParser::parsePrctlFile(propertyFile);
// Now generate the counterexamples for each formula.
for (auto formulaPtr : formulaList) {

102
test/functional/modelchecker/ActionTest.cpp

@ -8,11 +8,11 @@
#include "gtest/gtest.h"
#include "storm-config.h"
#include "src/formula/actions/BoundAction.h"
#include "src/formula/actions/FormulaAction.h"
#include "src/formula/actions/InvertAction.h"
#include "src/formula/actions/RangeAction.h"
#include "src/formula/actions/SortAction.h"
#include "src/properties/actions/BoundAction.h"
#include "src/properties/actions/FormulaAction.h"
#include "src/properties/actions/InvertAction.h"
#include "src/properties/actions/RangeAction.h"
#include "src/properties/actions/SortAction.h"
#include "src/parser/MarkovAutomatonParser.h"
#include "src/parser/DeterministicModelParser.h"
@ -21,7 +21,7 @@
#include "src/solver/GmmxxLinearEquationSolver.h"
#include "src/exceptions/InvalidArgumentException.h"
typedef typename storm::property::action::AbstractAction<double>::Result Result;
typedef typename storm::properties::action::AbstractAction<double>::Result Result;
TEST(ActionTest, BoundActionFunctionality) {
@ -31,7 +31,7 @@ TEST(ActionTest, BoundActionFunctionality) {
// Build the filter input.
// Basically the modelchecking result of "F a" on the used DTMC.
std::vector<double> pathResult = mc.checkEventually(storm::property::prctl::Eventually<double>(std::make_shared<storm::property::prctl::Ap<double>>("a")), false);
std::vector<double> pathResult = mc.checkEventually(storm::properties::prctl::Eventually<double>(std::make_shared<storm::properties::prctl::Ap<double>>("a")), false);
std::vector<uint_fast64_t> stateMap(pathResult.size());
for(uint_fast64_t i = 0; i < pathResult.size(); i++) {
stateMap[i] = i;
@ -40,7 +40,7 @@ TEST(ActionTest, BoundActionFunctionality) {
// Test the action.
// First test that the boundAction build by the empty constructor does not change the selection.
storm::property::action::BoundAction<double> action;
storm::properties::action::BoundAction<double> action;
Result result = action.evaluate(input, mc);
for(auto value : result.selection) {
@ -48,7 +48,7 @@ TEST(ActionTest, BoundActionFunctionality) {
}
// Test that using a strict bound can give different results than using a non-strict bound.
action = storm::property::action::BoundAction<double>(storm::property::GREATER, 0);
action = storm::properties::action::BoundAction<double>(storm::properties::GREATER, 0);
result = action.evaluate(input, mc);
for(uint_fast64_t i = 0; i < result.selection.size()-2; i++) {
@ -58,7 +58,7 @@ TEST(ActionTest, BoundActionFunctionality) {
ASSERT_FALSE(result.selection[7]);
// Test whether the filter actually uses the selection given by the input.
action = storm::property::action::BoundAction<double>(storm::property::LESS, 0.5);
action = storm::properties::action::BoundAction<double>(storm::properties::LESS, 0.5);
result = action.evaluate(result, mc);
ASSERT_FALSE(result.selection[0]);
@ -71,7 +71,7 @@ TEST(ActionTest, BoundActionFunctionality) {
stateMap[i] = pathResult.size() - i - 1;
}
action = storm::property::action::BoundAction<double>(storm::property::GREATER, 0);
action = storm::properties::action::BoundAction<double>(storm::properties::GREATER, 0);
result = action.evaluate(input, mc);
for(uint_fast64_t i = 0; i < result.selection.size()-2; i++) {
@ -82,8 +82,8 @@ TEST(ActionTest, BoundActionFunctionality) {
// Test the functionality for state formulas instead.
input.pathResult = std::vector<double>();
input.stateResult = mc.checkAp(storm::property::prctl::Ap<double>("a"));
action = storm::property::action::BoundAction<double>(storm::property::GREATER, 0.5);
input.stateResult = mc.checkAp(storm::properties::prctl::Ap<double>("a"));
action = storm::properties::action::BoundAction<double>(storm::properties::GREATER, 0.5);
result = action.evaluate(input, mc);
for(uint_fast64_t i = 0; i < result.selection.size(); i++) {
@ -116,8 +116,8 @@ TEST(ActionTest, BoundActionSafety) {
// Build the filter input.
// Basically the modelchecking result of "F a" on the used DTMC.
std::vector<double> pathResult = mc.checkEventually(storm::property::prctl::Eventually<double>(std::make_shared<storm::property::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::property::prctl::Ap<double>("a"));
std::vector<double> pathResult = mc.checkEventually(storm::properties::prctl::Eventually<double>(std::make_shared<storm::properties::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::properties::prctl::Ap<double>("a"));
std::vector<uint_fast64_t> stateMap(pathResult.size());
for(uint_fast64_t i = 0; i < pathResult.size(); i++) {
stateMap[i] = i;
@ -125,30 +125,30 @@ TEST(ActionTest, BoundActionSafety) {
Result input(storm::storage::BitVector(pathResult.size(), true), stateMap, pathResult, storm::storage::BitVector());
// First, test unusual bounds.
storm::property::action::BoundAction<double> action(storm::property::LESS, -2044);
storm::properties::action::BoundAction<double> action(storm::properties::LESS, -2044);
Result result;
ASSERT_NO_THROW(result = action.evaluate(input, mc));
ASSERT_EQ(0, result.selection.getNumberOfSetBits());
action = storm::property::action::BoundAction<double>(storm::property::GREATER_EQUAL, 5879);
action = storm::properties::action::BoundAction<double>(storm::properties::GREATER_EQUAL, 5879);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
ASSERT_EQ(0, result.selection.getNumberOfSetBits());
action = storm::property::action::BoundAction<double>(storm::property::LESS_EQUAL, 5879);
action = storm::properties::action::BoundAction<double>(storm::properties::LESS_EQUAL, 5879);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
ASSERT_EQ(result.selection.size(), result.selection.getNumberOfSetBits());
// Now, check the behavior under a undefined comparison type.
action = storm::property::action::BoundAction<double>(static_cast<storm::property::ComparisonType>(10), 5879);
action = storm::properties::action::BoundAction<double>(static_cast<storm::properties::ComparisonType>(10), 5879);
ASSERT_THROW(action.toString(), storm::exceptions::InvalidArgumentException);
ASSERT_THROW(action.evaluate(input, mc), storm::exceptions::InvalidArgumentException);
// Test for a result input with both results filled.
// It should put out a warning and use the pathResult.
action = storm::property::action::BoundAction<double>(storm::property::GREATER_EQUAL, 0.5);
action = storm::properties::action::BoundAction<double>(storm::properties::GREATER_EQUAL, 0.5);
input.stateResult = stateResult;
// To capture the warning, redirect cout and test the written buffer content.
@ -177,8 +177,8 @@ TEST(ActionTest, FormulaActionFunctionality) {
// Build the filter input.
// Basically the modelchecking result of "F a" on the used DTMC.
std::vector<double> pathResult = mc.checkEventually(storm::property::prctl::Eventually<double>(std::make_shared<storm::property::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::property::prctl::Ap<double>("c"));
std::vector<double> pathResult = mc.checkEventually(storm::properties::prctl::Eventually<double>(std::make_shared<storm::properties::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::properties::prctl::Ap<double>("c"));
std::vector<uint_fast64_t> stateMap(pathResult.size());
for(uint_fast64_t i = 0; i < pathResult.size(); i++) {
stateMap[i] = i;
@ -188,7 +188,7 @@ TEST(ActionTest, FormulaActionFunctionality) {
// Test the action.
// First test that the empty action does no change to the input.
storm::property::action::FormulaAction<double> action;
storm::properties::action::FormulaAction<double> action;
input.selection.set(0,false);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
for(uint_fast64_t i = 0; i < pathResult.size(); i++) {
@ -204,7 +204,7 @@ TEST(ActionTest, FormulaActionFunctionality) {
input.selection.set(0,true);
// Now test the general functionality.
action = storm::property::action::FormulaAction<double>(std::make_shared<storm::property::prctl::ProbabilisticBoundOperator<double>>(storm::property::LESS, 0.5, std::make_shared<storm::property::prctl::Eventually<double>>(std::make_shared<storm::property::prctl::Ap<double>>("b"))));
action = storm::properties::action::FormulaAction<double>(std::make_shared<storm::properties::prctl::ProbabilisticBoundOperator<double>>(storm::properties::LESS, 0.5, std::make_shared<storm::properties::prctl::Eventually<double>>(std::make_shared<storm::properties::prctl::Ap<double>>("b"))));
ASSERT_NO_THROW(result = action.evaluate(input, mc));
ASSERT_TRUE(result.selection[0]);
ASSERT_TRUE(result.selection[1]);
@ -249,7 +249,7 @@ TEST(ActionTest, FormulaActionSafety){
// Build the filter input.
// Basically the modelchecking result of "F a" on the used DTMC.
std::vector<double> pathResult = mc.checkEventually(storm::property::prctl::Eventually<double>(std::make_shared<storm::property::prctl::Ap<double>>("a")), false);
std::vector<double> pathResult = mc.checkEventually(storm::properties::prctl::Eventually<double>(std::make_shared<storm::properties::prctl::Ap<double>>("a")), false);
std::vector<uint_fast64_t> stateMap(pathResult.size());
for(uint_fast64_t i = 0; i < pathResult.size(); i++) {
stateMap[i] = i;
@ -258,7 +258,7 @@ TEST(ActionTest, FormulaActionSafety){
Result result;
// Check that constructing the action using a nullptr and using an empty constructor leads to the same behavior.
storm::property::action::FormulaAction<double> action(std::shared_ptr<storm::property::csl::AbstractStateFormula<double>>(nullptr));
storm::properties::action::FormulaAction<double> action(std::shared_ptr<storm::properties::csl::AbstractStateFormula<double>>(nullptr));
input.selection.set(0,false);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
for(uint_fast64_t i = 0; i < pathResult.size(); i++) {
@ -282,8 +282,8 @@ TEST(ActionTest, InvertActionFunctionality){
// Build the filter input.
// Basically the modelchecking result of "F a" on the used DTMC.
std::vector<double> pathResult = mc.checkEventually(storm::property::prctl::Eventually<double>(std::make_shared<storm::property::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::property::prctl::Ap<double>("c"));
std::vector<double> pathResult = mc.checkEventually(storm::properties::prctl::Eventually<double>(std::make_shared<storm::properties::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::properties::prctl::Ap<double>("c"));
std::vector<uint_fast64_t> stateMap(pathResult.size());
for(uint_fast64_t i = 0; i < pathResult.size(); i++) {
stateMap[i] = pathResult.size()-i-1;
@ -292,7 +292,7 @@ TEST(ActionTest, InvertActionFunctionality){
Result result;
// Check whether the selection becomes inverted while the rest stays the same.
storm::property::action::InvertAction<double> action;
storm::properties::action::InvertAction<double> action;
input.selection.set(0,false);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
for(uint_fast64_t i = 0; i < pathResult.size(); i++) {
@ -316,8 +316,8 @@ TEST(ActionTest, RangeActionFunctionality){
// Build the filter input.
// Basically the modelchecking result of "F a" on the used DTMC.
std::vector<double> pathResult = mc.checkEventually(storm::property::prctl::Eventually<double>(std::make_shared<storm::property::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::property::prctl::Ap<double>("c"));
std::vector<double> pathResult = mc.checkEventually(storm::properties::prctl::Eventually<double>(std::make_shared<storm::properties::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::properties::prctl::Ap<double>("c"));
std::vector<uint_fast64_t> stateMap(pathResult.size());
for(uint_fast64_t i = 0; i < pathResult.size(); i++) {
stateMap[i] = i;
@ -327,7 +327,7 @@ TEST(ActionTest, RangeActionFunctionality){
// Test if the action selects the first 3 states in relation to the order given by the stateMap.
// First in index order.
storm::property::action::RangeAction<double> action(0,2);
storm::properties::action::RangeAction<double> action(0,2);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
for(uint_fast64_t i = 0; i < result.selection.size(); i++) {
ASSERT_EQ(input.stateMap[i], result.stateMap[i]);
@ -384,7 +384,7 @@ TEST(ActionTest, RangeActionFunctionality){
// Test that specifying and interval of (i,i) selects only state i.
for(uint_fast64_t i = 0; i < input.selection.size(); i++) {
action = storm::property::action::RangeAction<double>(i,i);
action = storm::properties::action::RangeAction<double>(i,i);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
ASSERT_EQ(1, result.selection.getNumberOfSetBits());
ASSERT_TRUE(result.selection[result.stateMap[i]]);
@ -398,8 +398,8 @@ TEST(ActionTest, RangeActionSafety){
// Build the filter input.
// Basically the modelchecking result of "F a" on the used DTMC.
std::vector<double> pathResult = mc.checkEventually(storm::property::prctl::Eventually<double>(std::make_shared<storm::property::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::property::prctl::Ap<double>("c"));
std::vector<double> pathResult = mc.checkEventually(storm::properties::prctl::Eventually<double>(std::make_shared<storm::properties::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::properties::prctl::Ap<double>("c"));
std::vector<uint_fast64_t> stateMap(pathResult.size());
for(uint_fast64_t i = 0; i < pathResult.size(); i++) {
stateMap[i] = i;
@ -414,21 +414,21 @@ TEST(ActionTest, RangeActionSafety){
std::streambuf * sbuf = std::cout.rdbuf();
std::cout.rdbuf(buffer.rdbuf());
storm::property::action::RangeAction<double> action(0,42);
storm::properties::action::RangeAction<double> action(0,42);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
ASSERT_TRUE(result.selection.full());
ASSERT_FALSE(buffer.str().empty());
buffer.str("");
action = storm::property::action::RangeAction<double>(42,98);
action = storm::properties::action::RangeAction<double>(42,98);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
ASSERT_TRUE(result.selection.empty());
ASSERT_FALSE(buffer.str().empty());
std::cout.rdbuf(sbuf);
ASSERT_THROW(storm::property::action::RangeAction<double>(3,1), storm::exceptions::IllegalArgumentValueException);
ASSERT_THROW(storm::properties::action::RangeAction<double>(3,1), storm::exceptions::IllegalArgumentValueException);
}
TEST(ActionTest, SortActionFunctionality){
@ -438,8 +438,8 @@ TEST(ActionTest, SortActionFunctionality){
// Build the filter input.
// Basically the modelchecking result of "F a" on the used DTMC.
std::vector<double> pathResult = mc.checkEventually(storm::property::prctl::Eventually<double>(std::make_shared<storm::property::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::property::prctl::Ap<double>("c"));
std::vector<double> pathResult = mc.checkEventually(storm::properties::prctl::Eventually<double>(std::make_shared<storm::properties::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::properties::prctl::Ap<double>("c"));
std::vector<uint_fast64_t> stateMap(pathResult.size());
for(uint_fast64_t i = 0; i < pathResult.size(); i++) {
stateMap[i] = pathResult.size()-i-1;
@ -448,7 +448,7 @@ TEST(ActionTest, SortActionFunctionality){
Result result;
// Test that sorting preserves everything except the state map.
storm::property::action::SortAction<double> action;
storm::properties::action::SortAction<double> action;
ASSERT_NO_THROW(action.toString());
input.selection.set(0,false);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
@ -468,14 +468,14 @@ TEST(ActionTest, SortActionFunctionality){
// 1) index, ascending -> see above
// 2) index descending
input.selection.set(3,false);
action = storm::property::action::SortAction<double>(storm::property::action::SortAction<double>::INDEX, false);
action = storm::properties::action::SortAction<double>(storm::properties::action::SortAction<double>::INDEX, false);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
for(uint_fast64_t i = 0; i < pathResult.size(); i++) {
ASSERT_EQ(pathResult.size()-i-1, result.stateMap[i]);
}
// 3) value, ascending
action = storm::property::action::SortAction<double>(storm::property::action::SortAction<double>::VALUE);
action = storm::properties::action::SortAction<double>(storm::properties::action::SortAction<double>::VALUE);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
ASSERT_EQ(6, result.stateMap[0]);
ASSERT_EQ(7, result.stateMap[1]);
@ -487,7 +487,7 @@ TEST(ActionTest, SortActionFunctionality){
ASSERT_EQ(5, result.stateMap[7]);
// 3) value, decending
action = storm::property::action::SortAction<double>(storm::property::action::SortAction<double>::VALUE, false);
action = storm::properties::action::SortAction<double>(storm::properties::action::SortAction<double>::VALUE, false);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
ASSERT_EQ(5, result.stateMap[0]);
ASSERT_EQ(2, result.stateMap[1]);
@ -502,7 +502,7 @@ TEST(ActionTest, SortActionFunctionality){
input.pathResult = std::vector<double>();
input.stateResult = stateResult;
action = storm::property::action::SortAction<double>(storm::property::action::SortAction<double>::VALUE);
action = storm::properties::action::SortAction<double>(storm::properties::action::SortAction<double>::VALUE);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
ASSERT_EQ(5, result.stateMap[0]);
ASSERT_EQ(6, result.stateMap[1]);
@ -513,7 +513,7 @@ TEST(ActionTest, SortActionFunctionality){
ASSERT_EQ(3, result.stateMap[6]);
ASSERT_EQ(4, result.stateMap[7]);
action = storm::property::action::SortAction<double>(storm::property::action::SortAction<double>::VALUE, false);
action = storm::properties::action::SortAction<double>(storm::properties::action::SortAction<double>::VALUE, false);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
ASSERT_EQ(0, result.stateMap[0]);
ASSERT_EQ(1, result.stateMap[1]);
@ -528,9 +528,9 @@ TEST(ActionTest, SortActionFunctionality){
input.stateResult = storm::storage::BitVector();
input.pathResult = pathResult;
action = storm::property::action::SortAction<double>(storm::property::action::SortAction<double>::INDEX);
action = storm::properties::action::SortAction<double>(storm::properties::action::SortAction<double>::INDEX);
ASSERT_NO_THROW(input = action.evaluate(input, mc));
action = storm::property::action::SortAction<double>(storm::property::action::SortAction<double>::VALUE);
action = storm::properties::action::SortAction<double>(storm::properties::action::SortAction<double>::VALUE);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
ASSERT_EQ(6, result.stateMap[0]);
ASSERT_EQ(7, result.stateMap[1]);
@ -551,8 +551,8 @@ TEST(ActionTest, SortActionSafety){
// Build the filter input.
// Basically the modelchecking result of "F a" on the used DTMC.
std::vector<double> pathResult = mc.checkEventually(storm::property::prctl::Eventually<double>(std::make_shared<storm::property::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::property::prctl::Ap<double>("c"));
std::vector<double> pathResult = mc.checkEventually(storm::properties::prctl::Eventually<double>(std::make_shared<storm::properties::prctl::Ap<double>>("a")), false);
storm::storage::BitVector stateResult = mc.checkAp(storm::properties::prctl::Ap<double>("c"));
std::vector<uint_fast64_t> stateMap(pathResult.size());
for(uint_fast64_t i = 0; i < pathResult.size(); i++) {
stateMap[i] = pathResult.size()-i-1;
@ -560,7 +560,7 @@ TEST(ActionTest, SortActionSafety){
Result input(storm::storage::BitVector(pathResult.size(), true), stateMap, pathResult, stateResult);
Result result;
storm::property::action::SortAction<double> action(storm::property::action::SortAction<double>::VALUE);
storm::properties::action::SortAction<double> action(storm::properties::action::SortAction<double>::VALUE);
ASSERT_NO_THROW(result = action.evaluate(input, mc));
ASSERT_EQ(6, result.stateMap[0]);
ASSERT_EQ(7, result.stateMap[1]);

60
test/functional/modelchecker/EigenDtmcPrctlModelCheckerTest.cpp

@ -21,9 +21,9 @@ TEST(EigenDtmcPrctlModelCheckerTest, Die) {
storm::modelChecker::EigenDtmcPrctlModelChecker<double> mc(*dtmc);
storm::property::Ap<double>* apFormula = new storm::property::Ap<double>("one");
storm::property::Eventually<double>* eventuallyFormula = new storm::property::Eventually<double>(apFormula);
storm::property::ProbabilisticNoBoundOperator<double>* probFormula = new storm::property::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
storm::properties::Ap<double>* apFormula = new storm::properties::Ap<double>("one");
storm::properties::Eventually<double>* eventuallyFormula = new storm::properties::Eventually<double>(apFormula);
storm::properties::ProbabilisticNoBoundOperator<double>* probFormula = new storm::properties::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
std::vector<double>* result = probFormula->check(mc);
@ -32,9 +32,9 @@ TEST(EigenDtmcPrctlModelCheckerTest, Die) {
delete probFormula;
delete result;
apFormula = new storm::property::Ap<double>("two");
eventuallyFormula = new storm::property::Eventually<double>(apFormula);
probFormula = new storm::property::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
apFormula = new storm::properties::Ap<double>("two");
eventuallyFormula = new storm::properties::Eventually<double>(apFormula);
probFormula = new storm::properties::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
result = probFormula->check(mc);
@ -43,9 +43,9 @@ TEST(EigenDtmcPrctlModelCheckerTest, Die) {
delete probFormula;
delete result;
apFormula = new storm::property::Ap<double>("three");
eventuallyFormula = new storm::property::Eventually<double>(apFormula);
probFormula = new storm::property::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
apFormula = new storm::properties::Ap<double>("three");
eventuallyFormula = new storm::properties::Eventually<double>(apFormula);
probFormula = new storm::properties::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
result = probFormula->check(mc);
@ -54,9 +54,9 @@ TEST(EigenDtmcPrctlModelCheckerTest, Die) {
delete probFormula;
delete result;
storm::property::Ap<double>* done = new storm::property::Ap<double>("done");
storm::property::ReachabilityReward<double>* reachabilityRewardFormula = new storm::property::ReachabilityReward<double>(done);
storm::property::RewardNoBoundOperator<double>* rewardFormula = new storm::property::RewardNoBoundOperator<double>(reachabilityRewardFormula);
storm::properties::Ap<double>* done = new storm::properties::Ap<double>("done");
storm::properties::ReachabilityReward<double>* reachabilityRewardFormula = new storm::properties::ReachabilityReward<double>(done);
storm::properties::RewardNoBoundOperator<double>* rewardFormula = new storm::properties::RewardNoBoundOperator<double>(reachabilityRewardFormula);
result = rewardFormula->check(mc);
@ -82,9 +82,9 @@ TEST(EigenDtmcPrctlModelCheckerTest, Crowds) {
storm::modelChecker::EigenDtmcPrctlModelChecker<double> mc(*dtmc);
storm::property::Ap<double>* apFormula = new storm::property::Ap<double>("observe0Greater1");
storm::property::Eventually<double>* eventuallyFormula = new storm::property::Eventually<double>(apFormula);
storm::property::ProbabilisticNoBoundOperator<double>* probFormula = new storm::property::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
storm::properties::Ap<double>* apFormula = new storm::properties::Ap<double>("observe0Greater1");
storm::properties::Eventually<double>* eventuallyFormula = new storm::properties::Eventually<double>(apFormula);
storm::properties::ProbabilisticNoBoundOperator<double>* probFormula = new storm::properties::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
std::vector<double>* result = probFormula->check(mc);
@ -93,9 +93,9 @@ TEST(EigenDtmcPrctlModelCheckerTest, Crowds) {
delete probFormula;
delete result;
apFormula = new storm::property::Ap<double>("observeIGreater1");
eventuallyFormula = new storm::property::Eventually<double>(apFormula);
probFormula = new storm::property::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
apFormula = new storm::properties::Ap<double>("observeIGreater1");
eventuallyFormula = new storm::properties::Eventually<double>(apFormula);
probFormula = new storm::properties::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
result = probFormula->check(mc);
@ -104,9 +104,9 @@ TEST(EigenDtmcPrctlModelCheckerTest, Crowds) {
delete probFormula;
delete result;
apFormula = new storm::property::Ap<double>("observeOnlyTrueSender");
eventuallyFormula = new storm::property::Eventually<double>(apFormula);
probFormula = new storm::property::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
apFormula = new storm::properties::Ap<double>("observeOnlyTrueSender");
eventuallyFormula = new storm::properties::Eventually<double>(apFormula);
probFormula = new storm::properties::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
result = probFormula->check(mc);
@ -131,9 +131,9 @@ TEST(EigenDtmcPrctlModelCheckerTest, SynchronousLeader) {
storm::modelChecker::EigenDtmcPrctlModelChecker<double> mc(*dtmc);
storm::property::Ap<double>* apFormula = new storm::property::Ap<double>("elected");
storm::property::Eventually<double>* eventuallyFormula = new storm::property::Eventually<double>(apFormula);
storm::property::ProbabilisticNoBoundOperator<double>* probFormula = new storm::property::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
storm::properties::Ap<double>* apFormula = new storm::properties::Ap<double>("elected");
storm::properties::Eventually<double>* eventuallyFormula = new storm::properties::Eventually<double>(apFormula);
storm::properties::ProbabilisticNoBoundOperator<double>* probFormula = new storm::properties::ProbabilisticNoBoundOperator<double>(eventuallyFormula);
std::vector<double>* result = probFormula->check(mc);
@ -142,9 +142,9 @@ TEST(EigenDtmcPrctlModelCheckerTest, SynchronousLeader) {
delete probFormula;
delete result;
apFormula = new storm::property::Ap<double>("elected");
storm::property::BoundedUntil<double>* boundedUntilFormula = new storm::property::BoundedUntil<double>(new storm::property::Ap<double>("true"), apFormula, 20);
probFormula = new storm::property::ProbabilisticNoBoundOperator<double>(boundedUntilFormula);
apFormula = new storm::properties::Ap<double>("elected");
storm::properties::BoundedUntil<double>* boundedUntilFormula = new storm::properties::BoundedUntil<double>(new storm::properties::Ap<double>("true"), apFormula, 20);
probFormula = new storm::properties::ProbabilisticNoBoundOperator<double>(boundedUntilFormula);
result = probFormula->check(mc);
@ -153,9 +153,9 @@ TEST(EigenDtmcPrctlModelCheckerTest, SynchronousLeader) {
delete probFormula;
delete result;
apFormula = new storm::property::Ap<double>("elected");
storm::property::ReachabilityReward<double>* reachabilityRewardFormula = new storm::property::ReachabilityReward<double>(apFormula);
storm::property::RewardNoBoundOperator<double>* rewardFormula = new storm::property::RewardNoBoundOperator<double>(reachabilityRewardFormula);
apFormula = new storm::properties::Ap<double>("elected");
storm::properties::ReachabilityReward<double>* reachabilityRewardFormula = new storm::properties::ReachabilityReward<double>(apFormula);
storm::properties::RewardNoBoundOperator<double>* rewardFormula = new storm::properties::RewardNoBoundOperator<double>(reachabilityRewardFormula);
result = rewardFormula->check(mc);

38
test/functional/modelchecker/FilterTest.cpp

@ -13,17 +13,17 @@
#include "src/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.h"
#include "src/solver/GmmxxLinearEquationSolver.h"
#include "src/solver/GmmxxNondeterministicLinearEquationSolver.h"
#include "src/formula/prctl/PrctlFilter.h"
#include "src/formula/csl/CslFilter.h"
#include "src/formula/ltl/LtlFilter.h"
#include "src/properties/prctl/PrctlFilter.h"
#include "src/properties/csl/CslFilter.h"
#include "src/properties/ltl/LtlFilter.h"
#include "src/parser/PrctlParser.h"
#include "src/parser/CslParser.h"
#include "src/parser/MarkovAutomatonParser.h"
#include "src/formula/actions/InvertAction.h"
#include "src/properties/actions/InvertAction.h"
#include <memory>
typedef typename storm::property::action::AbstractAction<double>::Result Result;
typedef typename storm::properties::action::AbstractAction<double>::Result Result;
TEST(PrctlFilterTest, generalFunctionality) {
// Test filter queries of increasing complexity.
@ -34,7 +34,7 @@ TEST(PrctlFilterTest, generalFunctionality) {
// Find the best valued state to finally reach a 'b' state.
std::string input = "filter[sort(value, descending); range(0,0)](F b)";
std::shared_ptr<storm::property::prctl::PrctlFilter<double>> formula(nullptr);
std::shared_ptr<storm::properties::prctl::PrctlFilter<double>> formula(nullptr);
ASSERT_NO_THROW(
formula = storm::parser::PrctlParser::parsePrctlFormula(input)
);
@ -151,26 +151,26 @@ TEST(PrctlFilterTest, Safety) {
storm::modelchecker::prctl::SparseDtmcPrctlModelChecker<double> mc(model, new storm::solver::GmmxxLinearEquationSolver<double>());
// Make a stub formula as child.
auto apFormula = std::make_shared<storm::property::prctl::Ap<double>>("a");
auto apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("a");
// Test the filter for nullptr action handling.
auto formula = std::make_shared<storm::property::prctl::PrctlFilter<double>>(apFormula, nullptr);
auto formula = std::make_shared<storm::properties::prctl::PrctlFilter<double>>(apFormula, nullptr);
ASSERT_EQ(0, formula->getActionCount());
ASSERT_NO_THROW(formula->evaluate(mc));
// Repeat with vector containing only one action but three nullptr.
std::vector<std::shared_ptr<storm::property::action::AbstractAction<double>>> actions(4, nullptr);
actions[1] = std::make_shared<storm::property::action::InvertAction<double>>();
std::vector<std::shared_ptr<storm::properties::action::AbstractAction<double>>> actions(4, nullptr);
actions[1] = std::make_shared<storm::properties::action::InvertAction<double>>();
formula = std::make_shared<storm::property::prctl::PrctlFilter<double>>(apFormula, actions);
formula = std::make_shared<storm::properties::prctl::PrctlFilter<double>>(apFormula, actions);
ASSERT_EQ(1, formula->getActionCount());
ASSERT_NO_THROW(formula->evaluate(mc));
// Test the filter for nullptr child formula handling.
// It sholud not write anything to the standard out and return an empty result.
formula = std::make_shared<storm::property::prctl::PrctlFilter<double>>();
formula = std::make_shared<storm::properties::prctl::PrctlFilter<double>>();
Result result;
// To capture the output, redirect cout and test the written buffer content.
@ -200,7 +200,7 @@ TEST(CslFilterTest, generalFunctionality) {
// Find the best valued state to finally reach a 'r1' state.
std::string input = "filter[max; sort(value, descending); range(0,0)](F r1)";
std::shared_ptr<storm::property::csl::CslFilter<double>> formula(nullptr);
std::shared_ptr<storm::properties::csl::CslFilter<double>> formula(nullptr);
ASSERT_NO_THROW(
formula = storm::parser::CslParser::parseCslFormula(input)
);
@ -317,26 +317,26 @@ TEST(CslFilterTest, Safety) {
storm::modelchecker::csl::SparseMarkovAutomatonCslModelChecker<double> mc(model, std::make_shared<storm::solver::GmmxxNondeterministicLinearEquationSolver<double>>());
// Make a stub formula as child.
auto apFormula = std::make_shared<storm::property::csl::Ap<double>>("r1");
auto apFormula = std::make_shared<storm::properties::csl::Ap<double>>("r1");
// Test the filter for nullptr action handling.
auto formula = std::make_shared<storm::property::csl::CslFilter<double>>(apFormula, nullptr, storm::property::MAXIMIZE);
auto formula = std::make_shared<storm::properties::csl::CslFilter<double>>(apFormula, nullptr, storm::properties::MAXIMIZE);
ASSERT_NO_THROW(formula->evaluate(mc));
ASSERT_EQ(0, formula->getActionCount());
// Repeat with vector containing only one action but three nullptr.
std::vector<std::shared_ptr<storm::property::action::AbstractAction<double>>> actions(4, nullptr);
actions[1] = std::make_shared<storm::property::action::InvertAction<double>>();
std::vector<std::shared_ptr<storm::properties::action::AbstractAction<double>>> actions(4, nullptr);
actions[1] = std::make_shared<storm::properties::action::InvertAction<double>>();
formula = std::make_shared<storm::property::csl::CslFilter<double>>(apFormula, actions, storm::property::MAXIMIZE);
formula = std::make_shared<storm::properties::csl::CslFilter<double>>(apFormula, actions, storm::properties::MAXIMIZE);
ASSERT_EQ(1, formula->getActionCount());
ASSERT_NO_THROW(formula->evaluate(mc));
// Test the filter for nullptr child formula handling.
// It sholud not write anything to the standard out and return an empty result.
formula = std::make_shared<storm::property::csl::CslFilter<double>>();
formula = std::make_shared<storm::properties::csl::CslFilter<double>>();
Result result;
// To capture the output, redirect cout and test the written buffer content.

40
test/functional/modelchecker/GmmxxDtmcPrctlModelCheckerTest.cpp

@ -22,29 +22,29 @@ TEST(GmmxxDtmcPrctlModelCheckerTest, Die) {
storm::modelchecker::prctl::SparseDtmcPrctlModelChecker<double> mc(*dtmc, new storm::solver::GmmxxLinearEquationSolver<double>());
auto apFormula = std::make_shared<storm::property::prctl::Ap<double>>("one");
auto eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
auto apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("one");
auto eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
std::vector<double> result = eventuallyFormula->check(mc, false);
ASSERT_LT(std::abs(result[0] - ((double)1.0/6.0)), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("two");
eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("two");
eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
result = eventuallyFormula->check(mc, false);
ASSERT_LT(std::abs(result[0] - ((double)1.0/6.0)), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("three");
eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("three");
eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
result = eventuallyFormula->check(mc, false);
ASSERT_LT(std::abs(result[0] - ((double)1.0/6.0)), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
auto done = std::make_shared<storm::property::prctl::Ap<double>>("done");
auto reachabilityRewardFormula = std::make_shared<storm::property::prctl::ReachabilityReward<double>>(done);
auto done = std::make_shared<storm::properties::prctl::Ap<double>>("done");
auto reachabilityRewardFormula = std::make_shared<storm::properties::prctl::ReachabilityReward<double>>(done);
result = reachabilityRewardFormula->check(mc, false);
@ -66,22 +66,22 @@ TEST(GmmxxDtmcPrctlModelCheckerTest, Crowds) {
storm::modelchecker::prctl::SparseDtmcPrctlModelChecker<double> mc(*dtmc, new storm::solver::GmmxxLinearEquationSolver<double>());
auto apFormula = std::make_shared<storm::property::prctl::Ap<double>>("observe0Greater1");
auto eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
auto apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("observe0Greater1");
auto eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
std::vector<double> result = eventuallyFormula->check(mc, false);
ASSERT_LT(std::abs(result[0] - 0.3328800375801578281), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("observeIGreater1");
eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("observeIGreater1");
eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
result = eventuallyFormula->check(mc, false);
ASSERT_LT(std::abs(result[0] - 0.1522194965), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("observeOnlyTrueSender");
eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("observeOnlyTrueSender");
eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
result = eventuallyFormula->check(mc, false);
@ -102,22 +102,22 @@ TEST(GmmxxDtmcPrctlModelCheckerTest, SynchronousLeader) {
storm::modelchecker::prctl::SparseDtmcPrctlModelChecker<double> mc(*dtmc, new storm::solver::GmmxxLinearEquationSolver<double>());
auto apFormula = std::make_shared<storm::property::prctl::Ap<double>>("elected");
auto eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
auto apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("elected");
auto eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
std::vector<double> result = eventuallyFormula->check(mc, false);
ASSERT_LT(std::abs(result[0] - 1.0), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("elected");
auto boundedUntilFormula = std::make_shared<storm::property::prctl::BoundedUntil<double>>(std::make_shared<storm::property::prctl::Ap<double>>("true"), apFormula, 20);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("elected");
auto boundedUntilFormula = std::make_shared<storm::properties::prctl::BoundedUntil<double>>(std::make_shared<storm::properties::prctl::Ap<double>>("true"), apFormula, 20);
result = boundedUntilFormula->check(mc, false);
ASSERT_LT(std::abs(result[0] - 0.9999965911265462636), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("elected");
auto reachabilityRewardFormula = std::make_shared<storm::property::prctl::ReachabilityReward<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("elected");
auto reachabilityRewardFormula = std::make_shared<storm::properties::prctl::ReachabilityReward<double>>(apFormula);
result = reachabilityRewardFormula->check(mc, false);

36
test/functional/modelchecker/SparseMdpPrctlModelCheckerTest.cpp

@ -19,8 +19,8 @@ TEST(SparseMdpPrctlModelCheckerTest, Dice) {
storm::modelchecker::prctl::SparseMdpPrctlModelChecker<double> mc(*mdp, std::shared_ptr<storm::solver::NativeNondeterministicLinearEquationSolver<double>>(new storm::solver::NativeNondeterministicLinearEquationSolver<double>()));
auto apFormula = std::make_shared<storm::property::prctl::Ap<double>>("two");
auto eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
auto apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("two");
auto eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
std::vector<double> result = mc.checkOptimizingOperator(*eventuallyFormula, true);
@ -30,8 +30,8 @@ TEST(SparseMdpPrctlModelCheckerTest, Dice) {
ASSERT_LT(std::abs(result[0] - 0.0277777612209320068), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("three");
eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("three");
eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
result = mc.checkOptimizingOperator(*eventuallyFormula, true);
@ -41,8 +41,8 @@ TEST(SparseMdpPrctlModelCheckerTest, Dice) {
ASSERT_LT(std::abs(result[0] - 0.0555555224418640136), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("four");
eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("four");
eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
result = mc.checkOptimizingOperator(*eventuallyFormula, true);
@ -52,8 +52,8 @@ TEST(SparseMdpPrctlModelCheckerTest, Dice) {
ASSERT_LT(std::abs(result[0] - 0.083333283662796020508), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("done");
auto reachabilityRewardFormula = std::make_shared<storm::property::prctl::ReachabilityReward<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("done");
auto reachabilityRewardFormula = std::make_shared<storm::properties::prctl::ReachabilityReward<double>>(apFormula);
result = mc.checkOptimizingOperator(*reachabilityRewardFormula, true);
@ -71,8 +71,8 @@ TEST(SparseMdpPrctlModelCheckerTest, Dice) {
storm::modelchecker::prctl::SparseMdpPrctlModelChecker<double> stateRewardModelChecker(*stateRewardMdp, std::shared_ptr<storm::solver::NativeNondeterministicLinearEquationSolver<double>>(new storm::solver::NativeNondeterministicLinearEquationSolver<double>()));
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("done");
reachabilityRewardFormula = std::make_shared<storm::property::prctl::ReachabilityReward<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("done");
reachabilityRewardFormula = std::make_shared<storm::properties::prctl::ReachabilityReward<double>>(apFormula);
result = stateRewardModelChecker.checkOptimizingOperator(*reachabilityRewardFormula, true);
@ -90,8 +90,8 @@ TEST(SparseMdpPrctlModelCheckerTest, Dice) {
storm::modelchecker::prctl::SparseMdpPrctlModelChecker<double> stateAndTransitionRewardModelChecker(*stateAndTransitionRewardMdp, std::shared_ptr<storm::solver::NativeNondeterministicLinearEquationSolver<double>>(new storm::solver::NativeNondeterministicLinearEquationSolver<double>()));
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("done");
reachabilityRewardFormula = std::make_shared<storm::property::prctl::ReachabilityReward<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("done");
reachabilityRewardFormula = std::make_shared<storm::properties::prctl::ReachabilityReward<double>>(apFormula);
result = stateAndTransitionRewardModelChecker.checkOptimizingOperator(*reachabilityRewardFormula, true);
@ -115,8 +115,8 @@ TEST(SparseMdpPrctlModelCheckerTest, AsynchronousLeader) {
storm::modelchecker::prctl::SparseMdpPrctlModelChecker<double> mc(*mdp, std::shared_ptr<storm::solver::NativeNondeterministicLinearEquationSolver<double>>(new storm::solver::NativeNondeterministicLinearEquationSolver<double>()));
auto apFormula = std::make_shared<storm::property::prctl::Ap<double>>("elected");
auto eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
auto apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("elected");
auto eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
std::vector<double> result = mc.checkOptimizingOperator(*eventuallyFormula, true);
@ -126,8 +126,8 @@ TEST(SparseMdpPrctlModelCheckerTest, AsynchronousLeader) {
ASSERT_LT(std::abs(result[0] - 1), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("elected");
auto boundedEventuallyFormula = std::make_shared<storm::property::prctl::BoundedEventually<double>>(apFormula, 25);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("elected");
auto boundedEventuallyFormula = std::make_shared<storm::properties::prctl::BoundedEventually<double>>(apFormula, 25);
result = mc.checkOptimizingOperator(*boundedEventuallyFormula, true);
@ -137,8 +137,8 @@ TEST(SparseMdpPrctlModelCheckerTest, AsynchronousLeader) {
ASSERT_LT(std::abs(result[0] - 0.0625), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("elected");
auto reachabilityRewardFormula = std::make_shared<storm::property::prctl::ReachabilityReward<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("elected");
auto reachabilityRewardFormula = std::make_shared<storm::properties::prctl::ReachabilityReward<double>>(apFormula);
result = mc.checkOptimizingOperator(*reachabilityRewardFormula, true);

34
test/functional/parser/CslParserTest.cpp

@ -9,13 +9,13 @@
#include "storm-config.h"
#include "src/parser/CslParser.h"
#include "src/exceptions/WrongFormatException.h"
#include "src/formula/actions/FormulaAction.h"
#include "src/formula/actions/InvertAction.h"
#include "src/formula/actions/SortAction.h"
#include "src/formula/actions/RangeAction.h"
#include "src/formula/actions/BoundAction.h"
#include "src/properties/actions/FormulaAction.h"
#include "src/properties/actions/InvertAction.h"
#include "src/properties/actions/SortAction.h"
#include "src/properties/actions/RangeAction.h"
#include "src/properties/actions/BoundAction.h"
namespace csl = storm::property::csl;
namespace csl = storm::properties::csl;
TEST(CslParserTest, parseApOnlyTest) {
std::string input = "ap";
@ -70,7 +70,7 @@ TEST(CslParserTest, parsePathFormulaTest) {
ASSERT_NE(std::dynamic_pointer_cast<csl::ProbabilisticBoundOperator<double>>(nextFormula->getChild()).get(), nullptr);
auto probBoundFormula = std::dynamic_pointer_cast<csl::ProbabilisticBoundOperator<double>>(nextFormula->getChild());
ASSERT_EQ(0.9, probBoundFormula->getBound());
ASSERT_EQ(storm::property::LESS, probBoundFormula->getComparisonOperator());
ASSERT_EQ(storm::properties::LESS, probBoundFormula->getComparisonOperator());
ASSERT_FALSE(probBoundFormula->isPropositional());
ASSERT_TRUE(probBoundFormula->isProbEventuallyAP());
@ -99,9 +99,9 @@ TEST(CslParserTest, parseProbabilisticFormulaTest) {
// The parser did not falsely recognize the input as a comment.
ASSERT_NE(formula.get(), nullptr);
auto op = std::dynamic_pointer_cast<storm::property::csl::ProbabilisticBoundOperator<double>>(formula->getChild());
auto op = std::dynamic_pointer_cast<storm::properties::csl::ProbabilisticBoundOperator<double>>(formula->getChild());
ASSERT_NE(op.get(), nullptr);
ASSERT_EQ(storm::property::GREATER, op->getComparisonOperator());
ASSERT_EQ(storm::properties::GREATER, op->getComparisonOperator());
ASSERT_EQ(0.5, op->getBound());
ASSERT_FALSE(op->isPropositional());
ASSERT_TRUE(op->isProbEventuallyAP());
@ -120,9 +120,9 @@ TEST(CslParserTest, parseSteadyStateBoundFormulaTest) {
// The parser did not falsely recognize the input as a comment.
ASSERT_NE(formula.get(), nullptr);
auto op = std::dynamic_pointer_cast<storm::property::csl::SteadyStateBoundOperator<double>>(formula->getChild());
auto op = std::dynamic_pointer_cast<storm::properties::csl::SteadyStateBoundOperator<double>>(formula->getChild());
ASSERT_NE(op.get(), nullptr);
ASSERT_EQ(storm::property::GREATER_EQUAL, op->getComparisonOperator());
ASSERT_EQ(storm::properties::GREATER_EQUAL, op->getComparisonOperator());
ASSERT_EQ(15.0, op->getBound());
ASSERT_FALSE(op->isPropositional());
ASSERT_FALSE(op->isProbEventuallyAP());
@ -193,14 +193,14 @@ TEST(CslParserTest, parseCslFilterTest) {
// The parser did not falsely recognize the input as a comment.
ASSERT_NE(formula, nullptr);
ASSERT_EQ(storm::property::MAXIMIZE, formula->getOptimizingOperator());
ASSERT_EQ(storm::properties::MAXIMIZE, formula->getOptimizingOperator());
ASSERT_EQ(5, formula->getActionCount());
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::FormulaAction<double>>(formula->getAction(0)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::InvertAction<double>>(formula->getAction(1)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::BoundAction<double>>(formula->getAction(2)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::SortAction<double>>(formula->getAction(3)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::RangeAction<double>>(formula->getAction(4)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::FormulaAction<double>>(formula->getAction(0)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::InvertAction<double>>(formula->getAction(1)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::BoundAction<double>>(formula->getAction(2)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::SortAction<double>>(formula->getAction(3)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::RangeAction<double>>(formula->getAction(4)).get(), nullptr);
ASSERT_FALSE(formula->getChild()->isPropositional());
ASSERT_FALSE(formula->getChild()->isProbEventuallyAP());

26
test/functional/parser/LtlParserTest.cpp

@ -9,16 +9,16 @@
#include "storm-config.h"
#include "src/parser/LtlParser.h"
#include "src/exceptions/WrongFormatException.h"
#include "src/formula/actions/InvertAction.h"
#include "src/formula/actions/SortAction.h"
#include "src/formula/actions/RangeAction.h"
#include "src/formula/actions/BoundAction.h"
#include "src/properties/actions/InvertAction.h"
#include "src/properties/actions/SortAction.h"
#include "src/properties/actions/RangeAction.h"
#include "src/properties/actions/BoundAction.h"
namespace ltl = storm::property::ltl;
namespace ltl = storm::properties::ltl;
TEST(LtlParserTest, parseApOnlyTest) {
std::string input = "ap";
std::shared_ptr<storm::property::ltl::LtlFilter<double>> formula(nullptr);
std::shared_ptr<storm::properties::ltl::LtlFilter<double>> formula(nullptr);
ASSERT_NO_THROW(
formula = storm::parser::LtlParser::parseLtlFormula(input);
);
@ -87,7 +87,7 @@ TEST(LtlParserTest, parseBoundedEventuallyFormulaTest) {
ASSERT_FALSE(formula->getChild()->isPropositional());
std::shared_ptr<storm::property::ltl::BoundedEventually<double>> op = std::dynamic_pointer_cast<storm::property::ltl::BoundedEventually<double>>(formula->getChild());
std::shared_ptr<storm::properties::ltl::BoundedEventually<double>> op = std::dynamic_pointer_cast<storm::properties::ltl::BoundedEventually<double>>(formula->getChild());
ASSERT_NE(op.get(), nullptr);
ASSERT_EQ(static_cast<uint_fast64_t>(5), op->getBound());
@ -106,7 +106,7 @@ TEST(LtlParserTest, parseBoundedUntilFormulaTest) {
ASSERT_FALSE(formula->getChild()->isPropositional());
std::shared_ptr<storm::property::ltl::BoundedUntil<double>> op = std::dynamic_pointer_cast<storm::property::ltl::BoundedUntil<double>>(formula->getChild());
std::shared_ptr<storm::properties::ltl::BoundedUntil<double>> op = std::dynamic_pointer_cast<storm::properties::ltl::BoundedUntil<double>>(formula->getChild());
ASSERT_NE(op.get(), nullptr);
ASSERT_EQ(static_cast<uint_fast64_t>(3), op->getBound());
@ -126,13 +126,13 @@ TEST(LtlParserTest, parseLtlFilterTest) {
ASSERT_FALSE(formula->getChild()->isPropositional());
ASSERT_EQ(storm::property::MAXIMIZE, formula->getOptimizingOperator());
ASSERT_EQ(storm::properties::MAXIMIZE, formula->getOptimizingOperator());
ASSERT_EQ(4, formula->getActionCount());
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::InvertAction<double>>(formula->getAction(0)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::BoundAction<double>>(formula->getAction(1)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::SortAction<double>>(formula->getAction(2)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::RangeAction<double>>(formula->getAction(3)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::InvertAction<double>>(formula->getAction(0)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::BoundAction<double>>(formula->getAction(1)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::SortAction<double>>(formula->getAction(2)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::RangeAction<double>>(formula->getAction(3)).get(), nullptr);
// The input was parsed correctly.
ASSERT_EQ("filter[max; invert; bound(<, 0.500000); sort(value, ascending); range(0, 3)](X a)", formula->toString());

30
test/functional/parser/PrctlParserTest.cpp

@ -10,13 +10,13 @@
#include "storm-config.h"
#include "src/parser/PrctlParser.h"
#include "src/exceptions/WrongFormatException.h"
#include "src/formula/actions/FormulaAction.h"
#include "src/formula/actions/InvertAction.h"
#include "src/formula/actions/SortAction.h"
#include "src/formula/actions/RangeAction.h"
#include "src/formula/actions/BoundAction.h"
#include "src/properties/actions/FormulaAction.h"
#include "src/properties/actions/InvertAction.h"
#include "src/properties/actions/SortAction.h"
#include "src/properties/actions/RangeAction.h"
#include "src/properties/actions/BoundAction.h"
namespace prctl = storm::property::prctl;
namespace prctl = storm::properties::prctl;
TEST(PrctlParserTest, parseApOnlyTest) {
std::string input = "ap";
@ -71,7 +71,7 @@ TEST(PrctlParserTest, parsePathFormulaTest) {
ASSERT_NE(std::dynamic_pointer_cast<prctl::ProbabilisticBoundOperator<double>>(nextFormula->getChild()).get(), nullptr);
auto probBoundFormula = std::dynamic_pointer_cast<prctl::ProbabilisticBoundOperator<double>>(nextFormula->getChild());
ASSERT_EQ(0.9, probBoundFormula->getBound());
ASSERT_EQ(storm::property::LESS, probBoundFormula->getComparisonOperator());
ASSERT_EQ(storm::properties::LESS, probBoundFormula->getComparisonOperator());
ASSERT_FALSE(probBoundFormula->isPropositional());
ASSERT_TRUE(probBoundFormula->isProbEventuallyAP());
@ -103,7 +103,7 @@ TEST(PrctlParserTest, parseProbabilisticFormulaTest) {
ASSERT_NE(std::dynamic_pointer_cast<prctl::ProbabilisticBoundOperator<double>>(formula->getChild()).get(), nullptr);
std::shared_ptr<prctl::ProbabilisticBoundOperator<double>> op = std::static_pointer_cast<prctl::ProbabilisticBoundOperator<double>>(formula->getChild());
ASSERT_EQ(storm::property::GREATER, op->getComparisonOperator());
ASSERT_EQ(storm::properties::GREATER, op->getComparisonOperator());
ASSERT_EQ(0.5, op->getBound());
ASSERT_FALSE(op->isPropositional());
ASSERT_TRUE(op->isProbEventuallyAP());
@ -125,7 +125,7 @@ TEST(PrctlParserTest, parseRewardFormulaTest) {
ASSERT_NE(std::dynamic_pointer_cast<prctl::RewardBoundOperator<double>>(formula->getChild()).get(), nullptr);
std::shared_ptr<prctl::RewardBoundOperator<double>> op = std::static_pointer_cast<prctl::RewardBoundOperator<double>>(formula->getChild());
ASSERT_EQ(storm::property::GREATER_EQUAL, op->getComparisonOperator());
ASSERT_EQ(storm::properties::GREATER_EQUAL, op->getComparisonOperator());
ASSERT_EQ(15.0, op->getBound());
ASSERT_FALSE(op->isPropositional());
ASSERT_FALSE(op->isProbEventuallyAP());
@ -195,14 +195,14 @@ TEST(PrctlParserTest, parsePrctlFilterTest) {
// The parser did not falsely recognize the input as a comment.
ASSERT_NE(formula.get(), nullptr);
ASSERT_EQ(storm::property::MAXIMIZE, formula->getOptimizingOperator());
ASSERT_EQ(storm::properties::MAXIMIZE, formula->getOptimizingOperator());
ASSERT_EQ(5, formula->getActionCount());
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::FormulaAction<double>>(formula->getAction(0)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::InvertAction<double>>(formula->getAction(1)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::BoundAction<double>>(formula->getAction(2)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::SortAction<double>>(formula->getAction(3)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::property::action::RangeAction<double>>(formula->getAction(4)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::FormulaAction<double>>(formula->getAction(0)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::InvertAction<double>>(formula->getAction(1)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::BoundAction<double>>(formula->getAction(2)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::SortAction<double>>(formula->getAction(3)).get(), nullptr);
ASSERT_NE(std::dynamic_pointer_cast<storm::properties::action::RangeAction<double>>(formula->getAction(4)).get(), nullptr);
ASSERT_FALSE(formula->getChild()->isPropositional());
ASSERT_FALSE(formula->getChild()->isProbEventuallyAP());

24
test/performance/modelchecker/GmmxxDtmcPrctModelCheckerTest.cpp

@ -21,8 +21,8 @@ TEST(GmmxxDtmcPrctlModelCheckerTest, Crowds) {
storm::modelchecker::prctl::SparseDtmcPrctlModelChecker<double> mc(*dtmc, new storm::solver::GmmxxLinearEquationSolver<double>());
auto apFormula = std::make_shared<storm::property::prctl::Ap<double>>("observe0Greater1");
auto eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
auto apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("observe0Greater1");
auto eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
LOG4CPLUS_WARN(logger, "Model Checking P=? [F observe0Greater1] on crowds/crowds20_5...");
std::vector<double> result = eventuallyFormula->check(mc, false);
@ -30,8 +30,8 @@ TEST(GmmxxDtmcPrctlModelCheckerTest, Crowds) {
ASSERT_LT(std::abs(result[0] - 0.2296800237), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("observeIGreater1");
eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("observeIGreater1");
eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
LOG4CPLUS_WARN(logger, "Model Checking P=? [F observeIGreater1] on crowds/crowds20_5...");
result = eventuallyFormula->check(mc, false);
@ -39,8 +39,8 @@ TEST(GmmxxDtmcPrctlModelCheckerTest, Crowds) {
ASSERT_LT(std::abs(result[0] - 0.05073232193), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("observeOnlyTrueSender");
eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("observeOnlyTrueSender");
eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
LOG4CPLUS_WARN(logger, "Model Checking P=? [F observeOnlyTrueSender] on crowds/crowds20_5...");
result = eventuallyFormula->check(mc, false);
@ -65,8 +65,8 @@ TEST(GmmxxDtmcPrctlModelCheckerTest, SynchronousLeader) {
storm::modelchecker::prctl::SparseDtmcPrctlModelChecker<double> mc(*dtmc, new storm::solver::GmmxxLinearEquationSolver<double>());
auto apFormula = std::make_shared<storm::property::prctl::Ap<double>>("elected");
auto eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
auto apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("elected");
auto eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
LOG4CPLUS_WARN(logger, "Model Checking P=? [F elected] on synchronous_leader/leader6_8...");
std::vector<double> result = eventuallyFormula->check(mc, false);
@ -74,8 +74,8 @@ TEST(GmmxxDtmcPrctlModelCheckerTest, SynchronousLeader) {
ASSERT_LT(std::abs(result[0] - 1.0), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("elected");
auto boundedUntilFormula = std::make_shared<storm::property::prctl::BoundedUntil<double>>(std::make_shared<storm::property::prctl::Ap<double>>("true"), apFormula, 20);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("elected");
auto boundedUntilFormula = std::make_shared<storm::properties::prctl::BoundedUntil<double>>(std::make_shared<storm::properties::prctl::Ap<double>>("true"), apFormula, 20);
LOG4CPLUS_WARN(logger, "Model Checking P=? [F<=20 elected] on synchronous_leader/leader6_8...");
result = boundedUntilFormula->check(mc, false);
@ -83,8 +83,8 @@ TEST(GmmxxDtmcPrctlModelCheckerTest, SynchronousLeader) {
ASSERT_LT(std::abs(result[0] - 0.9993949793), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("elected");
auto reachabilityRewardFormula = std::make_shared<storm::property::prctl::ReachabilityReward<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("elected");
auto reachabilityRewardFormula = std::make_shared<storm::properties::prctl::ReachabilityReward<double>>(apFormula);
LOG4CPLUS_WARN(logger, "Model Checking R=? [F elected] on synchronous_leader/leader6_8...");
result = reachabilityRewardFormula->check(mc, false);

50
test/performance/modelchecker/SparseMdpPrctlModelCheckerTest.cpp

@ -19,8 +19,8 @@ TEST(SparseMdpPrctlModelCheckerTest, AsynchronousLeader) {
storm::modelchecker::prctl::SparseMdpPrctlModelChecker<double> mc(*mdp, std::shared_ptr<storm::solver::NativeNondeterministicLinearEquationSolver<double>>(new storm::solver::NativeNondeterministicLinearEquationSolver<double>()));
auto apFormula = std::make_shared<storm::property::prctl::Ap<double>>("elected");
auto eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
auto apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("elected");
auto eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
std::vector<double> result = mc.checkOptimizingOperator(*eventuallyFormula, true);
@ -30,8 +30,8 @@ TEST(SparseMdpPrctlModelCheckerTest, AsynchronousLeader) {
ASSERT_LT(std::abs(result[0] - 1.0), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("elected");
auto boundedEventuallyFormula = std::make_shared<storm::property::prctl::BoundedEventually<double>>(apFormula, 25);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("elected");
auto boundedEventuallyFormula = std::make_shared<storm::properties::prctl::BoundedEventually<double>>(apFormula, 25);
result = mc.checkOptimizingOperator(*boundedEventuallyFormula, true);
@ -41,8 +41,8 @@ TEST(SparseMdpPrctlModelCheckerTest, AsynchronousLeader) {
ASSERT_LT(std::abs(result[0] - 0.0), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("elected");
auto reachabilityRewardFormula = std::make_shared<storm::property::prctl::ReachabilityReward<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("elected");
auto reachabilityRewardFormula = std::make_shared<storm::properties::prctl::ReachabilityReward<double>>(apFormula);
result = mc.checkOptimizingOperator(*reachabilityRewardFormula, true);
@ -69,43 +69,43 @@ TEST(SparseMdpPrctlModelCheckerTest, Consensus) {
storm::modelchecker::prctl::SparseMdpPrctlModelChecker<double> mc(*mdp, std::shared_ptr<storm::solver::NativeNondeterministicLinearEquationSolver<double>>(new storm::solver::NativeNondeterministicLinearEquationSolver<double>()));
auto apFormula = std::make_shared<storm::property::prctl::Ap<double>>("finished");
auto eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(apFormula);
auto apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("finished");
auto eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(apFormula);
std::vector<double> result = mc.checkOptimizingOperator(*eventuallyFormula, true);
ASSERT_LT(std::abs(result[31168] - 1.0), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("finished");
auto apFormula2 = std::make_shared<storm::property::prctl::Ap<double>>("all_coins_equal_0");
auto andFormula = std::make_shared<storm::property::prctl::And<double>>(apFormula, apFormula2);
eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(andFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("finished");
auto apFormula2 = std::make_shared<storm::properties::prctl::Ap<double>>("all_coins_equal_0");
auto andFormula = std::make_shared<storm::properties::prctl::And<double>>(apFormula, apFormula2);
eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(andFormula);
result = mc.checkOptimizingOperator(*eventuallyFormula, true);
ASSERT_LT(std::abs(result[31168] - 0.4374282832), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("finished");
apFormula2 = std::make_shared<storm::property::prctl::Ap<double>>("all_coins_equal_1");
andFormula = std::make_shared<storm::property::prctl::And<double>>(apFormula, apFormula2);
eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(andFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("finished");
apFormula2 = std::make_shared<storm::properties::prctl::Ap<double>>("all_coins_equal_1");
andFormula = std::make_shared<storm::properties::prctl::And<double>>(apFormula, apFormula2);
eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(andFormula);
result = mc.checkOptimizingOperator(*eventuallyFormula, false);
ASSERT_LT(std::abs(result[31168] - 0.5293286369), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("finished");
apFormula2 = std::make_shared<storm::property::prctl::Ap<double>>("agree");
auto notFormula = std::make_shared<storm::property::prctl::Not<double>>(apFormula2);
andFormula = std::make_shared<storm::property::prctl::And<double>>(apFormula, notFormula);
eventuallyFormula = std::make_shared<storm::property::prctl::Eventually<double>>(andFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("finished");
apFormula2 = std::make_shared<storm::properties::prctl::Ap<double>>("agree");
auto notFormula = std::make_shared<storm::properties::prctl::Not<double>>(apFormula2);
andFormula = std::make_shared<storm::properties::prctl::And<double>>(apFormula, notFormula);
eventuallyFormula = std::make_shared<storm::properties::prctl::Eventually<double>>(andFormula);
result = mc.checkOptimizingOperator(*eventuallyFormula, false);
ASSERT_LT(std::abs(result[31168] - 0.10414097), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("finished");
auto boundedEventuallyFormula = std::make_shared<storm::property::prctl::BoundedEventually<double>>(apFormula, 50ull);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("finished");
auto boundedEventuallyFormula = std::make_shared<storm::properties::prctl::BoundedEventually<double>>(apFormula, 50ull);
result = mc.checkOptimizingOperator(*boundedEventuallyFormula, true);
@ -115,8 +115,8 @@ TEST(SparseMdpPrctlModelCheckerTest, Consensus) {
ASSERT_LT(std::abs(result[31168] - 0.0), s->getOptionByLongName("precision").getArgument(0).getValueAsDouble());
apFormula = std::make_shared<storm::property::prctl::Ap<double>>("finished");
auto reachabilityRewardFormula = std::make_shared<storm::property::prctl::ReachabilityReward<double>>(apFormula);
apFormula = std::make_shared<storm::properties::prctl::Ap<double>>("finished");
auto reachabilityRewardFormula = std::make_shared<storm::properties::prctl::ReachabilityReward<double>>(apFormula);
result = mc.checkOptimizingOperator(*reachabilityRewardFormula, true);

Loading…
Cancel
Save