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>
impl<Cfg: EGraphConfig> CcSnapshot<Cfg>
Sourcepub fn build<L: LitVal, const TRACK: bool, const PROOFS: bool>(
eg: &EGraph<Cfg, L, TRACK, PROOFS>,
) -> Self
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.
Sourcepub fn completion_nodes(&self) -> &[Cfg::G]
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.