Browse Source
Merge branch 'monolithic-dft' of https://sselab.de/lab9/private/git/storm into monolithic-dft
Merge branch 'monolithic-dft' of https://sselab.de/lab9/private/git/storm into monolithic-dft
Former-commit-id: 3176ffa15c
main
151 changed files with 2605 additions and 1340 deletions
-
52CMakeLists.txt
-
9examples/dft/spare_symmetry.dft
-
21resources/3rdparty/CMakeLists.txt
-
9src/adapters/GmmxxAdapter.h
-
6src/builder/DdPrismModelBuilder.cpp
-
2src/builder/ExplicitDFTModelBuilder.h
-
6src/builder/ExplicitPrismModelBuilder.cpp
-
12src/cli/cli.cpp
-
28src/counterexamples/GenerateCounterexample.h
-
44src/counterexamples/MILPMinimalLabelSetGenerator.h
-
42src/counterexamples/PathBasedSubsystemGenerator.h
-
84src/counterexamples/SMTMinimalCommandSetGenerator.h
-
14src/logic/AtomicExpressionFormula.cpp
-
4src/logic/AtomicExpressionFormula.h
-
14src/logic/AtomicLabelFormula.cpp
-
4src/logic/AtomicLabelFormula.h
-
6src/logic/BinaryBooleanStateFormula.cpp
-
2src/logic/BinaryBooleanStateFormula.h
-
38src/logic/BinaryPathFormula.cpp
-
10src/logic/BinaryPathFormula.h
-
38src/logic/BinaryStateFormula.cpp
-
10src/logic/BinaryStateFormula.h
-
22src/logic/BooleanLiteralFormula.cpp
-
6src/logic/BooleanLiteralFormula.h
-
18src/logic/BoundedUntilFormula.cpp
-
7src/logic/BoundedUntilFormula.h
-
59src/logic/ConditionalFormula.cpp
-
43src/logic/ConditionalFormula.h
-
24src/logic/ConditionalPathFormula.cpp
-
25src/logic/ConditionalPathFormula.h
-
10src/logic/CumulativeRewardFormula.cpp
-
9src/logic/CumulativeRewardFormula.h
-
36src/logic/EventuallyFormula.cpp
-
14src/logic/EventuallyFormula.h
-
14src/logic/ExpectedTimeOperatorFormula.cpp
-
8src/logic/ExpectedTimeOperatorFormula.h
-
107src/logic/Formula.cpp
-
122src/logic/Formula.h
-
12src/logic/FormulaContext.h
-
46src/logic/FormulaInformation.cpp
-
34src/logic/FormulaInformation.h
-
85src/logic/FormulaInformationVisitor.cpp
-
38src/logic/FormulaInformationVisitor.h
-
36src/logic/FormulaVisitor.h
-
4src/logic/Formulas.h
-
36src/logic/FormulasForwardDeclarations.h
-
207src/logic/FragmentChecker.cpp
-
39src/logic/FragmentChecker.h
-
359src/logic/FragmentSpecification.cpp
-
153src/logic/FragmentSpecification.h
-
10src/logic/GloballyFormula.cpp
-
5src/logic/GloballyFormula.h
-
10src/logic/InstantaneousRewardFormula.cpp
-
8src/logic/InstantaneousRewardFormula.h
-
14src/logic/LongRunAverageOperatorFormula.cpp
-
4src/logic/LongRunAverageOperatorFormula.h
-
10src/logic/LongRunAverageRewardFormula.cpp
-
12src/logic/LongRunAverageRewardFormula.h
-
8src/logic/NextFormula.cpp
-
5src/logic/NextFormula.h
-
24src/logic/ProbabilityOperatorFormula.cpp
-
8src/logic/ProbabilityOperatorFormula.h
-
35src/logic/ReachabilityRewardFormula.cpp
-
36src/logic/ReachabilityRewardFormula.h
-
20src/logic/RewardOperatorFormula.cpp
-
6src/logic/RewardOperatorFormula.h
-
9src/logic/RewardPathFormula.cpp
-
19src/logic/RewardPathFormula.h
-
6src/logic/UnaryBooleanStateFormula.cpp
-
2src/logic/UnaryBooleanStateFormula.h
-
34src/logic/UnaryPathFormula.cpp
-
9src/logic/UnaryPathFormula.h
-
38src/logic/UnaryStateFormula.cpp
-
10src/logic/UnaryStateFormula.h
-
10src/logic/UntilFormula.cpp
-
3src/logic/UntilFormula.h
-
122src/modelchecker/AbstractModelChecker.cpp
-
9src/modelchecker/AbstractModelChecker.h
-
6src/modelchecker/CheckTask.h
-
10src/modelchecker/csl/HybridCtmcCslModelChecker.cpp
-
2src/modelchecker/csl/HybridCtmcCslModelChecker.h
-
10src/modelchecker/csl/SparseCtmcCslModelChecker.cpp
-
2src/modelchecker/csl/SparseCtmcCslModelChecker.h
-
14src/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.cpp
-
2src/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.h
-
10src/modelchecker/prctl/HybridDtmcPrctlModelChecker.cpp
-
2src/modelchecker/prctl/HybridDtmcPrctlModelChecker.h
-
19src/modelchecker/prctl/HybridMdpPrctlModelChecker.cpp
-
2src/modelchecker/prctl/HybridMdpPrctlModelChecker.h
-
52src/modelchecker/prctl/SparseDtmcPrctlModelChecker.cpp
-
10src/modelchecker/prctl/SparseDtmcPrctlModelChecker.h
-
37src/modelchecker/prctl/SparseMdpPrctlModelChecker.cpp
-
4src/modelchecker/prctl/SparseMdpPrctlModelChecker.h
-
20src/modelchecker/prctl/SymbolicDtmcPrctlModelChecker.cpp
-
2src/modelchecker/prctl/SymbolicDtmcPrctlModelChecker.h
-
19src/modelchecker/prctl/SymbolicMdpPrctlModelChecker.cpp
-
2src/modelchecker/prctl/SymbolicMdpPrctlModelChecker.h
-
120src/modelchecker/prctl/helper/SparseDtmcPrctlHelper.cpp
-
12src/modelchecker/prctl/helper/SparseDtmcPrctlHelper.h
-
14src/modelchecker/prctl/helper/SparseMdpPrctlHelper.cpp
@ -0,0 +1,9 @@ |
|||||
|
toplevel "A"; |
||||
|
"A" and "B" "C"; |
||||
|
"B" wsp "I" "J"; |
||||
|
"C" wsp "K" "L"; |
||||
|
"I" lambda=0.5 dorm=0.3; |
||||
|
"J" lambda=0.5 dorm=0.3; |
||||
|
"K" lambda=0.5 dorm=0.3; |
||||
|
"L" lambda=0.5 dorm=0.3; |
||||
|
|
@ -0,0 +1,59 @@ |
|||||
|
#include "src/logic/ConditionalFormula.h"
|
||||
|
#include "src/logic/FormulaVisitor.h"
|
||||
|
|
||||
|
#include "src/utility/macros.h"
|
||||
|
#include "src/exceptions/InvalidPropertyException.h"
|
||||
|
|
||||
|
namespace storm { |
||||
|
namespace logic { |
||||
|
ConditionalFormula::ConditionalFormula(std::shared_ptr<Formula const> const& subformula, std::shared_ptr<Formula const> const& conditionFormula, FormulaContext context) : subformula(subformula), conditionFormula(conditionFormula), context(context) { |
||||
|
STORM_LOG_THROW(context == FormulaContext::Probability || context == FormulaContext::Reward, storm::exceptions::InvalidPropertyException, "Invalid context for formula."); |
||||
|
} |
||||
|
|
||||
|
Formula const& ConditionalFormula::getSubformula() const { |
||||
|
return *subformula; |
||||
|
} |
||||
|
|
||||
|
Formula const& ConditionalFormula::getConditionFormula() const { |
||||
|
return *conditionFormula; |
||||
|
} |
||||
|
|
||||
|
bool ConditionalFormula::isConditionalProbabilityFormula() const { |
||||
|
return context == FormulaContext::Probability; |
||||
|
} |
||||
|
|
||||
|
bool ConditionalFormula::isConditionalRewardFormula() const { |
||||
|
return context == FormulaContext::Reward; |
||||
|
} |
||||
|
|
||||
|
boost::any ConditionalFormula::accept(FormulaVisitor const& visitor, boost::any const& data) const { |
||||
|
return visitor.visit(*this, data); |
||||
|
} |
||||
|
|
||||
|
std::shared_ptr<Formula> ConditionalFormula::substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const { |
||||
|
return std::make_shared<ConditionalFormula>(this->getSubformula().substitute(substitution), this->getConditionFormula().substitute(substitution), context); |
||||
|
} |
||||
|
|
||||
|
void ConditionalFormula::gatherAtomicExpressionFormulas(std::vector<std::shared_ptr<AtomicExpressionFormula const>>& atomicExpressionFormulas) const { |
||||
|
this->getSubformula().gatherAtomicExpressionFormulas(atomicExpressionFormulas); |
||||
|
this->getConditionFormula().gatherAtomicExpressionFormulas(atomicExpressionFormulas); |
||||
|
} |
||||
|
|
||||
|
void ConditionalFormula::gatherAtomicLabelFormulas(std::vector<std::shared_ptr<AtomicLabelFormula const>>& atomicLabelFormulas) const { |
||||
|
this->getSubformula().gatherAtomicLabelFormulas(atomicLabelFormulas); |
||||
|
this->getConditionFormula().gatherAtomicLabelFormulas(atomicLabelFormulas); |
||||
|
} |
||||
|
|
||||
|
void ConditionalFormula::gatherReferencedRewardModels(std::set<std::string>& referencedRewardModels) const { |
||||
|
this->getSubformula().gatherReferencedRewardModels(referencedRewardModels); |
||||
|
this->getConditionFormula().gatherReferencedRewardModels(referencedRewardModels); |
||||
|
} |
||||
|
|
||||
|
std::ostream& ConditionalFormula::writeToStream(std::ostream& out) const { |
||||
|
this->getSubformula().writeToStream(out); |
||||
|
out << " || "; |
||||
|
this->getConditionFormula().writeToStream(out); |
||||
|
return out; |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
#ifndef STORM_LOGIC_CONDITIONALFORMULA_H_ |
||||
|
#define STORM_LOGIC_CONDITIONALFORMULA_H_ |
||||
|
|
||||
|
#include "src/logic/BinaryPathFormula.h" |
||||
|
#include "src/logic/FormulaContext.h" |
||||
|
|
||||
|
namespace storm { |
||||
|
namespace logic { |
||||
|
class ConditionalFormula : public Formula { |
||||
|
public: |
||||
|
enum class Context { Probability, Reward }; |
||||
|
|
||||
|
ConditionalFormula(std::shared_ptr<Formula const> const& subformula, std::shared_ptr<Formula const> const& conditionFormula, FormulaContext context = FormulaContext::Probability); |
||||
|
|
||||
|
virtual ~ConditionalFormula() { |
||||
|
// Intentionally left empty. |
||||
|
} |
||||
|
|
||||
|
Formula const& getSubformula() const; |
||||
|
Formula const& getConditionFormula() const; |
||||
|
|
||||
|
virtual bool isConditionalProbabilityFormula() const override; |
||||
|
virtual bool isConditionalRewardFormula() const override; |
||||
|
|
||||
|
virtual boost::any accept(FormulaVisitor const& visitor, boost::any const& data) const override; |
||||
|
|
||||
|
virtual std::ostream& writeToStream(std::ostream& out) const override; |
||||
|
|
||||
|
virtual std::shared_ptr<Formula> substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const override; |
||||
|
|
||||
|
virtual void gatherAtomicExpressionFormulas(std::vector<std::shared_ptr<AtomicExpressionFormula const>>& atomicExpressionFormulas) const override; |
||||
|
virtual void gatherAtomicLabelFormulas(std::vector<std::shared_ptr<AtomicLabelFormula const>>& atomicLabelFormulas) const override; |
||||
|
virtual void gatherReferencedRewardModels(std::set<std::string>& referencedRewardModels) const override; |
||||
|
|
||||
|
private: |
||||
|
std::shared_ptr<Formula const> subformula; |
||||
|
std::shared_ptr<Formula const> conditionFormula; |
||||
|
FormulaContext context; |
||||
|
}; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#endif /* STORM_LOGIC_CONDITIONALFORMULA_H_ */ |
@ -1,24 +0,0 @@ |
|||||
#include "src/logic/ConditionalPathFormula.h"
|
|
||||
|
|
||||
namespace storm { |
|
||||
namespace logic { |
|
||||
ConditionalPathFormula::ConditionalPathFormula(std::shared_ptr<Formula const> const& leftSubformula, std::shared_ptr<Formula const> const& rightSubformula) : BinaryPathFormula(leftSubformula, rightSubformula) { |
|
||||
// Intentionally left empty.
|
|
||||
} |
|
||||
|
|
||||
bool ConditionalPathFormula::isConditionalPathFormula() const { |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
std::shared_ptr<Formula> ConditionalPathFormula::substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const { |
|
||||
return std::make_shared<ConditionalPathFormula>(this->getLeftSubformula().substitute(substitution), this->getRightSubformula().substitute(substitution)); |
|
||||
} |
|
||||
|
|
||||
std::ostream& ConditionalPathFormula::writeToStream(std::ostream& out) const { |
|
||||
this->getLeftSubformula().writeToStream(out); |
|
||||
out << " || "; |
|
||||
this->getRightSubformula().writeToStream(out); |
|
||||
return out; |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,25 +0,0 @@ |
|||||
#ifndef STORM_LOGIC_CONDITIONALPATHFORMULA_H_ |
|
||||
#define STORM_LOGIC_CONDITIONALPATHFORMULA_H_ |
|
||||
|
|
||||
#include "src/logic/BinaryPathFormula.h" |
|
||||
|
|
||||
namespace storm { |
|
||||
namespace logic { |
|
||||
class ConditionalPathFormula : public BinaryPathFormula { |
|
||||
public: |
|
||||
ConditionalPathFormula(std::shared_ptr<Formula const> const& leftSubformula, std::shared_ptr<Formula const> const& rightSubformula); |
|
||||
|
|
||||
virtual ~ConditionalPathFormula() { |
|
||||
// Intentionally left empty. |
|
||||
} |
|
||||
|
|
||||
virtual bool isConditionalPathFormula() const override; |
|
||||
|
|
||||
virtual std::ostream& writeToStream(std::ostream& out) const override; |
|
||||
|
|
||||
virtual std::shared_ptr<Formula> substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const override; |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
#endif /* STORM_LOGIC_CONDITIONALPATHFORMULA_H_ */ |
|
@ -0,0 +1,12 @@ |
|||||
|
#ifndef STORM_LOGIC_FORMULACONTEXT_H_ |
||||
|
#define STORM_LOGIC_FORMULACONTEXT_H_ |
||||
|
|
||||
|
namespace storm { |
||||
|
namespace logic { |
||||
|
|
||||
|
enum class FormulaContext { Undefined, Probability, Reward, LongRunAverage, ExpectedTime }; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#endif /* STORM_LOGIC_FORMULACONTEXT_H_ */ |
@ -0,0 +1,46 @@ |
|||||
|
#include "src/logic/FormulaInformation.h"
|
||||
|
|
||||
|
namespace storm { |
||||
|
namespace logic { |
||||
|
FormulaInformation::FormulaInformation() { |
||||
|
this->mContainsRewardOperator = false; |
||||
|
this->mContainsNextFormula = false; |
||||
|
this->mContainsBoundedUntilFormula = false; |
||||
|
} |
||||
|
|
||||
|
bool FormulaInformation::containsRewardOperator() const { |
||||
|
return this->mContainsRewardOperator; |
||||
|
} |
||||
|
|
||||
|
bool FormulaInformation::containsNextFormula() const { |
||||
|
return this->mContainsNextFormula; |
||||
|
} |
||||
|
|
||||
|
bool FormulaInformation::containsBoundedUntilFormula() const { |
||||
|
return this->mContainsBoundedUntilFormula; |
||||
|
} |
||||
|
|
||||
|
FormulaInformation FormulaInformation::join(FormulaInformation const& other) { |
||||
|
FormulaInformation result; |
||||
|
result.mContainsRewardOperator = this->containsRewardOperator() || other.containsRewardOperator(); |
||||
|
result.mContainsNextFormula = this->containsNextFormula() || other.containsNextFormula(); |
||||
|
result.mContainsBoundedUntilFormula = this->containsBoundedUntilFormula() || other.containsBoundedUntilFormula(); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
FormulaInformation& FormulaInformation::setContainsRewardOperator(bool newValue) { |
||||
|
this->mContainsRewardOperator = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
FormulaInformation& FormulaInformation::setContainsNextFormula(bool newValue) { |
||||
|
this->mContainsNextFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
FormulaInformation& FormulaInformation::setContainsBoundedUntilFormula(bool newValue) { |
||||
|
this->mContainsBoundedUntilFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
#ifndef STORM_LOGIC_FORMULAINFORMATION_H_ |
||||
|
#define STORM_LOGIC_FORMULAINFORMATION_H_ |
||||
|
|
||||
|
namespace storm { |
||||
|
namespace logic { |
||||
|
|
||||
|
class FormulaInformation { |
||||
|
public: |
||||
|
FormulaInformation(); |
||||
|
FormulaInformation(FormulaInformation const& other) = default; |
||||
|
FormulaInformation(FormulaInformation&& other) = default; |
||||
|
FormulaInformation& operator=(FormulaInformation const& other) = default; |
||||
|
FormulaInformation& operator=(FormulaInformation&& other) = default; |
||||
|
|
||||
|
bool containsRewardOperator() const; |
||||
|
bool containsNextFormula() const; |
||||
|
bool containsBoundedUntilFormula() const; |
||||
|
|
||||
|
FormulaInformation join(FormulaInformation const& other); |
||||
|
|
||||
|
FormulaInformation& setContainsRewardOperator(bool newValue = true); |
||||
|
FormulaInformation& setContainsNextFormula(bool newValue = true); |
||||
|
FormulaInformation& setContainsBoundedUntilFormula(bool newValue = true); |
||||
|
|
||||
|
private: |
||||
|
bool mContainsRewardOperator; |
||||
|
bool mContainsNextFormula; |
||||
|
bool mContainsBoundedUntilFormula; |
||||
|
}; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#endif /* STORM_LOGIC_FORMULAINFORMATION_H_ */ |
@ -0,0 +1,85 @@ |
|||||
|
#include "src/logic/FormulaInformationVisitor.h"
|
||||
|
|
||||
|
#include "src/logic/Formulas.h"
|
||||
|
|
||||
|
namespace storm { |
||||
|
namespace logic { |
||||
|
FormulaInformation FormulaInformationVisitor::getInformation(Formula const& f) const { |
||||
|
boost::any result = f.accept(*this, boost::any()); |
||||
|
return boost::any_cast<FormulaInformation>(result); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(AtomicExpressionFormula const& f, boost::any const& data) const { |
||||
|
return FormulaInformation(); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(AtomicLabelFormula const& f, boost::any const& data) const { |
||||
|
return FormulaInformation(); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(BinaryBooleanStateFormula const& f, boost::any const& data) const { |
||||
|
return FormulaInformation(); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(BooleanLiteralFormula const& f, boost::any const& data) const { |
||||
|
return FormulaInformation(); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(BoundedUntilFormula const& f, boost::any const& data) const { |
||||
|
return boost::any_cast<FormulaInformation>(f.getLeftSubformula().accept(*this)).join(boost::any_cast<FormulaInformation>(f.getRightSubformula().accept(*this))).setContainsBoundedUntilFormula(); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(ConditionalFormula const& f, boost::any const& data) const { |
||||
|
return boost::any_cast<FormulaInformation>(f.getSubformula().accept(*this)).join(boost::any_cast<FormulaInformation>(f.getConditionFormula().accept(*this))); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(CumulativeRewardFormula const& f, boost::any const& data) const { |
||||
|
return FormulaInformation(); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(EventuallyFormula const& f, boost::any const& data) const { |
||||
|
return f.getSubformula().accept(*this); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(ExpectedTimeOperatorFormula const& f, boost::any const& data) const { |
||||
|
return f.getSubformula().accept(*this); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(GloballyFormula const& f, boost::any const& data) const { |
||||
|
return f.getSubformula().accept(*this); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(InstantaneousRewardFormula const& f, boost::any const& data) const { |
||||
|
return FormulaInformation(); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(LongRunAverageOperatorFormula const& f, boost::any const& data) const { |
||||
|
return f.getSubformula().accept(*this); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(LongRunAverageRewardFormula const& f, boost::any const& data) const { |
||||
|
return FormulaInformation(); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(NextFormula const& f, boost::any const& data) const { |
||||
|
return boost::any_cast<FormulaInformation>(f.getSubformula().accept(*this)).setContainsNextFormula(); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(ProbabilityOperatorFormula const& f, boost::any const& data) const { |
||||
|
return f.getSubformula().accept(*this); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(RewardOperatorFormula const& f, boost::any const& data) const { |
||||
|
return boost::any_cast<FormulaInformation>(f.getSubformula().accept(*this)).setContainsRewardOperator(); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(UnaryBooleanStateFormula const& f, boost::any const& data) const { |
||||
|
return f.getSubformula().accept(*this); |
||||
|
} |
||||
|
|
||||
|
boost::any FormulaInformationVisitor::visit(UntilFormula const& f, boost::any const& data) const { |
||||
|
return boost::any_cast<FormulaInformation>(f.getLeftSubformula().accept(*this)).join(boost::any_cast<FormulaInformation>(f.getRightSubformula().accept(*this))); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,38 @@ |
|||||
|
#ifndef STORM_LOGIC_FORMULAINFORMATIONVISITOR_H_ |
||||
|
#define STORM_LOGIC_FORMULAINFORMATIONVISITOR_H_ |
||||
|
|
||||
|
#include "src/logic/FormulaVisitor.h" |
||||
|
#include "src/logic/FormulaInformation.h" |
||||
|
|
||||
|
namespace storm { |
||||
|
namespace logic { |
||||
|
|
||||
|
class FormulaInformationVisitor : public FormulaVisitor { |
||||
|
public: |
||||
|
FormulaInformation getInformation(Formula const& f) const; |
||||
|
|
||||
|
virtual boost::any visit(AtomicExpressionFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(AtomicLabelFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(BinaryBooleanStateFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(BooleanLiteralFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(BoundedUntilFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(ConditionalFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(CumulativeRewardFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(EventuallyFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(ExpectedTimeOperatorFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(GloballyFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(InstantaneousRewardFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(LongRunAverageOperatorFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(LongRunAverageRewardFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(NextFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(ProbabilityOperatorFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(RewardOperatorFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(UnaryBooleanStateFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(UntilFormula const& f, boost::any const& data) const override; |
||||
|
}; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
#endif /* STORM_LOGIC_FORMULAINFORMATIONVISITOR_H_ */ |
@ -0,0 +1,36 @@ |
|||||
|
#ifndef STORM_LOGIC_FORMULAVISITOR_H_ |
||||
|
#define STORM_LOGIC_FORMULAVISITOR_H_ |
||||
|
|
||||
|
#include <boost/any.hpp> |
||||
|
|
||||
|
#include "src/logic/FormulasForwardDeclarations.h" |
||||
|
|
||||
|
namespace storm { |
||||
|
namespace logic { |
||||
|
|
||||
|
class FormulaVisitor { |
||||
|
public: |
||||
|
virtual boost::any visit(AtomicExpressionFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(AtomicLabelFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(BinaryBooleanStateFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(BooleanLiteralFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(BoundedUntilFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(ConditionalFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(CumulativeRewardFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(EventuallyFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(ExpectedTimeOperatorFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(GloballyFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(InstantaneousRewardFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(LongRunAverageOperatorFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(LongRunAverageRewardFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(NextFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(ProbabilityOperatorFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(RewardOperatorFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(UnaryBooleanStateFormula const& f, boost::any const& data) const = 0; |
||||
|
virtual boost::any visit(UntilFormula const& f, boost::any const& data) const = 0; |
||||
|
}; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#endif /* STORM_LOGIC_FORMULAVISITOR_H_ */ |
@ -0,0 +1,36 @@ |
|||||
|
#ifndef STORM_LOGIC_FORMULASFORWARDDECLARATIONS_H_ |
||||
|
#define STORM_LOGIC_FORMULASFORWARDDECLARATIONS_H_ |
||||
|
|
||||
|
namespace storm { |
||||
|
namespace logic { |
||||
|
// Forward-declare all formula classes. |
||||
|
class Formula; |
||||
|
class AtomicExpressionFormula; |
||||
|
class AtomicLabelFormula; |
||||
|
class BinaryBooleanStateFormula; |
||||
|
class BinaryPathFormula; |
||||
|
class BinaryStateFormula; |
||||
|
class BooleanLiteralFormula; |
||||
|
class BoundedUntilFormula; |
||||
|
class ConditionalFormula; |
||||
|
class CumulativeRewardFormula; |
||||
|
class EventuallyFormula; |
||||
|
class ExpectedTimeOperatorFormula; |
||||
|
class GloballyFormula; |
||||
|
class InstantaneousRewardFormula; |
||||
|
class LongRunAverageOperatorFormula; |
||||
|
class LongRunAverageRewardFormula; |
||||
|
class NextFormula; |
||||
|
class OperatorFormula; |
||||
|
class PathFormula; |
||||
|
class ProbabilityOperatorFormula; |
||||
|
class RewardOperatorFormula; |
||||
|
class StateFormula; |
||||
|
class UnaryBooleanStateFormula; |
||||
|
class UnaryPathFormula; |
||||
|
class UnaryStateFormula; |
||||
|
class UntilFormula; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#endif /* STORM_LOGIC_FORMULASFORWARDDECLARATIONS_H_ */ |
@ -0,0 +1,207 @@ |
|||||
|
#include "src/logic/FragmentChecker.h"
|
||||
|
|
||||
|
#include "src/logic/Formulas.h"
|
||||
|
|
||||
|
namespace storm { |
||||
|
namespace logic { |
||||
|
class InheritedInformation { |
||||
|
public: |
||||
|
InheritedInformation(FragmentSpecification const& fragmentSpecification) : fragmentSpecification(fragmentSpecification) { |
||||
|
// Intentionally left empty.
|
||||
|
} |
||||
|
|
||||
|
FragmentSpecification const& getSpecification() const { |
||||
|
return fragmentSpecification; |
||||
|
} |
||||
|
|
||||
|
private: |
||||
|
FragmentSpecification const& fragmentSpecification; |
||||
|
}; |
||||
|
|
||||
|
bool FragmentChecker::conformsToSpecification(Formula const& f, FragmentSpecification const& specification) const { |
||||
|
boost::any result = f.accept(*this, InheritedInformation(specification)); |
||||
|
return boost::any_cast<bool>(result); |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(AtomicExpressionFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
return inherited.getSpecification().areAtomicExpressionFormulasAllowed(); |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(AtomicLabelFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
return inherited.getSpecification().areAtomicLabelFormulasAllowed(); |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(BinaryBooleanStateFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
bool result = inherited.getSpecification().areBinaryBooleanStateFormulasAllowed(); |
||||
|
result = result && boost::any_cast<bool>(f.getLeftSubformula().accept(*this, data)); |
||||
|
result = result && boost::any_cast<bool>(f.getRightSubformula().accept(*this, data)); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(BooleanLiteralFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
return inherited.getSpecification().areBooleanLiteralFormulasAllowed(); |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(BoundedUntilFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
bool result = inherited.getSpecification().areBoundedUntilFormulasAllowed(); |
||||
|
if (!inherited.getSpecification().areNestedPathFormulasAllowed()) { |
||||
|
result = result && !f.getLeftSubformula().isPathFormula(); |
||||
|
result = result && !f.getRightSubformula().isPathFormula(); |
||||
|
} |
||||
|
if (f.hasDiscreteTimeBound()) { |
||||
|
result = result && inherited.getSpecification().areStepBoundedUntilFormulasAllowed(); |
||||
|
} else { |
||||
|
result = result && inherited.getSpecification().areTimeBoundedUntilFormulasAllowed(); |
||||
|
} |
||||
|
result = result && boost::any_cast<bool>(f.getLeftSubformula().accept(*this, data)); |
||||
|
result = result && boost::any_cast<bool>(f.getRightSubformula().accept(*this, data)); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(ConditionalFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
bool result = true; |
||||
|
if (f.isConditionalProbabilityFormula()) { |
||||
|
result = result && inherited.getSpecification().areConditionalProbabilityFormulasAllowed(); |
||||
|
} else if (f.isConditionalRewardFormula()) { |
||||
|
result = result && inherited.getSpecification().areConditionalRewardFormulasFormulasAllowed(); |
||||
|
} |
||||
|
if (inherited.getSpecification().areOnlyEventuallyFormuluasInConditionalFormulasAllowed()) { |
||||
|
if (f.isConditionalProbabilityFormula()) { |
||||
|
result = result && f.getSubformula().isEventuallyFormula() && f.getConditionFormula().isEventuallyFormula(); |
||||
|
} else if (f.isConditionalRewardFormula()) { |
||||
|
result = result && f.getSubformula().isReachabilityRewardFormula() && f.getConditionFormula().isEventuallyFormula(); |
||||
|
} |
||||
|
} |
||||
|
result = result && boost::any_cast<bool>(f.getSubformula().accept(*this, data)); |
||||
|
result = result && boost::any_cast<bool>(f.getConditionFormula().accept(*this, data)); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(CumulativeRewardFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
return inherited.getSpecification().areCumulativeRewardFormulasAllowed(); |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(EventuallyFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
bool result = true; |
||||
|
if (f.isEventuallyFormula()) { |
||||
|
result = inherited.getSpecification().areEventuallyFormulasAllowed(); |
||||
|
if (!inherited.getSpecification().areNestedPathFormulasAllowed()) { |
||||
|
result = result && !f.getSubformula().isPathFormula(); |
||||
|
} |
||||
|
} else if (f.isReachabilityRewardFormula()) { |
||||
|
result = result && inherited.getSpecification().areReachabilityRewardFormulasAllowed(); |
||||
|
result = result && f.getSubformula().isStateFormula(); |
||||
|
} else if (f.isReachbilityExpectedTimeFormula()) { |
||||
|
result = result && inherited.getSpecification().areReachbilityExpectedTimeFormulasAllowed(); |
||||
|
result = result && f.getSubformula().isStateFormula(); |
||||
|
} |
||||
|
result = result && boost::any_cast<bool>(f.getSubformula().accept(*this, data)); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(ExpectedTimeOperatorFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
bool result = inherited.getSpecification().areExpectedTimeOperatorsAllowed(); |
||||
|
result = result && f.getSubformula().isExpectedTimePathFormula(); |
||||
|
if (!inherited.getSpecification().areNestedOperatorsAllowed()) { |
||||
|
result = result && boost::any_cast<bool>(f.getSubformula().accept(*this, InheritedInformation(inherited.getSpecification().copy().setOperatorsAllowed(false)))); |
||||
|
} else { |
||||
|
result = result && boost::any_cast<bool>(f.getSubformula().accept(*this, data)); |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(GloballyFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
bool result = inherited.getSpecification().areGloballyFormulasAllowed(); |
||||
|
if (!inherited.getSpecification().areNestedPathFormulasAllowed()) { |
||||
|
result = result && !f.getSubformula().isPathFormula(); |
||||
|
} |
||||
|
result && boost::any_cast<bool>(f.getSubformula().accept(*this, data)); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(InstantaneousRewardFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
return inherited.getSpecification().areInstantaneousRewardFormulasAllowed(); |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(LongRunAverageOperatorFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
bool result = inherited.getSpecification().areLongRunAverageOperatorsAllowed(); |
||||
|
result = result && f.getSubformula().isStateFormula(); |
||||
|
if (!inherited.getSpecification().areNestedOperatorsAllowed()) { |
||||
|
result = result && boost::any_cast<bool>(f.getSubformula().accept(*this, InheritedInformation(inherited.getSpecification().copy().setOperatorsAllowed(false)))); |
||||
|
} else { |
||||
|
result = result && boost::any_cast<bool>(f.getSubformula().accept(*this, data)); |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(LongRunAverageRewardFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
return inherited.getSpecification().areLongRunAverageRewardFormulasAllowed(); |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(NextFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
bool result = inherited.getSpecification().areNextFormulasAllowed(); |
||||
|
if (!inherited.getSpecification().areNestedPathFormulasAllowed()) { |
||||
|
result = result && !f.getSubformula().isPathFormula(); |
||||
|
} |
||||
|
result && boost::any_cast<bool>(f.getSubformula().accept(*this, data)); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(ProbabilityOperatorFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
bool result = inherited.getSpecification().areProbabilityOperatorsAllowed(); |
||||
|
result = result && (f.getSubformula().isProbabilityPathFormula() || f.getSubformula().isConditionalProbabilityFormula()); |
||||
|
if (!inherited.getSpecification().areNestedOperatorsAllowed()) { |
||||
|
result = result && boost::any_cast<bool>(f.getSubformula().accept(*this, InheritedInformation(inherited.getSpecification().copy().setOperatorsAllowed(false)))); |
||||
|
} else { |
||||
|
result = result && boost::any_cast<bool>(f.getSubformula().accept(*this, data)); |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(RewardOperatorFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
bool result = inherited.getSpecification().areRewardOperatorsAllowed(); |
||||
|
result = result && (f.getSubformula().isRewardPathFormula() || f.getSubformula().isConditionalRewardFormula()); |
||||
|
if (!inherited.getSpecification().areNestedOperatorsAllowed()) { |
||||
|
result = result && boost::any_cast<bool>(f.getSubformula().accept(*this, InheritedInformation(inherited.getSpecification().copy().setOperatorsAllowed(false)))); |
||||
|
} else { |
||||
|
result = result && boost::any_cast<bool>(f.getSubformula().accept(*this, data)); |
||||
|
} |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(UnaryBooleanStateFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
bool result = inherited.getSpecification().areUnaryBooleanStateFormulasAllowed(); |
||||
|
result = result && boost::any_cast<bool>(f.getSubformula().accept(*this, data)); |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
boost::any FragmentChecker::visit(UntilFormula const& f, boost::any const& data) const { |
||||
|
InheritedInformation const& inherited = boost::any_cast<InheritedInformation const&>(data); |
||||
|
bool result = inherited.getSpecification().areUntilFormulasAllowed(); |
||||
|
if (!inherited.getSpecification().areNestedPathFormulasAllowed()) { |
||||
|
result = result && !f.getLeftSubformula().isPathFormula(); |
||||
|
result = result && !f.getRightSubformula().isPathFormula(); |
||||
|
} |
||||
|
result = result && boost::any_cast<bool>(f.getLeftSubformula().accept(*this, data)); |
||||
|
result = result && boost::any_cast<bool>(f.getRightSubformula().accept(*this, data)); |
||||
|
return result; |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,39 @@ |
|||||
|
#ifndef STORM_LOGIC_FRAGMENTCHECKER_H_ |
||||
|
#define STORM_LOGIC_FRAGMENTCHECKER_H_ |
||||
|
|
||||
|
#include "src/logic/FormulaVisitor.h" |
||||
|
|
||||
|
#include "src/logic/FragmentSpecification.h" |
||||
|
|
||||
|
namespace storm { |
||||
|
namespace logic { |
||||
|
|
||||
|
class FragmentChecker : public FormulaVisitor { |
||||
|
public: |
||||
|
bool conformsToSpecification(Formula const& f, FragmentSpecification const& specification) const; |
||||
|
|
||||
|
virtual boost::any visit(AtomicExpressionFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(AtomicLabelFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(BinaryBooleanStateFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(BooleanLiteralFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(BoundedUntilFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(ConditionalFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(CumulativeRewardFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(EventuallyFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(ExpectedTimeOperatorFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(GloballyFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(InstantaneousRewardFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(LongRunAverageOperatorFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(LongRunAverageRewardFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(NextFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(ProbabilityOperatorFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(RewardOperatorFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(UnaryBooleanStateFormula const& f, boost::any const& data) const override; |
||||
|
virtual boost::any visit(UntilFormula const& f, boost::any const& data) const override; |
||||
|
}; |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
#endif /* STORM_LOGIC_FRAGMENTCHECKER_H_ */ |
@ -0,0 +1,359 @@ |
|||||
|
#include "src/logic/FragmentSpecification.h"
|
||||
|
|
||||
|
#include <iostream>
|
||||
|
|
||||
|
namespace storm { |
||||
|
namespace logic { |
||||
|
|
||||
|
FragmentSpecification propositional() { |
||||
|
FragmentSpecification propositional; |
||||
|
|
||||
|
propositional.setBooleanLiteralFormulasAllowed(true); |
||||
|
propositional.setBinaryBooleanStateFormulasAllowed(true); |
||||
|
propositional.setUnaryBooleanStateFormulasAllowed(true); |
||||
|
propositional.setAtomicExpressionFormulasAllowed(true); |
||||
|
propositional.setAtomicLabelFormulasAllowed(true); |
||||
|
|
||||
|
return propositional; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification pctl() { |
||||
|
FragmentSpecification pctl = propositional(); |
||||
|
|
||||
|
pctl.setProbabilityOperatorsAllowed(true); |
||||
|
pctl.setGloballyFormulasAllowed(true); |
||||
|
pctl.setEventuallyFormulasAllowed(true); |
||||
|
pctl.setNextFormulasAllowed(true); |
||||
|
pctl.setUntilFormulasAllowed(true); |
||||
|
pctl.setBoundedUntilFormulasAllowed(true); |
||||
|
pctl.setStepBoundedUntilFormulasAllowed(true); |
||||
|
|
||||
|
return pctl; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification prctl() { |
||||
|
FragmentSpecification prctl = pctl(); |
||||
|
|
||||
|
prctl.setRewardOperatorsAllowed(true); |
||||
|
prctl.setCumulativeRewardFormulasAllowed(true); |
||||
|
prctl.setInstantaneousFormulasAllowed(true); |
||||
|
prctl.setReachabilityRewardFormulasAllowed(true); |
||||
|
prctl.setLongRunAverageOperatorsAllowed(true); |
||||
|
|
||||
|
return prctl; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification csl() { |
||||
|
FragmentSpecification csl = pctl(); |
||||
|
|
||||
|
csl.setTimeBoundedUntilFormulasAllowed(true); |
||||
|
|
||||
|
return csl; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification csrl() { |
||||
|
FragmentSpecification csrl = csl(); |
||||
|
|
||||
|
csrl.setRewardOperatorsAllowed(true); |
||||
|
csrl.setCumulativeRewardFormulasAllowed(true); |
||||
|
csrl.setInstantaneousFormulasAllowed(true); |
||||
|
csrl.setReachabilityRewardFormulasAllowed(true); |
||||
|
csrl.setLongRunAverageOperatorsAllowed(true); |
||||
|
|
||||
|
return csrl; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification::FragmentSpecification() { |
||||
|
probabilityOperator = false; |
||||
|
rewardOperator = false; |
||||
|
expectedTimeOperator = false; |
||||
|
longRunAverageOperator = false; |
||||
|
|
||||
|
globallyFormula = false; |
||||
|
eventuallyFormula = false; |
||||
|
nextFormula = false; |
||||
|
untilFormula = false; |
||||
|
boundedUntilFormula = false; |
||||
|
|
||||
|
atomicExpressionFormula = false; |
||||
|
atomicLabelFormula = false; |
||||
|
booleanLiteralFormula = false; |
||||
|
unaryBooleanStateFormula = false; |
||||
|
binaryBooleanStateFormula = false; |
||||
|
|
||||
|
cumulativeRewardFormula = false; |
||||
|
instantaneousRewardFormula = false; |
||||
|
reachabilityRewardFormula = false; |
||||
|
longRunAverageRewardFormula = false; |
||||
|
|
||||
|
conditionalProbabilityFormula = false; |
||||
|
conditionalRewardFormula = false; |
||||
|
|
||||
|
reachabilityExpectedTimeFormula = false; |
||||
|
|
||||
|
nestedOperators = true; |
||||
|
nestedPathFormulas = false; |
||||
|
onlyEventuallyFormuluasInConditionalFormulas = true; |
||||
|
stepBoundedUntilFormulas = false; |
||||
|
timeBoundedUntilFormulas = false; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification FragmentSpecification::copy() const { |
||||
|
return FragmentSpecification(*this); |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areProbabilityOperatorsAllowed() const { |
||||
|
return probabilityOperator; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setProbabilityOperatorsAllowed(bool newValue) { |
||||
|
this->probabilityOperator = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areRewardOperatorsAllowed() const { |
||||
|
return rewardOperator; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setRewardOperatorsAllowed(bool newValue) { |
||||
|
this->rewardOperator = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areExpectedTimeOperatorsAllowed() const { |
||||
|
return expectedTimeOperator; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setExpectedTimeOperatorsAllowed(bool newValue) { |
||||
|
this->expectedTimeOperator = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areLongRunAverageOperatorsAllowed() const { |
||||
|
return longRunAverageOperator; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setLongRunAverageOperatorsAllowed(bool newValue) { |
||||
|
this->longRunAverageOperator = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areGloballyFormulasAllowed() const { |
||||
|
return globallyFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setGloballyFormulasAllowed(bool newValue) { |
||||
|
this->globallyFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areEventuallyFormulasAllowed() const { |
||||
|
return eventuallyFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setEventuallyFormulasAllowed(bool newValue) { |
||||
|
this->eventuallyFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areNextFormulasAllowed() const { |
||||
|
return nextFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setNextFormulasAllowed(bool newValue) { |
||||
|
this->nextFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areUntilFormulasAllowed() const { |
||||
|
return untilFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setUntilFormulasAllowed(bool newValue) { |
||||
|
this->untilFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areBoundedUntilFormulasAllowed() const { |
||||
|
return boundedUntilFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setBoundedUntilFormulasAllowed(bool newValue) { |
||||
|
this->boundedUntilFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areAtomicExpressionFormulasAllowed() const { |
||||
|
return atomicExpressionFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setAtomicExpressionFormulasAllowed(bool newValue) { |
||||
|
this->atomicExpressionFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areAtomicLabelFormulasAllowed() const { |
||||
|
return atomicLabelFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setAtomicLabelFormulasAllowed(bool newValue) { |
||||
|
this->atomicLabelFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areBooleanLiteralFormulasAllowed() const { |
||||
|
return booleanLiteralFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setBooleanLiteralFormulasAllowed(bool newValue) { |
||||
|
this->booleanLiteralFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areUnaryBooleanStateFormulasAllowed() const { |
||||
|
return unaryBooleanStateFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setUnaryBooleanStateFormulasAllowed(bool newValue) { |
||||
|
this->unaryBooleanStateFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areBinaryBooleanStateFormulasAllowed() const { |
||||
|
return binaryBooleanStateFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setBinaryBooleanStateFormulasAllowed(bool newValue) { |
||||
|
this->binaryBooleanStateFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areCumulativeRewardFormulasAllowed() const { |
||||
|
return cumulativeRewardFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setCumulativeRewardFormulasAllowed(bool newValue) { |
||||
|
this->cumulativeRewardFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areInstantaneousRewardFormulasAllowed() const { |
||||
|
return instantaneousRewardFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setInstantaneousFormulasAllowed(bool newValue) { |
||||
|
this->instantaneousRewardFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areReachabilityRewardFormulasAllowed() const { |
||||
|
return reachabilityRewardFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setReachabilityRewardFormulasAllowed(bool newValue) { |
||||
|
this->reachabilityRewardFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areLongRunAverageRewardFormulasAllowed() const { |
||||
|
return longRunAverageRewardFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setLongRunAverageRewardFormulasAllowed(bool newValue) { |
||||
|
this->longRunAverageRewardFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areConditionalProbabilityFormulasAllowed() const { |
||||
|
return conditionalProbabilityFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setConditionalProbabilityFormulasAllowed(bool newValue) { |
||||
|
this->conditionalProbabilityFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areConditionalRewardFormulasFormulasAllowed() const { |
||||
|
return conditionalRewardFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setConditionalRewardFormulasAllowed(bool newValue) { |
||||
|
this->conditionalRewardFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areReachbilityExpectedTimeFormulasAllowed() const { |
||||
|
return reachabilityExpectedTimeFormula; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setReachbilityExpectedTimeFormulasAllowed(bool newValue) { |
||||
|
this->reachabilityExpectedTimeFormula = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areNestedOperatorsAllowed() const { |
||||
|
return this->nestedOperators; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setNestedOperatorsAllowed(bool newValue) { |
||||
|
this->nestedOperators = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areNestedPathFormulasAllowed() const { |
||||
|
return this->nestedPathFormulas; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setNestedPathFormulasAllowed(bool newValue) { |
||||
|
this->nestedPathFormulas = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areOnlyEventuallyFormuluasInConditionalFormulasAllowed() const { |
||||
|
return this->onlyEventuallyFormuluasInConditionalFormulas; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setOnlyEventuallyFormuluasInConditionalFormulasAllowed(bool newValue) { |
||||
|
this->onlyEventuallyFormuluasInConditionalFormulas = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areStepBoundedUntilFormulasAllowed() const { |
||||
|
return this->stepBoundedUntilFormulas; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setStepBoundedUntilFormulasAllowed(bool newValue) { |
||||
|
this->stepBoundedUntilFormulas = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
bool FragmentSpecification::areTimeBoundedUntilFormulasAllowed() const { |
||||
|
return this->timeBoundedUntilFormulas; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setTimeBoundedUntilFormulasAllowed(bool newValue) { |
||||
|
this->timeBoundedUntilFormulas = newValue; |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setOperatorsAllowed(bool newValue) { |
||||
|
this->setProbabilityOperatorsAllowed(newValue); |
||||
|
this->setRewardOperatorsAllowed(newValue); |
||||
|
this->setLongRunAverageOperatorsAllowed(newValue); |
||||
|
this->setExpectedTimeOperatorsAllowed(newValue); |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setExpectedTimeAllowed(bool newValue) { |
||||
|
this->setExpectedTimeOperatorsAllowed(newValue); |
||||
|
this->setReachbilityExpectedTimeFormulasAllowed(newValue); |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
FragmentSpecification& FragmentSpecification::setLongRunAverageProbabilitiesAllowed(bool newValue) { |
||||
|
this->setLongRunAverageOperatorsAllowed(newValue); |
||||
|
return *this; |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,153 @@ |
|||||
|
#ifndef STORM_LOGIC_FRAGMENTSPECIFICATION_H_ |
||||
|
#define STORM_LOGIC_FRAGMENTSPECIFICATION_H_ |
||||
|
|
||||
|
namespace storm { |
||||
|
namespace logic { |
||||
|
class FragmentSpecification { |
||||
|
public: |
||||
|
FragmentSpecification(); |
||||
|
FragmentSpecification(FragmentSpecification const& other) = default; |
||||
|
FragmentSpecification(FragmentSpecification&& other) = default; |
||||
|
FragmentSpecification& operator=(FragmentSpecification const& other) = default; |
||||
|
FragmentSpecification& operator=(FragmentSpecification&& other) = default; |
||||
|
|
||||
|
FragmentSpecification copy() const; |
||||
|
|
||||
|
bool areProbabilityOperatorsAllowed() const; |
||||
|
FragmentSpecification& setProbabilityOperatorsAllowed(bool newValue); |
||||
|
|
||||
|
bool areRewardOperatorsAllowed() const; |
||||
|
FragmentSpecification& setRewardOperatorsAllowed(bool newValue); |
||||
|
|
||||
|
bool areExpectedTimeOperatorsAllowed() const; |
||||
|
FragmentSpecification& setExpectedTimeOperatorsAllowed(bool newValue); |
||||
|
|
||||
|
bool areLongRunAverageOperatorsAllowed() const; |
||||
|
FragmentSpecification& setLongRunAverageOperatorsAllowed(bool newValue); |
||||
|
|
||||
|
bool areGloballyFormulasAllowed() const; |
||||
|
FragmentSpecification& setGloballyFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areEventuallyFormulasAllowed() const; |
||||
|
FragmentSpecification& setEventuallyFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areNextFormulasAllowed() const; |
||||
|
FragmentSpecification& setNextFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areUntilFormulasAllowed() const; |
||||
|
FragmentSpecification& setUntilFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areBoundedUntilFormulasAllowed() const; |
||||
|
FragmentSpecification& setBoundedUntilFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areAtomicExpressionFormulasAllowed() const; |
||||
|
FragmentSpecification& setAtomicExpressionFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areAtomicLabelFormulasAllowed() const; |
||||
|
FragmentSpecification& setAtomicLabelFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areBooleanLiteralFormulasAllowed() const; |
||||
|
FragmentSpecification& setBooleanLiteralFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areUnaryBooleanStateFormulasAllowed() const; |
||||
|
FragmentSpecification& setUnaryBooleanStateFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areBinaryBooleanStateFormulasAllowed() const; |
||||
|
FragmentSpecification& setBinaryBooleanStateFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areCumulativeRewardFormulasAllowed() const; |
||||
|
FragmentSpecification& setCumulativeRewardFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areInstantaneousRewardFormulasAllowed() const; |
||||
|
FragmentSpecification& setInstantaneousFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areReachabilityRewardFormulasAllowed() const; |
||||
|
FragmentSpecification& setReachabilityRewardFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areLongRunAverageRewardFormulasAllowed() const; |
||||
|
FragmentSpecification& setLongRunAverageRewardFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areConditionalProbabilityFormulasAllowed() const; |
||||
|
FragmentSpecification& setConditionalProbabilityFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areConditionalRewardFormulasFormulasAllowed() const; |
||||
|
FragmentSpecification& setConditionalRewardFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areReachbilityExpectedTimeFormulasAllowed() const; |
||||
|
FragmentSpecification& setReachbilityExpectedTimeFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areNestedOperatorsAllowed() const; |
||||
|
FragmentSpecification& setNestedOperatorsAllowed(bool newValue); |
||||
|
|
||||
|
bool areNestedPathFormulasAllowed() const; |
||||
|
FragmentSpecification& setNestedPathFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areOnlyEventuallyFormuluasInConditionalFormulasAllowed() const; |
||||
|
FragmentSpecification& setOnlyEventuallyFormuluasInConditionalFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areStepBoundedUntilFormulasAllowed() const; |
||||
|
FragmentSpecification& setStepBoundedUntilFormulasAllowed(bool newValue); |
||||
|
|
||||
|
bool areTimeBoundedUntilFormulasAllowed() const; |
||||
|
FragmentSpecification& setTimeBoundedUntilFormulasAllowed(bool newValue); |
||||
|
|
||||
|
FragmentSpecification& setOperatorsAllowed(bool newValue); |
||||
|
FragmentSpecification& setExpectedTimeAllowed(bool newValue); |
||||
|
FragmentSpecification& setLongRunAverageProbabilitiesAllowed(bool newValue); |
||||
|
|
||||
|
private: |
||||
|
// Flags that indicate whether it is legal to see such a formula. |
||||
|
bool probabilityOperator; |
||||
|
bool rewardOperator; |
||||
|
bool expectedTimeOperator; |
||||
|
bool longRunAverageOperator; |
||||
|
|
||||
|
bool globallyFormula; |
||||
|
bool eventuallyFormula; |
||||
|
bool nextFormula; |
||||
|
bool untilFormula; |
||||
|
bool boundedUntilFormula; |
||||
|
|
||||
|
bool atomicExpressionFormula; |
||||
|
bool atomicLabelFormula; |
||||
|
bool booleanLiteralFormula; |
||||
|
bool unaryBooleanStateFormula; |
||||
|
bool binaryBooleanStateFormula; |
||||
|
|
||||
|
bool cumulativeRewardFormula; |
||||
|
bool instantaneousRewardFormula; |
||||
|
bool reachabilityRewardFormula; |
||||
|
bool longRunAverageRewardFormula; |
||||
|
|
||||
|
bool conditionalProbabilityFormula; |
||||
|
bool conditionalRewardFormula; |
||||
|
|
||||
|
bool reachabilityExpectedTimeFormula; |
||||
|
|
||||
|
// Members that indicate certain restrictions. |
||||
|
bool nestedOperators; |
||||
|
bool nestedPathFormulas; |
||||
|
bool onlyEventuallyFormuluasInConditionalFormulas; |
||||
|
bool stepBoundedUntilFormulas; |
||||
|
bool timeBoundedUntilFormulas; |
||||
|
}; |
||||
|
|
||||
|
// Propositional. |
||||
|
FragmentSpecification propositional(); |
||||
|
|
||||
|
// Regular PCTL. |
||||
|
FragmentSpecification pctl(); |
||||
|
|
||||
|
// PCTL + cumulative, instantaneous, reachability and long-run rewards. |
||||
|
FragmentSpecification prctl(); |
||||
|
|
||||
|
// Regular CSL. |
||||
|
FragmentSpecification csl(); |
||||
|
|
||||
|
// CSL + cumulative, instantaneous, reachability and long-run rewards. |
||||
|
FragmentSpecification csrl(); |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#endif /* STORM_LOGIC_FRAGMENTSPECIFICATION_H_ */ |
@ -1,35 +0,0 @@ |
|||||
#include "src/logic/ReachabilityRewardFormula.h"
|
|
||||
|
|
||||
namespace storm { |
|
||||
namespace logic { |
|
||||
ReachabilityRewardFormula::ReachabilityRewardFormula(std::shared_ptr<Formula const> const& subformula) : subformula(subformula) { |
|
||||
// Intentionally left empty.
|
|
||||
} |
|
||||
|
|
||||
bool ReachabilityRewardFormula::isReachabilityRewardFormula() const { |
|
||||
return true; |
|
||||
} |
|
||||
|
|
||||
Formula const& ReachabilityRewardFormula::getSubformula() const { |
|
||||
return *subformula; |
|
||||
} |
|
||||
|
|
||||
void ReachabilityRewardFormula::gatherAtomicExpressionFormulas(std::vector<std::shared_ptr<AtomicExpressionFormula const>>& atomicExpressionFormulas) const { |
|
||||
this->getSubformula().gatherAtomicExpressionFormulas(atomicExpressionFormulas); |
|
||||
} |
|
||||
|
|
||||
void ReachabilityRewardFormula::gatherAtomicLabelFormulas(std::vector<std::shared_ptr<AtomicLabelFormula const>>& atomicLabelFormulas) const { |
|
||||
this->getSubformula().gatherAtomicLabelFormulas(atomicLabelFormulas); |
|
||||
} |
|
||||
|
|
||||
std::shared_ptr<Formula> ReachabilityRewardFormula::substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const { |
|
||||
return std::make_shared<ReachabilityRewardFormula>(this->getSubformula().substitute(substitution)); |
|
||||
} |
|
||||
|
|
||||
std::ostream& ReachabilityRewardFormula::writeToStream(std::ostream& out) const { |
|
||||
out << "F "; |
|
||||
this->getSubformula().writeToStream(out); |
|
||||
return out; |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,36 +0,0 @@ |
|||||
#ifndef STORM_LOGIC_REACHABILITYREWARDFORMULA_H_ |
|
||||
#define STORM_LOGIC_REACHABILITYREWARDFORMULA_H_ |
|
||||
|
|
||||
#include <memory> |
|
||||
|
|
||||
#include "src/logic/RewardPathFormula.h" |
|
||||
|
|
||||
|
|
||||
namespace storm { |
|
||||
namespace logic { |
|
||||
class ReachabilityRewardFormula : public RewardPathFormula { |
|
||||
public: |
|
||||
ReachabilityRewardFormula(std::shared_ptr<Formula const> const& subformula); |
|
||||
|
|
||||
virtual ~ReachabilityRewardFormula() { |
|
||||
// Intentionally left empty. |
|
||||
} |
|
||||
|
|
||||
virtual bool isReachabilityRewardFormula() const override; |
|
||||
|
|
||||
Formula const& getSubformula() const; |
|
||||
|
|
||||
virtual void gatherAtomicExpressionFormulas(std::vector<std::shared_ptr<AtomicExpressionFormula const>>& atomicExpressionFormulas) const override; |
|
||||
virtual void gatherAtomicLabelFormulas(std::vector<std::shared_ptr<AtomicLabelFormula const>>& atomicLabelFormulas) const override; |
|
||||
|
|
||||
virtual std::ostream& writeToStream(std::ostream& out) const override; |
|
||||
|
|
||||
virtual std::shared_ptr<Formula> substitute(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) const override; |
|
||||
|
|
||||
private: |
|
||||
std::shared_ptr<Formula const> subformula; |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
#endif /* STORM_LOGIC_REACHABILITYREWARDFORMULA_H_ */ |
|
@ -1,9 +0,0 @@ |
|||||
#include "src/logic/RewardPathFormula.h"
|
|
||||
|
|
||||
namespace storm { |
|
||||
namespace logic { |
|
||||
bool RewardPathFormula::isRewardPathFormula() const { |
|
||||
return true; |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -1,19 +0,0 @@ |
|||||
#ifndef STORM_LOGIC_PATHREWARDFORMULA_H_ |
|
||||
#define STORM_LOGIC_PATHREWARDFORMULA_H_ |
|
||||
|
|
||||
#include "src/logic/PathFormula.h" |
|
||||
|
|
||||
namespace storm { |
|
||||
namespace logic { |
|
||||
class RewardPathFormula : public Formula { |
|
||||
public: |
|
||||
virtual ~RewardPathFormula() { |
|
||||
// Intentionally left empty. |
|
||||
} |
|
||||
|
|
||||
virtual bool isRewardPathFormula() const override; |
|
||||
}; |
|
||||
} |
|
||||
} |
|
||||
|
|
||||
#endif /* STORM_LOGIC_PATHREWARDFORMULA_H_ */ |
|
Some files were not shown because too many files changed in this diff
Reference in new issue
xxxxxxxxxx