pub enum ExprData {
Show 14 variants
Symbol {
name: String,
domain: Domain,
commutative: bool,
},
Integer(BigInt),
Rational(BigRat),
Float(BigFloat),
Add(Vec<ExprId>),
Mul(Vec<ExprId>),
Pow {
base: ExprId,
exp: ExprId,
},
Func {
name: String,
args: Vec<ExprId>,
},
Piecewise {
branches: Vec<(ExprId, ExprId)>,
default: ExprId,
},
Predicate {
kind: PredicateKind,
args: Vec<ExprId>,
},
Forall {
var: ExprId,
body: ExprId,
},
Exists {
var: ExprId,
body: ExprId,
},
BigO(ExprId),
RootSum {
poly: ExprId,
var: ExprId,
body: ExprId,
},
}Expand description
Structural content of an expression node.
All compound nodes hold ExprId children, not owned sub-trees.
This keeps ExprData small and allows sharing via the intern table.
Variants§
Symbol
Fields
Integer(BigInt)
Rational(BigRat)
Float(BigFloat)
Add(Vec<ExprId>)
Mul(Vec<ExprId>)
Pow
Func
Piecewise
A piecewise expression: evaluates to value_i when cond_i holds,
and to default when no condition matches.
Conditions are ExprData::Predicate nodes stored in the pool.
Branches are tried in order; the first matching condition wins.
Predicate
A symbolic predicate (boolean condition over symbolic reals).
Forall
Universal quantification (∀ var . body). Used by first-order logic (V3-3).
Exists
Existential quantification (∃ var . body).
BigO(ExprId)
Landau big-O remainder: O(arg) as a symbolic order bound (V2-15 series API).
RootSum
Sum over the roots of a polynomial: Σ_{c : poly(c)=0} body[var := c].
A binder (like ExprData::Exists): var is the bound root placeholder,
poly is a univariate polynomial in var, and body is the summand
(an expression in var and the free variables). Used to represent the
logarithmic part of a rational-function integral whose residues are
algebraic numbers of degree ≥ 2 (Rothstein–Trager / Lazard–Rioboo–Trager).
Trait Implementations§
impl Eq for ExprData
impl StructuralPartialEq for ExprData
Auto Trait Implementations§
impl Freeze for ExprData
impl RefUnwindSafe for ExprData
impl Send for ExprData
impl Sync for ExprData
impl Unpin for ExprData
impl UnsafeUnpin for ExprData
impl UnwindSafe for ExprData
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more