pub enum ExprLang {
Show 30 variants
Num(Symbol),
Add([Id; 2]),
Mul([Id; 2]),
Div([Id; 2]),
Pow([Id; 2]),
Neg([Id; 1]),
Inv([Id; 1]),
Abs([Id; 1]),
Sin([Id; 1]),
Cos([Id; 1]),
Tan([Id; 1]),
Exp([Id; 1]),
Log([Id; 1]),
Sqrt([Id; 1]),
Asin([Id; 1]),
Acos([Id; 1]),
Atan([Id; 1]),
Sinh([Id; 1]),
Cosh([Id; 1]),
Tanh([Id; 1]),
Re([Id; 1]),
Im([Id; 1]),
Conj([Id; 1]),
Commutator([Id; 2]),
Anticommutator([Id; 2]),
TensorProduct([Id; 2]),
Trace([Id; 1]),
Dagger([Id; 1]),
Determinant([Id; 1]),
Transpose([Id; 1]),
}Expand description
The symbolic expression language
Variants§
Num(Symbol)
Add([Id; 2])
Mul([Id; 2])
Div([Id; 2])
Pow([Id; 2])
Neg([Id; 1])
Inv([Id; 1])
Abs([Id; 1])
Sin([Id; 1])
Cos([Id; 1])
Tan([Id; 1])
Exp([Id; 1])
Log([Id; 1])
Sqrt([Id; 1])
Asin([Id; 1])
Acos([Id; 1])
Atan([Id; 1])
Sinh([Id; 1])
Cosh([Id; 1])
Tanh([Id; 1])
Re([Id; 1])
Im([Id; 1])
Conj([Id; 1])
Commutator([Id; 2])
Anticommutator([Id; 2])
TensorProduct([Id; 2])
Trace([Id; 1])
Dagger([Id; 1])
Determinant([Id; 1])
Transpose([Id; 1])
Trait Implementations§
Source§impl Language for ExprLang
impl Language for ExprLang
Source§type Discriminant = Discriminant<ExprLang>
type Discriminant = Discriminant<ExprLang>
Type representing the cases of this language. Read more
Source§fn discriminant(&self) -> Self::Discriminant
fn discriminant(&self) -> Self::Discriminant
Return the
Discriminant of this node.Source§fn matches(&self, other: &Self) -> bool
fn matches(&self, other: &Self) -> bool
Returns true if this enode matches another enode.
This should only consider the operator and the arity,
not the children
Ids.Source§fn children_mut(&mut self) -> &mut [Id]
fn children_mut(&mut self) -> &mut [Id]
Returns a mutable slice of the children of this e-node.
Source§fn for_each_mut<F>(&mut self, f: F)
fn for_each_mut<F>(&mut self, f: F)
Runs a given function on each child
Id, allowing mutation of that Id.Source§fn try_for_each<E, F>(&self, f: F) -> Result<(), E>
fn try_for_each<E, F>(&self, f: F) -> Result<(), E>
Runs a falliable function on each child, stopping if the function returns
an error.
Source§fn update_children<F>(&mut self, f: F)
fn update_children<F>(&mut self, f: F)
Runs a given function to replace the children.
Source§fn map_children<F>(self, f: F) -> Self
fn map_children<F>(self, f: F) -> Self
Creates a new enode with children determined by the given function.
Source§fn fold<F, T>(&self, init: T, f: F) -> T
fn fold<F, T>(&self, init: T, f: F) -> T
Folds over the children, given an initial accumulator.
Source§fn all<F>(&self, f: F) -> bool
fn all<F>(&self, f: F) -> bool
Returns true if the predicate is true on all children.
Does not short circuit.
Source§fn any<F>(&self, f: F) -> bool
fn any<F>(&self, f: F) -> bool
Returns true if the predicate is true on any children.
Does not short circuit.
Source§fn join_recexprs<F, Expr>(&self, child_recexpr: F) -> RecExpr<Self>
fn join_recexprs<F, Expr>(&self, child_recexpr: F) -> RecExpr<Self>
Source§fn build_recexpr<F>(&self, get_node: F) -> RecExpr<Self>
fn build_recexpr<F>(&self, get_node: F) -> RecExpr<Self>
Source§fn try_build_recexpr<F, Err>(&self, get_node: F) -> Result<RecExpr<Self>, Err>
fn try_build_recexpr<F, Err>(&self, get_node: F) -> Result<RecExpr<Self>, Err>
Same as
Language::build_recexpr, but fallible.Source§impl Ord for ExprLang
impl Ord for ExprLang
Source§impl PartialOrd for ExprLang
impl PartialOrd for ExprLang
impl Eq for ExprLang
impl StructuralPartialEq for ExprLang
Auto Trait Implementations§
impl Freeze for ExprLang
impl RefUnwindSafe for ExprLang
impl Send for ExprLang
impl Sync for ExprLang
impl Unpin for ExprLang
impl UnwindSafe for ExprLang
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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
Compare self to
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>
Converts
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>
Converts
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