pub struct EquivClassSystem { /* private fields */ }Expand description
Equivalence class representative system.
Given an equivalence relation, this tracks canonical representatives for each equivalence class using a union-find style approach.
Implementations§
Source§impl EquivClassSystem
impl EquivClassSystem
Sourcepub fn insert(&mut self, expr: Expr)
pub fn insert(&mut self, expr: Expr)
Register expr as its own representative (singleton class).
Sourcepub fn merge(&mut self, a: &Expr, b: &Expr)
pub fn merge(&mut self, a: &Expr, b: &Expr)
Merge the classes of a and b (choosing a as canonical).
Sourcepub fn same_class(&self, a: &Expr, b: &Expr) -> bool
pub fn same_class(&self, a: &Expr, b: &Expr) -> bool
Check whether a and b have the same representative.
Trait Implementations§
Source§impl Clone for EquivClassSystem
impl Clone for EquivClassSystem
Source§fn clone(&self) -> EquivClassSystem
fn clone(&self) -> EquivClassSystem
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 EquivClassSystem
impl Debug for EquivClassSystem
Source§impl Default for EquivClassSystem
impl Default for EquivClassSystem
Source§fn default() -> EquivClassSystem
fn default() -> EquivClassSystem
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for EquivClassSystem
impl RefUnwindSafe for EquivClassSystem
impl Send for EquivClassSystem
impl Sync for EquivClassSystem
impl Unpin for EquivClassSystem
impl UnsafeUnpin for EquivClassSystem
impl UnwindSafe for EquivClassSystem
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