pub enum CodeTreeInstr {
CheckSymbol {
symbol: Spur,
arity: usize,
failure_pc: usize,
},
CheckVar {
failure_pc: usize,
},
CheckConstant {
value: TermId,
failure_pc: usize,
},
Bind {
var: PatternVar,
},
CheckEq {
var: PatternVar,
failure_pc: usize,
},
MoveToChild {
index: usize,
},
MoveToParent,
Yield {
quantifier: TermId,
pattern_idx: usize,
},
Halt,
}Expand description
Instruction in the code tree (compiled pattern matching bytecode).
Variants§
CheckSymbol
Check if current term has a specific function symbol. Args: (symbol_id, child_count, failure_pc)
CheckVar
Check if current term is a variable (for patterns with nested variables). Args: (failure_pc)
CheckConstant
Check if current term is a constant (specific value). Args: (value_id, failure_pc)
Bind
Bind current term to a pattern variable. Args: (variable_id)
Fields
§
var: PatternVarPattern variable ID
CheckEq
Check if current term matches a previously bound variable (occurs check). Args: (variable_id, failure_pc)
MoveToChild
Move to the i-th child of current term. Args: (child_index)
MoveToParent
Move to parent term (backtrack).
Yield
Yield a match with the current substitution. Args: (quantifier_id, pattern_index)
Halt
Halt execution (end of program).
Trait Implementations§
Source§impl Clone for CodeTreeInstr
impl Clone for CodeTreeInstr
Source§fn clone(&self) -> CodeTreeInstr
fn clone(&self) -> CodeTreeInstr
Returns a duplicate 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 Debug for CodeTreeInstr
impl Debug for CodeTreeInstr
Source§impl PartialEq for CodeTreeInstr
impl PartialEq for CodeTreeInstr
impl Eq for CodeTreeInstr
impl StructuralPartialEq for CodeTreeInstr
Auto Trait Implementations§
impl Freeze for CodeTreeInstr
impl RefUnwindSafe for CodeTreeInstr
impl Send for CodeTreeInstr
impl Sync for CodeTreeInstr
impl Unpin for CodeTreeInstr
impl UnwindSafe for CodeTreeInstr
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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