pub struct EGraph<L: Language, N: Analysis<L> = ()> {
pub analysis: N,
/* private fields */
}Expand description
A datastructure to efficiently represent congruence relations on terms with binders.
Fields§
§analysis: NImplementations§
Source§impl<L: Language, N: Analysis<L>> EGraph<L, N>
impl<L: Language, N: Analysis<L>> EGraph<L, N>
pub fn explain_equivalence( &mut self, t1: RecExpr<L>, t2: RecExpr<L>, ) -> ProvenEq
Source§impl<L: Language, N: Analysis<L>> EGraph<L, N>
impl<L: Language, N: Analysis<L>> EGraph<L, N>
pub fn alloc_empty_eclass(&mut self, slots: &SmallHashSet<Slot>) -> Id
Source§impl<L: Language, N: Analysis<L>> EGraph<L, N>
impl<L: Language, N: Analysis<L>> EGraph<L, N>
pub fn union(&mut self, l: &AppliedId, r: &AppliedId) -> bool
pub fn union_justified( &mut self, l: &AppliedId, r: &AppliedId, j: Option<String>, ) -> bool
pub fn union_instantiations( &mut self, from_pat: &Pattern<L>, to_pat: &Pattern<L>, subst: &Subst, justification: Option<String>, ) -> bool
Source§impl<L: Language, N: Analysis<L>> EGraph<L, N>
impl<L: Language, N: Analysis<L>> EGraph<L, N>
Sourcepub fn with_subst_method<S: SubstMethod<L, N>>(analysis: N) -> Self
pub fn with_subst_method<S: SubstMethod<L, N>>(analysis: N) -> Self
Creates an empty e-graph, while specifying the substitution method to use.
pub fn slots(&self, id: Id) -> SmallHashSet<Slot>
pub fn analysis_data(&self, i: Id) -> &N::Data
pub fn analysis_data_mut(&mut self, i: Id) -> &mut N::Data
pub fn enodes(&self, i: Id) -> HashSet<L>
pub fn enodes_applied(&self, i: &AppliedId) -> Vec<L>
pub fn total_number_of_nodes(&self) -> usize
Sourcepub fn eq(&self, a: &AppliedId, b: &AppliedId) -> bool
pub fn eq(&self, a: &AppliedId, b: &AppliedId) -> bool
Checks that two AppliedIds are semantically equal.
Sourcepub fn get_syn_expr(&self, i: &AppliedId) -> RecExpr<L>
pub fn get_syn_expr(&self, i: &AppliedId) -> RecExpr<L>
Returns the canonical term corresponding to i.
This function will use EGraph::get_syn_node repeatedly to build up this term.
Sourcepub fn get_syn_node(&self, i: &AppliedId) -> L
pub fn get_syn_node(&self, i: &AppliedId) -> L
Returns the canonical e-node corresponding to i.
Source§impl<L: Language, N: Analysis<L>> EGraph<L, N>
impl<L: Language, N: Analysis<L>> EGraph<L, N>
Sourcepub fn progress(&self) -> ProgressMeasure
pub fn progress(&self) -> ProgressMeasure
Computes the ProgressMeasure of this E-Graph.
Trait Implementations§
Auto Trait Implementations§
impl<L, N = ()> !Freeze for EGraph<L, N>
impl<L, N = ()> !RefUnwindSafe for EGraph<L, N>
impl<L, N = ()> !Send for EGraph<L, N>
impl<L, N = ()> !Sync for EGraph<L, N>
impl<L, N> Unpin for EGraph<L, N>
impl<L, N> UnsafeUnpin for EGraph<L, N>where
N: UnsafeUnpin,
impl<L, N = ()> !UnwindSafe for EGraph<L, N>
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