pub struct NeuroSymbolicSieve { /* private fields */ }Expand description
Neuro-symbolic grammar sieve (masks built once from tokenizer + lex — cold path may alloc).
Implementations§
Source§impl NeuroSymbolicSieve
impl NeuroSymbolicSieve
Sourcepub fn from_lex_and_tokenizer(
lex: &Q42LexMmap<'_>,
tok: &GgufTokenizer,
spec: &SieveLexSpec,
) -> Self
pub fn from_lex_and_tokenizer( lex: &Q42LexMmap<'_>, tok: &GgufTokenizer, spec: &SieveLexSpec, ) -> Self
Build masks from a memory-mapped .q42.lex view and GGUF tokenizer (load-time only).
Sourcepub fn from_gguf_tokenizer(tok: &GgufTokenizer) -> Self
pub fn from_gguf_tokenizer(tok: &GgufTokenizer) -> Self
Tokenizer-only fallback when no .q42.lex sidecar is loaded (dev / tests).
Sourcepub fn state(&self) -> SieveState
pub fn state(&self) -> SieveState
Current sieve FSM state.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
true when the sieve reached a complete state.
Sourcepub fn emitted_len(&self) -> u8
pub fn emitted_len(&self) -> u8
Length of the emitted-token buffer.
Sourcepub fn current_mask(&self) -> &SieveStateMask
pub fn current_mask(&self) -> &SieveStateMask
The current state’s token mask.
Sourcepub fn apply_token(&mut self, token_id: u32) -> Result<(), SieveError>
pub fn apply_token(&mut self, token_id: u32) -> Result<(), SieveError>
Apply a sieve-selected token and advance the FSM.
Sourcepub fn assemble_quin(&self, context_hash: u64) -> NQuin
pub fn assemble_quin(&self, context_hash: u64) -> NQuin
Assemble the 48-byte NQuin from constrained emissions (stack only).
Sourcepub fn masks_ready(&self) -> bool
pub fn masks_ready(&self) -> bool
true when masks for all states have been provisioned.
Trait Implementations§
Source§impl Clone for NeuroSymbolicSieve
impl Clone for NeuroSymbolicSieve
Auto Trait Implementations§
impl Freeze for NeuroSymbolicSieve
impl RefUnwindSafe for NeuroSymbolicSieve
impl Send for NeuroSymbolicSieve
impl Sync for NeuroSymbolicSieve
impl Unpin for NeuroSymbolicSieve
impl UnsafeUnpin for NeuroSymbolicSieve
impl UnwindSafe for NeuroSymbolicSieve
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
Converts
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> ⓘ
Converts
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