Skip to main content

CcSnapshot

Struct CcSnapshot 

Source
pub struct CcSnapshot<Cfg: EGraphConfig> { /* private fields */ }
Expand description

A per-round search index over the live AC nodes, restricted to AC ops.

This is the narrow slice of crate::index::IndexStore that the completion search needs: the spec’s candidate set ⋃_{x ∈ distinct(M)} by_contains[x] ∩ by_op[f]. We pre-intersect with by_op[f] by keying on (op, child_repr), so a lookup directly yields the AC nodes of op f that contain child class x — no separate by_op intersection at use time.

Unlike IndexStore, this diagnostic index covers only AC ops and carries no by_repr/by_child_pos. Production completion currently finds candidates through class use-lists instead. Subsumed nodes are skipped, matching IndexStore.

Node ids in each bucket are sorted and deduplicated.

Implementations§

Source§

impl<Cfg: EGraphConfig> CcSnapshot<Cfg>
where MSetCanon: VarCanon<Cfg::G, Cfg::C>,

Source

pub fn build<L: LitVal, const TRACK: bool, const PROOFS: bool>( eg: &EGraph<Cfg, L, TRACK, PROOFS>, ) -> Self

Build the snapshot from the current e-graph state. Walks every node once, keeping only AC nodes (ops.is_mset), skipping subsumed nodes.

Source

pub fn completion_nodes(&self) -> &[Cfg::G]

All live AC node ids (sorted). These are the completion targets — each is both a node +M = d to complete and a rule +M → d to complete against.

Source

pub fn partners(&self, op: Cfg::O, child_repr: Cfg::G) -> &[Cfg::G]

AC nodes of op op that contain child class child_repr (sorted, deduped). This is the spec’s by_contains[child_repr] ∩ by_op[op], pre-intersected.

Auto Trait Implementations§

§

impl<Cfg> Freeze for CcSnapshot<Cfg>
where HashMap<(<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::G), Vec<<Cfg as EGraphConfig>::G>, RandomState>: Freeze, Vec<<Cfg as EGraphConfig>::G>: Freeze,

§

impl<Cfg> RefUnwindSafe for CcSnapshot<Cfg>
where HashMap<(<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::G), Vec<<Cfg as EGraphConfig>::G>, RandomState>: RefUnwindSafe, Vec<<Cfg as EGraphConfig>::G>: RefUnwindSafe,

§

impl<Cfg> Send for CcSnapshot<Cfg>
where HashMap<(<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::G), Vec<<Cfg as EGraphConfig>::G>, RandomState>: Send, Vec<<Cfg as EGraphConfig>::G>: Send,

§

impl<Cfg> Sync for CcSnapshot<Cfg>
where HashMap<(<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::G), Vec<<Cfg as EGraphConfig>::G>, RandomState>: Sync, Vec<<Cfg as EGraphConfig>::G>: Sync,

§

impl<Cfg> Unpin for CcSnapshot<Cfg>
where HashMap<(<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::G), Vec<<Cfg as EGraphConfig>::G>, RandomState>: Unpin, Vec<<Cfg as EGraphConfig>::G>: Unpin,

§

impl<Cfg> UnsafeUnpin for CcSnapshot<Cfg>
where HashMap<(<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::G), Vec<<Cfg as EGraphConfig>::G>, RandomState>: UnsafeUnpin, Vec<<Cfg as EGraphConfig>::G>: UnsafeUnpin,

§

impl<Cfg> UnwindSafe for CcSnapshot<Cfg>
where HashMap<(<Cfg as EGraphConfig>::O, <Cfg as EGraphConfig>::G), Vec<<Cfg as EGraphConfig>::G>, RandomState>: UnwindSafe, Vec<<Cfg as EGraphConfig>::G>: 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.