Skip to main content

EGraph

Struct EGraph 

Source
pub struct EGraph<L: Language, A: Analysis<L> = ()> {
    pub union_find: UnionFind,
    pub classes: DashMap<Id, EClass<L, A::Data>>,
    pub memo: DashMap<L, Id>,
    pub analysis: RwLock<A>,
    pub next_id: AtomicUsize,
    pub dirty: DashMap<Id, ()>,
}

Fields§

§union_find: UnionFind§classes: DashMap<Id, EClass<L, A::Data>>§memo: DashMap<L, Id>§analysis: RwLock<A>§next_id: AtomicUsize§dirty: DashMap<Id, ()>

Implementations§

Source§

impl<L: Language, A: Analysis<L>> EGraph<L, A>

Source

pub fn get_class(&self, id: Id) -> Ref<'_, Id, EClass<L, A::Data>>

Source

pub fn new() -> Self

Source

pub fn add(&self, enode: L) -> Id

Source

pub fn add_with_loc(&self, enode: L, loc: Loc) -> Id

Source

pub fn union(&self, id1: Id, id2: Id) -> Id

Source

pub fn rebuild(&self)

Trait Implementations§

Source§

impl<L: Debug + Language, A: Debug + Analysis<L>> Debug for EGraph<L, A>
where A::Data: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<L, A = ()> !Freeze for EGraph<L, A>

§

impl<L, A = ()> !RefUnwindSafe for EGraph<L, A>

§

impl<L, A> Send for EGraph<L, A>
where A: Send, L: Send, <A as Analysis<L>>::Data: Send,

§

impl<L, A> Sync for EGraph<L, A>
where A: Send + Sync, L: Send + Sync, <A as Analysis<L>>::Data: Send + Sync,

§

impl<L, A> Unpin for EGraph<L, A>
where A: Unpin,

§

impl<L, A> UnsafeUnpin for EGraph<L, A>
where A: UnsafeUnpin,

§

impl<L, A> UnwindSafe for EGraph<L, A>
where L: UnwindSafe, <A as Analysis<L>>::Data: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.