pub struct DiscTree<T> { /* private fields */ }Expand description
A discrimination tree mapping term/expression patterns to payloads.
Term and expression patterns share one tree — their key alphabets are disjoint by construction, so they never cross-match.
Implementations§
Source§impl<T> DiscTree<T>
impl<T> DiscTree<T>
pub fn new() -> Self
Sourcepub fn insert_term(&mut self, pattern: &ProofTerm, value: T)
pub fn insert_term(&mut self, pattern: &ProofTerm, value: T)
Index a term pattern (its Variables are the wildcard positions).
Sourcepub fn insert_expr(&mut self, pattern: &ProofExpr, value: T)
pub fn insert_expr(&mut self, pattern: &ProofExpr, value: T)
Index an expression pattern (its Variables are the wildcard positions).
Sourcepub fn candidates_term(&self, query: &ProofTerm) -> Vec<&T>
pub fn candidates_term(&self, query: &ProofTerm) -> Vec<&T>
Every pattern that could one-sided match the query term (superset —
confirm with crate::unify::match_term_pattern).
Sourcepub fn candidates_expr(&self, query: &ProofExpr) -> Vec<&T>
pub fn candidates_expr(&self, query: &ProofExpr) -> Vec<&T>
Every pattern that could one-sided match the query expression
(superset — confirm with crate::unify::match_expr_pattern).
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for DiscTree<T>
impl<T> RefUnwindSafe for DiscTree<T>where
T: RefUnwindSafe,
impl<T> Send for DiscTree<T>where
T: Send,
impl<T> Sync for DiscTree<T>where
T: Sync,
impl<T> Unpin for DiscTree<T>where
T: Unpin,
impl<T> UnsafeUnpin for DiscTree<T>
impl<T> UnwindSafe for DiscTree<T>where
T: UnwindSafe + RefUnwindSafe,
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