pub struct EGraph { /* private fields */ }Expand description
Extended equality graph for congruence closure with E-node tracking.
Provides richer structure than CongruenceClosure for proof reconstruction.
Implementations§
Source§impl EGraph
impl EGraph
Sourcepub fn add_expr(&mut self, expr: Expr) -> usize
pub fn add_expr(&mut self, expr: Expr) -> usize
Add an expression to the E-graph (creating a new singleton class if not present).
Sourcepub fn find_class(&self, expr: &Expr) -> Option<usize>
pub fn find_class(&self, expr: &Expr) -> Option<usize>
Get the class ID for an expression, if present.
Sourcepub fn merge_classes(&mut self, id1: usize, id2: usize, proof: Option<Expr>)
pub fn merge_classes(&mut self, id1: usize, id2: usize, proof: Option<Expr>)
Merge two equivalence classes.
Sourcepub fn are_equal(&self, e1: &Expr, e2: &Expr) -> bool
pub fn are_equal(&self, e1: &Expr, e2: &Expr) -> bool
Check if two expressions are in the same class.
Sourcepub fn add_equality(&mut self, e1: Expr, e2: Expr, proof: Option<Expr>)
pub fn add_equality(&mut self, e1: Expr, e2: Expr, proof: Option<Expr>)
Add an equality e1 = e2 with optional proof.
Sourcepub fn num_classes(&self) -> usize
pub fn num_classes(&self) -> usize
Get the number of equivalence classes.
Sourcepub fn representative(&self, expr: &Expr) -> Option<&Expr>
pub fn representative(&self, expr: &Expr) -> Option<&Expr>
Get the representative of the class containing expr.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EGraph
impl RefUnwindSafe for EGraph
impl Send for EGraph
impl Sync for EGraph
impl Unpin for EGraph
impl UnsafeUnpin for EGraph
impl UnwindSafe for EGraph
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