pub struct EquivManager { /* private fields */ }Expand description
Equivalence manager for caching def_eq results during type checking.
Provides two layers of caching:
- A set of expression pairs known to be definitionally equal.
- A set of expression pairs known to NOT be definitionally equal (failure cache).
The failure cache is critical for performance: when lazy delta reduction tries multiple unfolding strategies, caching failures avoids redundant work.
Implementations§
Source§impl EquivManager
impl EquivManager
Sourcepub fn add_equiv(&mut self, a: &Expr, b: &Expr)
pub fn add_equiv(&mut self, a: &Expr, b: &Expr)
Record that two expressions are definitionally equal.
Sourcepub fn is_equiv(&mut self, a: &Expr, b: &Expr) -> bool
pub fn is_equiv(&mut self, a: &Expr, b: &Expr) -> bool
Check if two expressions are known to be definitionally equal.
Sourcepub fn add_failure(&mut self, a: &Expr, b: &Expr)
pub fn add_failure(&mut self, a: &Expr, b: &Expr)
Record that two expressions are NOT definitionally equal.
Sourcepub fn is_failure(&self, a: &Expr, b: &Expr) -> bool
pub fn is_failure(&self, a: &Expr, b: &Expr) -> bool
Check if two expressions are known to NOT be definitionally equal.
Sourcepub fn num_failures(&self) -> usize
pub fn num_failures(&self) -> usize
Get the number of cached failures.
Trait Implementations§
Source§impl Debug for EquivManager
impl Debug for EquivManager
Auto Trait Implementations§
impl Freeze for EquivManager
impl RefUnwindSafe for EquivManager
impl Send for EquivManager
impl Sync for EquivManager
impl Unpin for EquivManager
impl UnsafeUnpin for EquivManager
impl UnwindSafe for EquivManager
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