pub struct Substitution { /* private fields */ }Expand description
Vec-based substitution with trail for efficient backtracking. Bindings are stored in a Vec indexed by VarId (O(1) lookup/bind). The trail records which VarIds were bound, enabling undo on backtracking.
Implementations§
Source§impl Substitution
impl Substitution
pub fn new() -> Self
Sourcepub fn with_capacity(n: usize) -> Self
pub fn with_capacity(n: usize) -> Self
Create a substitution pre-sized for the given number of variables.
Sourcepub fn trail_mark(&self) -> usize
pub fn trail_mark(&self) -> usize
Get the current trail mark (for backtracking).
Sourcepub fn walk(&self, term: &Term) -> Term
pub fn walk(&self, term: &Term) -> Term
Dereference: follow variable chains to their ultimate value.
Trait Implementations§
Source§impl Clone for Substitution
impl Clone for Substitution
Source§fn clone(&self) -> Substitution
fn clone(&self) -> Substitution
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 Substitution
impl Debug for Substitution
Auto Trait Implementations§
impl Freeze for Substitution
impl RefUnwindSafe for Substitution
impl Send for Substitution
impl Sync for Substitution
impl Unpin for Substitution
impl UnsafeUnpin for Substitution
impl UnwindSafe for Substitution
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