dlinear
0.0.1
Delta-complete SMT solver for linear programming
|
Represents an abstract class which is the base of concrete symbolic-expression classes. More...
#include <symbolic_expression_cell.h>
Public Member Functions | |
ExpressionKind | get_kind () const |
Returns expression kind. | |
size_t | get_hash () const |
Returns hash value. | |
const Variables & | GetVariables () const |
Collects variables in expression. | |
virtual bool | EqualTo (const ExpressionCell &c) const =0 |
Checks structural equality. | |
virtual bool | Less (const ExpressionCell &c) const =0 |
Provides lexicographical ordering between expressions. | |
bool | is_polynomial () const |
Checks if this symbolic expression is convertible to Polynomial. | |
bool | include_ite () const |
Returns true if this symbolic expression includes an ITE (If-Then-Else) expression. | |
virtual mpq_class | Evaluate (const Environment &env) const =0 |
Evaluates under a given environment (by default, an empty environment). | |
virtual Expression | Expand ()=0 |
Expands out products and positive integer powers in expression. | |
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 . | |
virtual Expression | Differentiate (const Variable &x) const =0 |
Differentiates this symbolic expression with respect to the variable var . | |
virtual std::ostream & | Display (std::ostream &os) const =0 |
Outputs string representation of expression into output stream os . | |
unsigned | use_count () const |
Returns the reference count of this cell. | |
ExpressionCell (const ExpressionCell &e)=delete | |
Copy-constructs an ExpressionCell from an lvalue. | |
ExpressionCell (ExpressionCell &&e)=delete | |
Move-constructs an ExpressionCell from an rvalue. | |
ExpressionCell & | operator= (ExpressionCell &&e)=delete |
Move-assigns (DELETED). | |
ExpressionCell & | operator= (const ExpressionCell &e)=delete |
Copy-assigns (DELETED). | |
virtual void | UpdateHash () |
Update the cached hash value. | |
Protected Member Functions | |
ExpressionCell (ExpressionKind k) | |
Constructs ExpressionCell of kind k . | |
ExpressionCell (ExpressionKind k, bool is_poly) | |
Constructs ExpressionCell of kind k with hash , is_poly , and include_ite . | |
ExpressionCell (ExpressionKind k, bool is_poly, bool include_ite) | |
Constructs ExpressionCell of kind k with hash , is_poly , and include_ite . | |
ExpressionCell (ExpressionKind k, bool is_poly, bool include_ite, Variables variables) | |
Constructs ExpressionCell of kind k with hash , is_poly , and include_ite . | |
ExpressionCell (ExpressionKind k, bool is_poly, bool include_ite, Variables variables, size_t hash) | |
Constructs ExpressionCell of kind k with hash , is_poly , and include_ite . | |
virtual | ~ExpressionCell ()=default |
Default destructor. | |
Expression | GetExpression () |
Returns an expression pointing to this ExpressionCell. | |
Private Attributes | |
std::optional< Variables > | variables_ |
Cached variables contained in the expression. | |
Represents an abstract class which is the base of concrete symbolic-expression classes.
Definition at line 26 of file symbolic_expression_cell.h.
|
delete |
Copy-constructs an ExpressionCell from an lvalue.
(DELETED)
|
delete |
Move-constructs an ExpressionCell from an rvalue.
(DELETED)
|
pure virtual |
Differentiates this symbolic expression with respect to the variable var
.
std::runtime_error | if it is not differentiable. |
Implemented in dlinear::drake::symbolic::ExpressionAbs, dlinear::drake::symbolic::ExpressionAcos, dlinear::drake::symbolic::ExpressionAdd, dlinear::drake::symbolic::ExpressionAsin, dlinear::drake::symbolic::ExpressionAtan2, dlinear::drake::symbolic::ExpressionAtan, dlinear::drake::symbolic::ExpressionConstant, dlinear::drake::symbolic::ExpressionCos, dlinear::drake::symbolic::ExpressionCosh, dlinear::drake::symbolic::ExpressionDiv, dlinear::drake::symbolic::ExpressionExp, dlinear::drake::symbolic::ExpressionIfThenElse, dlinear::drake::symbolic::ExpressionInfty, dlinear::drake::symbolic::ExpressionLog, dlinear::drake::symbolic::ExpressionMax, dlinear::drake::symbolic::ExpressionMin, dlinear::drake::symbolic::ExpressionMul, dlinear::drake::symbolic::ExpressionNaN, dlinear::drake::symbolic::ExpressionPow, dlinear::drake::symbolic::ExpressionSin, dlinear::drake::symbolic::ExpressionSinh, dlinear::drake::symbolic::ExpressionSqrt, dlinear::drake::symbolic::ExpressionTan, dlinear::drake::symbolic::ExpressionTanh, dlinear::drake::symbolic::ExpressionUninterpretedFunction, and dlinear::drake::symbolic::ExpressionVar.
|
pure virtual |
Evaluates under a given environment (by default, an empty environment).
std::runtime_error | if NaN is detected during evaluation. |
Implemented in dlinear::drake::symbolic::BinaryExpressionCell, dlinear::drake::symbolic::ExpressionAdd, dlinear::drake::symbolic::ExpressionConstant, dlinear::drake::symbolic::ExpressionIfThenElse, dlinear::drake::symbolic::ExpressionInfty, dlinear::drake::symbolic::ExpressionMul, dlinear::drake::symbolic::ExpressionNaN, dlinear::drake::symbolic::ExpressionUninterpretedFunction, dlinear::drake::symbolic::ExpressionVar, and dlinear::drake::symbolic::UnaryExpressionCell.
|
pure virtual |
Expands out products and positive integer powers in expression.
std::runtime_error | if NaN is detected during expansion. |
Implemented in dlinear::drake::symbolic::ExpressionAbs, dlinear::drake::symbolic::ExpressionAcos, dlinear::drake::symbolic::ExpressionAdd, dlinear::drake::symbolic::ExpressionAsin, dlinear::drake::symbolic::ExpressionAtan2, dlinear::drake::symbolic::ExpressionAtan, dlinear::drake::symbolic::ExpressionConstant, dlinear::drake::symbolic::ExpressionCos, dlinear::drake::symbolic::ExpressionCosh, dlinear::drake::symbolic::ExpressionDiv, dlinear::drake::symbolic::ExpressionExp, dlinear::drake::symbolic::ExpressionIfThenElse, dlinear::drake::symbolic::ExpressionInfty, dlinear::drake::symbolic::ExpressionLog, dlinear::drake::symbolic::ExpressionMax, dlinear::drake::symbolic::ExpressionMin, dlinear::drake::symbolic::ExpressionMul, dlinear::drake::symbolic::ExpressionNaN, dlinear::drake::symbolic::ExpressionPow, dlinear::drake::symbolic::ExpressionSin, dlinear::drake::symbolic::ExpressionSinh, dlinear::drake::symbolic::ExpressionSqrt, dlinear::drake::symbolic::ExpressionTan, dlinear::drake::symbolic::ExpressionTanh, dlinear::drake::symbolic::ExpressionUninterpretedFunction, and dlinear::drake::symbolic::ExpressionVar.
|
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
.
std::runtime_error | if NaN is detected during substitution. |
Implemented in dlinear::drake::symbolic::ExpressionAbs, dlinear::drake::symbolic::ExpressionAcos, dlinear::drake::symbolic::ExpressionAdd, dlinear::drake::symbolic::ExpressionAsin, dlinear::drake::symbolic::ExpressionAtan2, dlinear::drake::symbolic::ExpressionAtan, dlinear::drake::symbolic::ExpressionConstant, dlinear::drake::symbolic::ExpressionCos, dlinear::drake::symbolic::ExpressionCosh, dlinear::drake::symbolic::ExpressionDiv, dlinear::drake::symbolic::ExpressionExp, dlinear::drake::symbolic::ExpressionIfThenElse, dlinear::drake::symbolic::ExpressionInfty, dlinear::drake::symbolic::ExpressionLog, dlinear::drake::symbolic::ExpressionMax, dlinear::drake::symbolic::ExpressionMin, dlinear::drake::symbolic::ExpressionMul, dlinear::drake::symbolic::ExpressionNaN, dlinear::drake::symbolic::ExpressionPow, dlinear::drake::symbolic::ExpressionSin, dlinear::drake::symbolic::ExpressionSinh, dlinear::drake::symbolic::ExpressionSqrt, dlinear::drake::symbolic::ExpressionTan, dlinear::drake::symbolic::ExpressionTanh, dlinear::drake::symbolic::ExpressionUninterpretedFunction, and dlinear::drake::symbolic::ExpressionVar.