pub struct ConfigM16;Expand description
31-bit ids with a 16-bit multiplicity: the low-ceiling witness for the width axis.
This is the same 31-bit e-graph as DefaultConfig with a deliberately small
multiplicity ceiling (65535 occurrences of one child in one AC node). Its purpose is to
keep EGraphConfig::M honest, in two ways a second wide config cannot:
- it does not compile against a hardcoded
Multiplicityanywhere on the generic paths, so the parameterization cannot silently rot back to a fixedu32; - its ceiling is reachable by a test. The checked narrowing and overflow paths are the whole point of the design, and at 32 bits provoking them needs four billion children.
It is not a space optimization: an AC child pairs a 4-byte id with the count and pads to 8 bytes at both 16 and 32 bits. Pick it when a low ceiling is wanted as a guard, not to save memory.
Trait Implementations§
Source§impl EGraphConfig for ConfigM16
impl EGraphConfig for ConfigM16
Source§type ClassKey = EClassKey
type ClassKey = EClassKey
Recycled key into the packed e-class data store. It has the same
payload width as
G, because the worst case has one class per node.Source§type M = Multiplicity16
type M = Multiplicity16
Multiplicity width for AC multiset nodes:
Multiplicity16,
Multiplicity, or Multiplicity64. Read moreSource§type Ids = DefaultNodeIds
type Ids = DefaultNodeIds
Local id bundle for the node store.
Source§fn mset_child_id(c: &Self::C) -> Self::G
fn mset_child_id(c: &Self::C) -> Self::G
Extract the global id from an AC child.
Source§fn mset_child_mult(c: &Self::C) -> Self::M
fn mset_child_mult(c: &Self::C) -> Self::M
Extract the multiplicity from an AC child.
Source§fn mset_child_with_mult(g: Self::G, mult: Self::M) -> Self::C
fn mset_child_with_mult(g: Self::G, mult: Self::M) -> Self::C
Create an AC child with a given multiplicity.
Source§fn mset_child_merge(existing: &mut Self::C, new_g: Self::G) -> bool
fn mset_child_merge(existing: &mut Self::C, new_g: Self::G) -> bool
Increment the multiplicity of an AC child. Returns true if same group. Read more
Source§fn mset_child_single(g: Self::G) -> Self::C
fn mset_child_single(g: Self::G) -> Self::C
Create an AC child with multiplicity 1.
Auto Trait Implementations§
impl Freeze for ConfigM16
impl RefUnwindSafe for ConfigM16
impl Send for ConfigM16
impl Sync for ConfigM16
impl Unpin for ConfigM16
impl UnsafeUnpin for ConfigM16
impl UnwindSafe for ConfigM16
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