pub struct NodeStore<G: DenseId<Index = I::Index>, O: DenseId, V: DenseId, C: Tagged + Clone + Copy + Hash + Eq + Debug, I: NodeIds, const TRACK: bool = true, const PROOFS: bool = false> {
pub plain0: FixedArityCache<G, O, I::L0, 0, TRACK, PROOFS>,
pub plain1: FixedArityCache<G, O, I::L1, 1, TRACK, PROOFS>,
pub plain2: FixedArityCache<G, O, I::L2, 2, TRACK, PROOFS>,
pub plain3: FixedArityCache<G, O, I::L3, 3, TRACK, PROOFS>,
pub spair: FixedArityCache<G, O, I::LSPair, 2, TRACK, PROOFS>,
pub plain_n: VariableArityCache<G, O, G, I::LN, TRACK, PROOFS>,
pub seq: VariableArityCache<G, O, G, I::LSeq, TRACK, PROOFS>,
pub mset: VariableArityCache<G, O, C, I::LMSet, TRACK, PROOFS>,
pub set: VariableArityCache<G, O, G, I::LSet, TRACK, PROOFS>,
pub lit: LitCache<G, O, V, I::LLit, TRACK>,
/* private fields */
}Fields§
§plain0: FixedArityCache<G, O, I::L0, 0, TRACK, PROOFS>§plain1: FixedArityCache<G, O, I::L1, 1, TRACK, PROOFS>§plain2: FixedArityCache<G, O, I::L2, 2, TRACK, PROOFS>§plain3: FixedArityCache<G, O, I::L3, 3, TRACK, PROOFS>§spair: FixedArityCache<G, O, I::LSPair, 2, TRACK, PROOFS>§plain_n: VariableArityCache<G, O, G, I::LN, TRACK, PROOFS>§seq: VariableArityCache<G, O, G, I::LSeq, TRACK, PROOFS>§mset: VariableArityCache<G, O, C, I::LMSet, TRACK, PROOFS>§set: VariableArityCache<G, O, G, I::LSet, TRACK, PROOFS>§lit: LitCache<G, O, V, I::LLit, TRACK>Implementations§
Source§impl<G, O, V, C, I, const TRACK: bool, const PROOFS: bool> NodeStore<G, O, V, C, I, TRACK, PROOFS>
impl<G, O, V, C, I, const TRACK: bool, const PROOFS: bool> NodeStore<G, O, V, C, I, TRACK, PROOFS>
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn routing(&self) -> &TypedRouting<G, I, TRACK>
pub fn add<S: DenseId>( &mut self, op: O, children: &[G], ops: &OpRegistry<O, S, TRACK>, flags: u8, ) -> Added<G>
pub fn add_plain0(&mut self, op: O, flags: u8) -> Added<G>
pub fn add_plain1(&mut self, op: O, child: G, flags: u8) -> Added<G>
pub fn add_plain2(&mut self, op: O, children: [G; 2], flags: u8) -> Added<G>
pub fn add_plain3(&mut self, op: O, children: [G; 3], flags: u8) -> Added<G>
pub fn add_c(&mut self, op: O, children: [G; 2], flags: u8) -> Added<G>
pub fn add_plain_n(&mut self, op: O, children: &[G], flags: u8) -> Added<G>
pub fn add_a(&mut self, op: O, children: &[G], flags: u8) -> Added<G>
pub fn add_mset(&mut self, op: O, children: &[C], flags: u8) -> Added<G>
pub fn add_set(&mut self, op: O, children: &[G], flags: u8) -> Added<G>
pub fn add_lit(&mut self, op: O, lit: V, flags: u8) -> Added<G>
Sourcepub fn recanonize_node<S: DenseId>(
&mut self,
id: G,
find: impl Fn(G) -> G,
unit_of: impl Fn(O) -> Option<G>,
g_buf: &mut Vec<G>,
mset_buf: &mut Vec<C>,
collisions: &mut Vec<(G, G)>,
touched: &mut Vec<G>,
ops: &OpRegistry<O, S, TRACK>,
)
pub fn recanonize_node<S: DenseId>( &mut self, id: G, find: impl Fn(G) -> G, unit_of: impl Fn(O) -> Option<G>, g_buf: &mut Vec<G>, mset_buf: &mut Vec<C>, collisions: &mut Vec<(G, G)>, touched: &mut Vec<G>, ops: &OpRegistry<O, S, TRACK>, )
Recanonize a single node’s children after a union. Dispatches to the
appropriate cache with the correct canonization strategy.
g_buf — scratch for PlainN/A/ACI (child type G).
mset_buf — scratch for MSet children (child type C = (G, mult)).
collisions — destination for collision pairs to push onto worklist.
unit_of resolves an op to its identity (unit) class as of this rebuild
(the caller composes the per-op unit node with find), or None for ops without
a declared identity. It feeds the class-relative unit-drop law into MSet/Set
canonization, so a summand that merged into the unit’s class is dropped on
recanonize exactly as at build.
Sourcepub fn original_children(
&self,
id: G,
g_out: &mut Vec<G>,
mset_out: &mut Vec<C>,
) -> bool
pub fn original_children( &self, id: G, g_out: &mut Vec<G>, mset_out: &mut Vec<C>, ) -> bool
Retrieve original (pre-recanonize) children of a node.
Appends to g_out for all kinds except AC (which appends to mset_out).
Returns true if history was found.