Browse Source
minimal probabilities now working (for some test cases)
minimal probabilities now working (for some test cases)
Former-commit-id: 9f38386531
tempestpy_adaptions
dehnert
9 years ago
43 changed files with 220 additions and 199 deletions
-
4src/logic/AtomicExpressionFormula.cpp
-
2src/logic/AtomicExpressionFormula.h
-
4src/logic/AtomicLabelFormula.cpp
-
2src/logic/AtomicLabelFormula.h
-
4src/logic/BinaryBooleanStateFormula.cpp
-
2src/logic/BinaryBooleanStateFormula.h
-
4src/logic/BooleanLiteralFormula.cpp
-
2src/logic/BooleanLiteralFormula.h
-
4src/logic/BoundedUntilFormula.cpp
-
2src/logic/BoundedUntilFormula.h
-
4src/logic/ConditionalFormula.cpp
-
2src/logic/ConditionalFormula.h
-
4src/logic/CumulativeRewardFormula.cpp
-
2src/logic/CumulativeRewardFormula.h
-
4src/logic/EventuallyFormula.cpp
-
2src/logic/EventuallyFormula.h
-
6src/logic/Formula.cpp
-
4src/logic/Formula.h
-
4src/logic/GloballyFormula.cpp
-
2src/logic/GloballyFormula.h
-
4src/logic/InstantaneousRewardFormula.cpp
-
2src/logic/InstantaneousRewardFormula.h
-
1src/logic/LabelSubstitutionVisitor.cpp
-
4src/logic/LongRunAverageOperatorFormula.cpp
-
2src/logic/LongRunAverageOperatorFormula.h
-
4src/logic/LongRunAverageRewardFormula.cpp
-
2src/logic/LongRunAverageRewardFormula.h
-
4src/logic/NextFormula.cpp
-
2src/logic/NextFormula.h
-
4src/logic/ProbabilityOperatorFormula.cpp
-
2src/logic/ProbabilityOperatorFormula.h
-
4src/logic/RewardOperatorFormula.cpp
-
2src/logic/RewardOperatorFormula.h
-
4src/logic/TimeOperatorFormula.cpp
-
2src/logic/TimeOperatorFormula.h
-
4src/logic/UnaryBooleanStateFormula.cpp
-
2src/logic/UnaryBooleanStateFormula.h
-
4src/logic/UntilFormula.cpp
-
2src/logic/UntilFormula.h
-
21src/logic/VariableSubstitutionVisitor.cpp
-
29src/logic/VariableSubstitutionVisitor.h
-
82src/modelchecker/reachability/SparseMdpLearningModelChecker.cpp
-
30src/modelchecker/reachability/SparseMdpLearningModelChecker.h
@ -0,0 +1,21 @@ |
|||
#include "src/logic/VariableSubstitutionVisitor.h"
|
|||
|
|||
#include "src/logic/Formulas.h"
|
|||
|
|||
namespace storm { |
|||
namespace logic { |
|||
|
|||
VariableSubstitutionVisitor::VariableSubstitutionVisitor(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution) : substitution(substitution) { |
|||
// Intentionally left empty.
|
|||
} |
|||
|
|||
std::shared_ptr<Formula> VariableSubstitutionVisitor::substitute(Formula const& f) const { |
|||
boost::any result = f.accept(*this, boost::any()); |
|||
return boost::any_cast<std::shared_ptr<Formula>>(result); |
|||
} |
|||
|
|||
boost::any VariableSubstitutionVisitor::visit(AtomicExpressionFormula const& f, boost::any const& data) const { |
|||
return std::static_pointer_cast<Formula>(std::make_shared<AtomicExpressionFormula>(f.getExpression().substitute(substitution))); |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,29 @@ |
|||
#ifndef STORM_LOGIC_VARIABLESUBSTITUTIONVISITOR_H_ |
|||
#define STORM_LOGIC_VARIABLESUBSTITUTIONVISITOR_H_ |
|||
|
|||
#include <map> |
|||
|
|||
#include "src/logic/CloneVisitor.h" |
|||
|
|||
#include "src/storage/expressions/Expression.h" |
|||
|
|||
namespace storm { |
|||
namespace logic { |
|||
|
|||
class VariableSubstitutionVisitor : public CloneVisitor { |
|||
public: |
|||
VariableSubstitutionVisitor(std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution); |
|||
|
|||
std::shared_ptr<Formula> substitute(Formula const& f) const; |
|||
|
|||
virtual boost::any visit(AtomicExpressionFormula const& f, boost::any const& data) const override; |
|||
|
|||
private: |
|||
std::map<storm::expressions::Variable, storm::expressions::Expression> const& substitution; |
|||
}; |
|||
|
|||
} |
|||
} |
|||
|
|||
|
|||
#endif /* STORM_LOGIC_VARIABLESUBSTITUTIONVISITOR_H_ */ |
Write
Preview
Loading…
Cancel
Save
Reference in new issue