pub struct EngineLogicBuffer {
pub nodes: Vec<LogicNode>,
pub roots: Vec<u32>,
}Expand description
Flat logic buffer: a nodes array plus root indices.
Fields§
§nodes: Vec<LogicNode>§roots: Vec<u32>Implementations§
Source§impl LogicBuffer
impl LogicBuffer
Sourcepub fn split_roots(&self) -> Vec<LogicBuffer>
pub fn split_roots(&self) -> Vec<LogicBuffer>
Split a multi-root buffer into one independent single-root buffer per root,
so an .i-separated multi-sentence compile becomes N independently
assertable / retractable facts.
The split is exactly the roots boundary: nibli-semantics emits one root per bare
.i sentence, but a single root (an AndNode/OrNode) for logical
connectives (.ije/.ija/ge…gi). So bare .i splits into N buffers while
a connective stays as one compound fact — automatically, no text parsing.
Share-nodes strategy: each sub-buffer reuses the full nodes arena and
exposes a single root. Unreachable nodes belonging to sibling roots are inert
because every consumer traverses only from roots (see
nibli_reason::process_assertion). No index remapping, so no risk of a
mis-remapped child edge (notably CountNode’s middle field is a COUNT, not a
node index). roots.len() <= 1 returns a single clone (identity) so the
single-sentence path is unchanged.
Trait Implementations§
Source§impl Clone for LogicBuffer
impl Clone for LogicBuffer
Source§fn clone(&self) -> LogicBuffer
fn clone(&self) -> LogicBuffer
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more