3#include <unordered_map>
11namespace expressions {
21 std::shared_ptr<BaseExpression const> conditionExpression =
22 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getCondition()->accept(*
this, data));
23 std::shared_ptr<BaseExpression const> thenExpression =
24 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getThenExpression()->accept(*
this, data));
25 std::shared_ptr<BaseExpression const> elseExpression =
26 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getElseExpression()->accept(*
this, data));
33 return std::const_pointer_cast<BaseExpression const>(std::shared_ptr<BaseExpression>(
39 std::shared_ptr<BaseExpression const> firstExpression =
40 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getFirstOperand()->accept(*
this, data));
41 std::shared_ptr<BaseExpression const> secondExpression =
42 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getSecondOperand()->accept(*
this, data));
54 std::shared_ptr<BaseExpression const> firstExpression =
55 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getFirstOperand()->accept(*
this, data));
56 std::shared_ptr<BaseExpression const> secondExpression =
57 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getSecondOperand()->accept(*
this, data));
69 std::shared_ptr<BaseExpression const> firstExpression =
70 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getFirstOperand()->accept(*
this, data));
71 std::shared_ptr<BaseExpression const> secondExpression =
72 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getSecondOperand()->accept(*
this, data));
78 return std::const_pointer_cast<BaseExpression const>(std::shared_ptr<BaseExpression>(
88 std::shared_ptr<BaseExpression const> operandExpression =
89 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getOperand()->accept(*
this, data));
92 if (operandExpression.get() == expression.
getOperand().get()) {
95 return std::const_pointer_cast<BaseExpression const>(std::shared_ptr<BaseExpression>(
101 std::shared_ptr<BaseExpression const> operandExpression =
102 boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getOperand()->accept(*
this, data));
105 if (operandExpression.get() == expression.
getOperand().get()) {
108 return std::const_pointer_cast<BaseExpression const>(std::shared_ptr<BaseExpression>(
114 std::vector<Expression> newExpressions;
115 for (uint64_t i = 0; i < expression.
getArity(); ++i) {
116 newExpressions.emplace_back(boost::any_cast<std::shared_ptr<BaseExpression const>>(expression.
getOperand(i)->accept(*
this, data)));
118 std::vector<Expression> newSumExpressions;
119 for (
auto const &expr : newExpressions) {
virtual boost::any accept(ExpressionVisitor &visitor, boost::any const &data) const =0
Accepts the given visitor by calling its visit method.
ExpressionManager const & getManager() const
Retrieves the manager responsible for this expression.
Type const & getType() const
Retrieves the type of the expression.
std::shared_ptr< BaseExpression const > getSharedPointer() const
Retrieves a shared pointer to this expression.
OperatorType getOperatorType() const
Retrieves the operator associated with the expression.
std::shared_ptr< BaseExpression const > const & getSecondOperand() const
Retrieves the second operand of the expression.
std::shared_ptr< BaseExpression const > const & getFirstOperand() const
Retrieves the first operand of the expression.
OperatorType getOperatorType() const
Retrieves the operator associated with the expression.
RelationType getRelationType() const
Retrieves the relation associated with the expression.
std::shared_ptr< BaseExpression const > const & getBaseExpressionPointer() const
Retrieves a pointer to the base expression underlying this expression object.
BaseExpression const & getBaseExpression() const
Retrieves the base expression underlying this expression object.
Expression integer(int_fast64_t value) const
Creates an expression that characterizes the given integer literal.
std::shared_ptr< BaseExpression const > getElseExpression() const
Retrieves the else expression of the if-then-else expression.
std::shared_ptr< BaseExpression const > getCondition() const
Retrieves the condition expression of the if-then-else expression.
std::shared_ptr< BaseExpression const > getThenExpression() const
Retrieves the then expression of the if-then-else expression.
The base class of all binary expressions.
virtual std::shared_ptr< BaseExpression const > getOperand(uint_fast64_t operandIndex) const override
Retrieves the given operand from the expression.
PredicateType getPredicateType() const
Retrieves the relation associated with the expression.
virtual uint_fast64_t getArity() const override
Returns the arity of the expression.
virtual boost::any visit(IfThenElseExpression const &expression, boost::any const &data) override
RestrictSyntaxVisitor()
Creates a new simplification visitor that replaces predicates by other (simpler?) predicates.
Expression substitute(Expression const &expression)
Simplifies based on the configuration.
OperatorType getOperatorType() const
Retrieves the operator associated with this expression.
virtual std::shared_ptr< BaseExpression const > getOperand(uint_fast64_t operandIndex) const override
Retrieves the given operand from the expression.
OperatorType getOperatorType() const
Retrieves the operator associated with this expression.
#define STORM_LOG_ASSERT(cond, message)
Expression ite(Expression const &condition, Expression const &thenExpression, Expression const &elseExpression)
Expression sum(std::vector< storm::expressions::Expression > const &expressions)