pub enum GenericNCommand<Head, Leaf>{
Show 18 variants
Sort(Span, String, Option<(String, Vec<GenericExpr<String, String>>)>),
Function(GenericFunctionDecl<Head, Leaf>),
AddRuleset(Span, String),
UnstableCombinedRuleset(Span, String, Vec<String>),
NormRule {
rule: GenericRule<Head, Leaf>,
},
CoreAction(GenericAction<Head, Leaf>),
Extract(Span, GenericExpr<Head, Leaf>, GenericExpr<Head, Leaf>),
RunSchedule(GenericSchedule<Head, Leaf>),
PrintOverallStatistics(Span, Option<String>),
Check(Span, Vec<GenericFact<Head, Leaf>>),
PrintFunction(Span, String, Option<usize>, Option<String>, PrintFunctionMode),
PrintSize(Span, Option<String>),
Output {
span: Span,
file: String,
exprs: Vec<GenericExpr<Head, Leaf>>,
},
Push(usize),
Pop(Span, usize),
Fail(Span, Box<GenericNCommand<Head, Leaf>>),
Input {
span: Span,
name: String,
file: String,
},
UserDefined(Span, String, Vec<Expr>),
}Expand description
A NCommand is a desugared Command, where syntactic sugars
like Command::Datatype and Command::Rewrite
are eliminated.
Most of the heavy lifting in egglog is done over NCommands.
GenericNCommand is a generalization of NCommand, like how GenericCommand
is a generalization of Command, allowing annotations over Head and Leaf.
TODO: The name “NCommand” used to denote normalized command, but this meaning is obsolete. A future PR should rename this type to something like “DCommand”.
Variants§
Sort(Span, String, Option<(String, Vec<GenericExpr<String, String>>)>)
Function(GenericFunctionDecl<Head, Leaf>)
AddRuleset(Span, String)
UnstableCombinedRuleset(Span, String, Vec<String>)
NormRule
Fields
§
rule: GenericRule<Head, Leaf>CoreAction(GenericAction<Head, Leaf>)
Extract(Span, GenericExpr<Head, Leaf>, GenericExpr<Head, Leaf>)
RunSchedule(GenericSchedule<Head, Leaf>)
PrintOverallStatistics(Span, Option<String>)
Check(Span, Vec<GenericFact<Head, Leaf>>)
PrintFunction(Span, String, Option<usize>, Option<String>, PrintFunctionMode)
PrintSize(Span, Option<String>)
Output
Push(usize)
Pop(Span, usize)
Fail(Span, Box<GenericNCommand<Head, Leaf>>)
Input
UserDefined(Span, String, Vec<Expr>)
Implementations§
Source§impl<Head, Leaf> GenericNCommand<Head, Leaf>
impl<Head, Leaf> GenericNCommand<Head, Leaf>
pub fn to_command(&self) -> GenericCommand<Head, Leaf>
pub fn visit_exprs( self, f: &mut impl FnMut(GenericExpr<Head, Leaf>) -> GenericExpr<Head, Leaf>, ) -> Self
Trait Implementations§
Source§impl<Head, Leaf> Clone for GenericNCommand<Head, Leaf>
impl<Head, Leaf> Clone for GenericNCommand<Head, Leaf>
Source§fn clone(&self) -> GenericNCommand<Head, Leaf>
fn clone(&self) -> GenericNCommand<Head, Leaf>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Head, Leaf> Debug for GenericNCommand<Head, Leaf>
impl<Head, Leaf> Debug for GenericNCommand<Head, Leaf>
Source§impl<Head, Leaf> Hash for GenericNCommand<Head, Leaf>
impl<Head, Leaf> Hash for GenericNCommand<Head, Leaf>
Source§impl<Head, Leaf> PartialEq for GenericNCommand<Head, Leaf>
impl<Head, Leaf> PartialEq for GenericNCommand<Head, Leaf>
impl<Head, Leaf> Eq for GenericNCommand<Head, Leaf>
impl<Head, Leaf> StructuralPartialEq for GenericNCommand<Head, Leaf>
Auto Trait Implementations§
impl<Head, Leaf> Freeze for GenericNCommand<Head, Leaf>
impl<Head, Leaf> RefUnwindSafe for GenericNCommand<Head, Leaf>where
Leaf: RefUnwindSafe,
Head: RefUnwindSafe,
impl<Head, Leaf> Send for GenericNCommand<Head, Leaf>
impl<Head, Leaf> Sync for GenericNCommand<Head, Leaf>
impl<Head, Leaf> Unpin for GenericNCommand<Head, Leaf>
impl<Head, Leaf> UnwindSafe for GenericNCommand<Head, Leaf>where
Leaf: UnwindSafe,
Head: UnwindSafe,
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
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