pub enum PredExpr {
Var(String, Span),
Lit(String, Span),
App {
op: String,
args: Vec<PredExpr>,
span: Span,
},
}Expand description
A primitive-predicate guard expression: a computation over literal values, built from primitive operators, literal constants, and the pattern variables that other atoms bind to literal payloads.
This is the one pattern position where a primitive operator may appear. Everywhere else in a left-hand side a primitive is rejected, because a primitive names a function on values and not a relation the e-graph stores — there is nothing to match it against. A guard is not matched; it is evaluated, once its variables are bound.
Variants§
Var(String, Span)
A pattern variable bound to a literal payload by some other atom.
Lit(String, Span)
A literal constant written in the guard.
App
(prim arg...).
Trait Implementations§
impl Eq for PredExpr
impl StructuralPartialEq for PredExpr
Auto Trait Implementations§
impl Freeze for PredExpr
impl RefUnwindSafe for PredExpr
impl Send for PredExpr
impl Sync for PredExpr
impl Unpin for PredExpr
impl UnsafeUnpin for PredExpr
impl UnwindSafe for PredExpr
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> 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.