dReal4
ExpressionCell Class Referenceabstract

Represents an abstract class which is the base of concrete symbolic-expression classes. More...

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

Inheritance diagram for ExpressionCell:
BinaryExpressionCell ExpressionAdd ExpressionConstant ExpressionIfThenElse ExpressionMul ExpressionNaN ExpressionRealConstant ExpressionUninterpretedFunction ExpressionVar UnaryExpressionCell

Public Member Functions

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...
 
virtual bool EqualTo (const ExpressionCell &c) const =0
 Checks structural equality. More...
 
virtual bool Less (const ExpressionCell &c) const =0
 Provides lexicographical ordering between expressions. 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...
 
virtual double Evaluate (const Environment &env) const =0
 Evaluates under a given environment (by default, an empty environment). More...
 
virtual Expression Expand ()=0
 Expands out products and positive integer powers in expression. More...
 
virtual Expression Substitute (const ExpressionSubstitution &expr_subst, const FormulaSubstitution &formula_subst)=0
 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...
 
virtual Expression Differentiate (const Variable &x) const =0
 Differentiates this symbolic expression with respect to the variable var. More...
 
virtual std::ostream & Display (std::ostream &os) const =0
 Outputs string representation of expression into output stream os. 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...
 

Protected Member Functions

 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

Represents an abstract class which is the base of concrete symbolic-expression classes.

Note
It provides virtual function, ExpressionCell::Display, because operator<< is not allowed to be a virtual function.

Constructor & Destructor Documentation

◆ ExpressionCell() [1/4]

ExpressionCell ( const ExpressionCell e)
delete

Copy-constructs an ExpressionCell from an lvalue.

(DELETED)

◆ ExpressionCell() [2/4]

ExpressionCell ( ExpressionCell &&  e)
delete

Move-constructs an ExpressionCell from an rvalue.

(DELETED)

◆ ExpressionCell() [3/4]

ExpressionCell ( )
delete

Default constructor (DELETED).

◆ ExpressionCell() [4/4]

ExpressionCell ( ExpressionKind  k,
size_t  hash,
bool  is_poly,
bool  include_ite,
Variables  variables 
)
protected

Constructs ExpressionCell of kind k with hash, is_poly, and include_ite.

◆ ~ExpressionCell()

virtual ~ExpressionCell ( )
protectedvirtualdefault

Default destructor.

Member Function Documentation

◆ Differentiate()

◆ Display()

◆ EqualTo()

◆ Evaluate()

virtual double Evaluate ( const Environment env) const
pure virtual

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

Exceptions
std::runtime_errorif NaN is detected during evaluation.

Implemented in ExpressionUninterpretedFunction, ExpressionIfThenElse, ExpressionMul, ExpressionAdd, ExpressionNaN, ExpressionRealConstant, ExpressionConstant, ExpressionVar, BinaryExpressionCell, and UnaryExpressionCell.

◆ Expand()

◆ get_hash()

size_t get_hash ( ) const
inline

Returns hash value.

◆ get_kind()

ExpressionKind get_kind ( ) const
inline

Returns expression kind.

◆ GetExpression()

Expression GetExpression ( )
protected

Returns an expression pointing to this ExpressionCell.

◆ GetVariables()

const Variables & GetVariables ( ) const

Collects variables in expression.

◆ include_ite()

bool include_ite ( ) const
inline

Returns true if this symbolic expression includes an ITE (If-Then-Else) expression.

◆ is_polynomial()

bool is_polynomial ( ) const
inline

Checks if this symbolic expression is convertible to Polynomial.

◆ Less()

virtual bool Less ( const ExpressionCell c) const
pure virtual

◆ operator=() [1/2]

ExpressionCell& operator= ( ExpressionCell &&  e)
delete

Move-assigns (DELETED).

◆ operator=() [2/2]

ExpressionCell& operator= ( const ExpressionCell e)
delete

Copy-assigns (DELETED).

◆ Substitute()

virtual Expression Substitute ( const ExpressionSubstitution &  expr_subst,
const FormulaSubstitution &  formula_subst 
)
pure virtual

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.

Implemented in ExpressionUninterpretedFunction, ExpressionIfThenElse, ExpressionMax, ExpressionMin, ExpressionTanh, ExpressionCosh, ExpressionSinh, ExpressionAtan2, ExpressionAtan, ExpressionAcos, ExpressionAsin, ExpressionTan, ExpressionCos, ExpressionSin, ExpressionPow, ExpressionSqrt, ExpressionExp, ExpressionAbs, ExpressionLog, ExpressionDiv, ExpressionMul, ExpressionAdd, ExpressionNaN, ExpressionRealConstant, ExpressionConstant, and ExpressionVar.

◆ use_count()

unsigned use_count ( ) const
inline

Returns the reference count of this cell.


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