1#ifndef STORM_STORAGE_EXPRESSIONS_IFTHENELSEEXPRESSION_H_
2#define STORM_STORAGE_EXPRESSIONS_IFTHENELSEEXPRESSION_H_
20 std::shared_ptr<BaseExpression const>
const& thenExpression, std::shared_ptr<BaseExpression const>
const& elseExpression);
31 virtual std::shared_ptr<BaseExpression const>
getOperand(uint_fast64_t operandIndex)
const override;
35 virtual uint_fast64_t
getArity()
const override;
39 virtual void gatherVariables(std::set<storm::expressions::Variable>& variables)
const override;
40 virtual std::shared_ptr<BaseExpression const>
simplify()
const override;
49 std::shared_ptr<BaseExpression const>
getCondition()
const;
67 virtual void printToStream(std::ostream& stream)
const override;
71 std::shared_ptr<BaseExpression const> condition;
74 std::shared_ptr<BaseExpression const> thenExpression;
77 std::shared_ptr<BaseExpression const> elseExpression;
The base class of all expression classes.
This class is responsible for managing a set of typed variables and all expressions using these varia...
virtual std::shared_ptr< BaseExpression const > getOperand(uint_fast64_t operandIndex) const override
Retrieves the given operand from the expression.
std::shared_ptr< BaseExpression const > getElseExpression() const
Retrieves the else expression of the if-then-else expression.
virtual bool isIfThenElseExpression() const override
IfThenElseExpression & operator=(IfThenElseExpression &&)=delete
virtual ~IfThenElseExpression()=default
virtual bool evaluateAsBool(Valuation const *valuation=nullptr) const override
Evaluates the expression under the valuation of unknowns (variables and constants) given by the valua...
virtual uint_fast64_t getArity() const override
Returns the arity of the expression.
virtual int_fast64_t evaluateAsInt(Valuation const *valuation=nullptr) const override
Evaluates the expression under the valuation of unknowns (variables and constants) given by the valua...
virtual bool isFunctionApplication() const override
Checks if the expression is a function application (of any sort).
virtual bool containsVariables() const override
Retrieves whether the expression contains a variable.
std::shared_ptr< BaseExpression const > getCondition() const
Retrieves the condition expression of the if-then-else expression.
virtual OperatorType getOperator() const override
Retrieves the operator of a function application.
virtual double evaluateAsDouble(Valuation const *valuation=nullptr) const override
Evaluates the expression under the valuation of unknowns (variables and constants) given by the valua...
IfThenElseExpression(IfThenElseExpression const &other)=default
virtual std::shared_ptr< BaseExpression const > simplify() const override
Simplifies the expression according to some simple rules.
virtual void printToStream(std::ostream &stream) const override
Prints the expression to the given stream.
virtual boost::any accept(ExpressionVisitor &visitor, boost::any const &data) const override
Accepts the given visitor by calling its visit method.
IfThenElseExpression(IfThenElseExpression &&)=default
virtual void gatherVariables(std::set< storm::expressions::Variable > &variables) const override
Retrieves the set of all variables that appear in the expression.
IfThenElseExpression & operator=(IfThenElseExpression const &other)=delete
std::shared_ptr< BaseExpression const > getThenExpression() const
Retrieves the then expression of the if-then-else expression.
The base class of all valuations of variables.