|
smats
0.0.1
Satisfability Modulo Arithmetic Theories Symbols
|
#include <expression_cell.h>
Public Member Functions | |
void | hash (DelegatingHasher &hasher) const override |
bool | equal_to (const ExpressionCell< T > &o) const override |
bool | less (const ExpressionCell< T > &o) const override |
T | evaluate (const Environment< T > &env) const override |
const Expression< T > & | lhs () const |
const Expression< T > & | rhs () const |
![]() | |
long | use_count () const |
ExpressionKind | kind () const |
const Variables & | variables () const |
bool | is_polynomial () const |
bool | is_expanded () const |
void | set_expanded () |
template<template< class > class E> | |
const E< T > & | to () const |
template<template< class > class E> | |
E< T > & | to () |
Expression< T > | to_expression () const |
virtual Expression< T > | expand () const =0 |
virtual Expression< T > | evaluate_partial (const Environment< T > &env) const =0 |
virtual Expression< T > | substitute (const Substitution< T > &s) const =0 |
virtual Expression< T > | differentiate (const Variable &x) const =0 |
virtual std::ostream & | display (std::ostream &os) const =0 |
void | invalidate_cache () |
Protected Member Functions | |
BinaryExpressionCell (ExpressionKind kind, Expression< T > e1, Expression< T > e2, bool is_expanded) | |
virtual T | do_evaluate (const T &v1, const T &v2) const =0 |
void | compute_variables (std::optional< Variables > &variables) const override |
void | compute_is_polynomial (std::optional< bool > &is_polynomial) const override |
![]() | |
ExpressionCell (ExpressionKind kind, bool is_expanded) | |
ExpressionCell (ExpressionKind kind, bool is_polynomial, bool is_expanded) | |
Private Attributes | |
const Expression< T > | e1_ |
The first argument of the binary expression. | |
const Expression< T > | e2_ |
The second argument of the binary expression. | |
Symbolic expression used as a base for binary expressions.
The expression holds two other expressions internally. Some example include
\[ \min(x, y) \\ \max(x, y) \\ x^y \\ x \ y \\ \]
T | type of the expression evaluation |
|
protected |
Constructs BinaryExpressionCell of kind
with e1
, e2
is_polynomial
, and is_expanded
.
kind | kind of the expression |
e1 | first expression |
e2 | second expression |
is_expanded | whether the expression is already expanded |
|
overrideprotectedvirtual |
Implements smats::ExpressionCell< T >.
|
overrideprotectedvirtual |
Implements smats::ExpressionCell< T >.
|
nodiscardprotectedpure virtual |
Evaluate the binary expression, given the two values v1
and v2
of the arguments.
v1 | first value |
v2 | second value |
Implemented in smats::ExpressionDiv< T >, and smats::ExpressionPow< T >.
|
nodiscardoverridevirtual |
Compare two expression cells to determine if they are equal.
o | other object to compare against |
Implements smats::ExpressionCell< T >.
|
nodiscardoverridevirtual |
Evaluates under a given environment (by default, an empty environment).
env | environment |
std::runtime_exception | if NaN is detected during evaluation. |
Implements smats::ExpressionCell< T >.
|
overridevirtual |
Sends all hash-relevant bytes for this ExpressionCell type into the given hasher, per the hash_append concept, except for kind(), because Expression already sends that.
Implements smats::ExpressionCell< T >.
|
nodiscardoverridevirtual |
Compare two expression cells to determine the order between them.
o | other object to compare against |
Implements smats::ExpressionCell< T >.
|
inlinenodiscard |
Get read-only access to the first argument of the binary expression.
|
inlinenodiscard |
Get read-only access to the second argument of the binary expression.