pub struct EqualityDatabase { /* private fields */ }Expand description
A database of known equalities, used during elaboration.
This stores equalities as (lhs_name, rhs_name, proof_term) triples,
allowing the elaborator to look up existing proofs of equality rather than
re-deriving them.
Implementations§
Source§impl EqualityDatabase
impl EqualityDatabase
Sourcepub fn register(&mut self, lhs: Name, rhs: Name, proof: Expr)
pub fn register(&mut self, lhs: Name, rhs: Name, proof: Expr)
Register an equality lhs = rhs with the given proof term.
Sourcepub fn lookup(&self, lhs: &Name, rhs: &Name) -> Option<Expr>
pub fn lookup(&self, lhs: &Name, rhs: &Name) -> Option<Expr>
Look up a proof of lhs = rhs.
Returns the stored proof term if found, searching also the symmetric
direction and wrapping with Eq.symm as needed.
Sourcepub fn lookup_trans(&self, a: &Name, c: &Name) -> Option<Expr>
pub fn lookup_trans(&self, a: &Name, c: &Name) -> Option<Expr>
Look up a transitive equality a = c via a = b and b = c.
Trait Implementations§
Source§impl Clone for EqualityDatabase
impl Clone for EqualityDatabase
Source§fn clone(&self) -> EqualityDatabase
fn clone(&self) -> EqualityDatabase
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 EqualityDatabase
impl Debug for EqualityDatabase
Source§impl Default for EqualityDatabase
impl Default for EqualityDatabase
Source§fn default() -> EqualityDatabase
fn default() -> EqualityDatabase
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EqualityDatabase
impl RefUnwindSafe for EqualityDatabase
impl Send for EqualityDatabase
impl Sync for EqualityDatabase
impl Unpin for EqualityDatabase
impl UnsafeUnpin for EqualityDatabase
impl UnwindSafe for EqualityDatabase
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