pub struct InfonIndex<B: Postings> { /* private fields */ }Implementations§
Source§impl<B: Postings> InfonIndex<B>
impl<B: Postings> InfonIndex<B>
Sourcepub fn from_postings(raw: HashMap<String, Vec<u32>>, n: u32) -> Self
pub fn from_postings(raw: HashMap<String, Vec<u32>>, n: u32) -> Self
Build from token -> ascending sids. Callers accumulate sids in id order during a scan.
Sourcepub fn add_infon_polar(&mut self, sid: u32, token: &str, level: f32)
pub fn add_infon_polar(&mut self, sid: u32, token: &str, level: f32)
Record a token membership at sid with a Dempster-Shafer polarity level ∈ {-1, -0.5, +0.5, +1}
(paper §4). +1 strong-for, +0.5 weak-for, -0.5 weak-against, -1 strong-against. Presence is
always asserted; sign/magnitude are stored in the neg/weak auxiliary sets.
Sourcepub fn signed_mass(&self, token: &str, scope: &B) -> f64
pub fn signed_mass(&self, token: &str, scope: &B) -> f64
SIMD belief aggregation (paper §4.1): net signed mass of token over scope, computed as a
weighted POPCNT over roaring sets — +1·|strong-for| +0.5·|weak-for| −0.5·|weak-against| −1·|strong-against|, all within scope ∩ post(token).
Sourcepub fn evidence_set(&self, token: &str, min_bel: f64) -> B
pub fn evidence_set(&self, token: &str, min_bel: f64) -> B
Situations where token holds with per-situation belief ≥ min_bel, using the discrete level
map (+1→1.0 strong-for, +0.5→0.5 weak-for, present→>0). Powers IKL (evidence … :min-bel b).
Sourcepub fn belief_interval(&self, token: &str, scope: &B) -> (f64, f64)
pub fn belief_interval(&self, token: &str, scope: &B) -> (f64, f64)
Dempster-Shafer belief interval [Bel, Pl] for token over scope (paper §4.1): Bel = fraction
of scope with strong-for evidence (lower certainty bound); Pl = fraction not strongly refuted
(upper bound 1 − Bel(¬A)). Returns (bel, pl) in [0,1].
Sourcepub fn add_number(&mut self, sid: u32, field: &str, value: f64)
pub fn add_number(&mut self, sid: u32, field: &str, value: f64)
Record a numeric field value for a situation (columnar numeric layer).
Sourcepub fn numeric_fields(&self) -> impl Iterator<Item = &String>
pub fn numeric_fields(&self) -> impl Iterator<Item = &String>
Numeric fields present (for schema/agent discovery).
Sourcepub fn add(&mut self, tokens: &[String]) -> u32
pub fn add(&mut self, tokens: &[String]) -> u32
Append one situation’s tokens as a new sid (incremental / realtime ingest). Tokens should be de-duplicated by the caller. Returns the new sid.
pub fn vocab_size(&self) -> usize
pub fn tokens(&self) -> impl Iterator<Item = &String>
Sourcepub fn post(&self, token: &str) -> B
pub fn post(&self, token: &str) -> B
The posting set for an exact token (clone; empty if absent). Unlike atom, no glob handling —
the analytics programs address concrete tokens they discovered from the vocabulary.
pub fn post_len(&self, token: &str) -> usize
Sourcepub fn facet_members(&self, facet: &str) -> Vec<&String>
pub fn facet_members(&self, facet: &str) -> Vec<&String>
Every token under a facet (first path segment), unsorted and untruncated — the analytics
programs partition/rank over the full facet, not just the top-N tokens_in_facet returns.
Sourcepub fn tokens_in_facet(&self, facet: &str, limit: usize) -> Vec<(String, usize)>
pub fn tokens_in_facet(&self, facet: &str, limit: usize) -> Vec<(String, usize)>
The most frequent tokens under a facet, with posting sizes — so an agent can learn the queryable vocabulary of a facet before composing IKL.
Sourcepub fn postings(&self) -> impl Iterator<Item = (&String, &B)>
pub fn postings(&self) -> impl Iterator<Item = (&String, &B)>
Every (tag, postings) pair in the symbol table — the incidence matrix, row by row.
pub fn situations(&self) -> u32
Sourcepub fn postings_native_bytes(&self) -> usize
pub fn postings_native_bytes(&self) -> usize
Total native bytes across all postings (memory proxy for the chosen backend).
Sourcepub fn postings_deltagap_bytes(&self) -> usize
pub fn postings_deltagap_bytes(&self) -> usize
Total portable delta-gap bytes (same for every backend — the on-disk posting size).
Source§impl<B: Postings> InfonIndex<B>
impl<B: Postings> InfonIndex<B>
Sourcepub fn s_path_tokens(&self, a: &str, b: &str, s: usize) -> Option<Vec<String>>
pub fn s_path_tokens(&self, a: &str, b: &str, s: usize) -> Option<Vec<String>>
Tokens on an s-path from a to b: a chain where consecutive tokens share at least s situations
(paper §3.3). Returns None when either endpoint is unknown or no such chain exists.
Raising s is what suppresses semantic drift — at s = 1 a single shared situation links two tokens,
which lets a walk wander somewhere unrelated to where it began.
Breadth-first, so the chain found is the shortest. Neighbour discovery scans the symbol table, which is
linear per expansion; the paper’s answer to that cost is to filter the scope first, and the
(constraint …) clause in the query form is how a caller does it.
Trait Implementations§
Source§impl<B: Postings> TokenStore<B> for InfonIndex<B>
impl<B: Postings> TokenStore<B> for InfonIndex<B>
Source§fn evidence(&self, token: &str, min_bel: f64) -> B
fn evidence(&self, token: &str, min_bel: f64) -> B
The evidence atom of §6.1, backed by the polarity layer: situations where this token holds with
per-situation belief at or above the threshold. The trait default is plain membership, which would
ignore polarity entirely and quietly include refuted situations.
Source§fn s_path(&self, a: &str, b: &str, s: usize) -> Option<B>
fn s_path(&self, a: &str, b: &str, s: usize) -> Option<B>
The situations an s-path passes through: the union of the postings of the tokens on the chain, so the result composes with the rest of the set algebra.
fn atom(&self, pattern: &str) -> B
fn universe(&self) -> B
Auto Trait Implementations§
impl<B> Freeze for InfonIndex<B>
impl<B> RefUnwindSafe for InfonIndex<B>
impl<B> Send for InfonIndex<B>
impl<B> Sync for InfonIndex<B>
impl<B> Unpin for InfonIndex<B>
impl<B> UnsafeUnpin for InfonIndex<B>
impl<B> UnwindSafe for InfonIndex<B>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more