pub struct EGraph { /* private fields */ }Expand description
Equality graph (e-graph) for congruence closure.
Implementations§
Source§impl EGraph
impl EGraph
Sourcepub fn find(&mut self, eclass_id: EClassId) -> EClassId
pub fn find(&mut self, eclass_id: EClassId) -> EClassId
Find canonical e-class ID (with path compression).
Sourcepub fn merge(
&mut self,
a: EClassId,
b: EClassId,
explanation: EqualityExplanation,
) -> Result<EClassId, String>
pub fn merge( &mut self, a: EClassId, b: EClassId, explanation: EqualityExplanation, ) -> Result<EClassId, String>
Merge two e-classes.
Sourcepub fn process_congruences(&mut self) -> Result<(), String>
pub fn process_congruences(&mut self) -> Result<(), String>
Process pending congruences.
Sourcepub fn get_representative(&mut self, term: TermId) -> Option<TermId>
pub fn get_representative(&mut self, term: TermId) -> Option<TermId>
Get canonical term for an e-class.
Sourcepub fn are_equal(&mut self, a: TermId, b: TermId) -> bool
pub fn are_equal(&mut self, a: TermId, b: TermId) -> bool
Check if two terms are in the same e-class.
Sourcepub fn get_explanation(
&mut self,
a: TermId,
b: TermId,
) -> Option<EqualityExplanation>
pub fn get_explanation( &mut self, a: TermId, b: TermId, ) -> Option<EqualityExplanation>
Get explanation for why two terms are equal.
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more