dReal4
ExpressionIfThenElse Class Reference

Symbolic expression representing if-then-else expression. More...

#include </home/soonhokong/work/dreal4/third_party/com_github_robotlocomotion_drake/dreal/symbolic/symbolic_expression_cell.h>

Inheritance diagram for ExpressionIfThenElse:
ExpressionCell

Public Member Functions

 ExpressionIfThenElse (const Formula &f_cond, const Expression &e_then, const Expression &e_else)
 Constructs if-then-else expression from f_cond, e_then, and e_else. More...
 
bool EqualTo (const ExpressionCell &e) const override
 Checks structural equality. More...
 
bool Less (const ExpressionCell &e) const override
 Provides lexicographical ordering between expressions. More...
 
double Evaluate (const Environment &env) const override
 Evaluates under a given environment (by default, an empty environment). More...
 
Expression Expand () override
 Expands out products and positive integer powers in expression. More...
 
Expression Substitute (const ExpressionSubstitution &expr_subst, const FormulaSubstitution &formula_subst) override
 Returns an Expression obtained by replacing all occurrences of the variables in s in the current expression cell with the corresponding expressions in s. More...
 
Expression Differentiate (const Variable &x) const override
 Differentiates this symbolic expression with respect to the variable var. More...
 
std::ostream & Display (std::ostream &os) const override
 Outputs string representation of expression into output stream os. More...
 
const Formulaget_conditional_formula () const
 Returns the conditional formula. More...
 
const Expressionget_then_expression () const
 Returns the 'then' expression. More...
 
const Expressionget_else_expression () const
 Returns the 'else' expression. More...
 
- Public Member Functions inherited from ExpressionCell
ExpressionKind get_kind () const
 Returns expression kind. More...
 
size_t get_hash () const
 Returns hash value. More...
 
const VariablesGetVariables () const
 Collects variables in expression. More...
 
bool is_polynomial () const
 Checks if this symbolic expression is convertible to Polynomial. More...
 
bool include_ite () const
 Returns true if this symbolic expression includes an ITE (If-Then-Else) expression. More...
 
unsigned use_count () const
 Returns the reference count of this cell. More...
 
 ExpressionCell (const ExpressionCell &e)=delete
 Copy-constructs an ExpressionCell from an lvalue. More...
 
 ExpressionCell (ExpressionCell &&e)=delete
 Move-constructs an ExpressionCell from an rvalue. More...
 
 ExpressionCell ()=delete
 Default constructor (DELETED). More...
 
ExpressionCelloperator= (ExpressionCell &&e)=delete
 Move-assigns (DELETED). More...
 
ExpressionCelloperator= (const ExpressionCell &e)=delete
 Copy-assigns (DELETED). More...
 

Additional Inherited Members

- Protected Member Functions inherited from ExpressionCell
 ExpressionCell (ExpressionKind k, size_t hash, bool is_poly, bool include_ite, Variables variables)
 Constructs ExpressionCell of kind k with hash, is_poly, and include_ite. More...
 
virtual ~ExpressionCell ()=default
 Default destructor. More...
 
Expression GetExpression ()
 Returns an expression pointing to this ExpressionCell. More...
 

Detailed Description

Symbolic expression representing if-then-else expression.

Constructor & Destructor Documentation

◆ ExpressionIfThenElse()

ExpressionIfThenElse ( const Formula f_cond,
const Expression e_then,
const Expression e_else 
)

Constructs if-then-else expression from f_cond, e_then, and e_else.

Member Function Documentation

◆ Differentiate()

Expression Differentiate ( const Variable x) const
overridevirtual

Differentiates this symbolic expression with respect to the variable var.

Exceptions
std::runtime_errorif it is not differentiable.

Implements ExpressionCell.

◆ Display()

ostream & Display ( std::ostream &  os) const
overridevirtual

Outputs string representation of expression into output stream os.

Implements ExpressionCell.

◆ EqualTo()

bool EqualTo ( const ExpressionCell c) const
overridevirtual

Checks structural equality.

Implements ExpressionCell.

◆ Evaluate()

double Evaluate ( const Environment env) const
overridevirtual

Evaluates under a given environment (by default, an empty environment).

Exceptions
std::runtime_errorif NaN is detected during evaluation.

Implements ExpressionCell.

◆ Expand()

Expression Expand ( )
overridevirtual

Expands out products and positive integer powers in expression.

Exceptions
std::runtime_errorif NaN is detected during expansion.

Implements ExpressionCell.

◆ get_conditional_formula()

const Formula& get_conditional_formula ( ) const
inline

Returns the conditional formula.

◆ get_else_expression()

const Expression& get_else_expression ( ) const
inline

Returns the 'else' expression.

◆ get_then_expression()

const Expression& get_then_expression ( ) const
inline

Returns the 'then' expression.

◆ Less()

bool Less ( const ExpressionCell c) const
overridevirtual

Provides lexicographical ordering between expressions.

Implements ExpressionCell.

◆ Substitute()

Expression Substitute ( const ExpressionSubstitution &  expr_subst,
const FormulaSubstitution &  formula_subst 
)
overridevirtual

Returns an Expression obtained by replacing all occurrences of the variables in s in the current expression cell with the corresponding expressions in s.

Exceptions
std::runtime_errorif NaN is detected during substitution.

Implements ExpressionCell.


The documentation for this class was generated from the following files: