Elamur GroupantsโŒ•
โ˜ฐ

qagen-gate-lexical

The groupant beside qagen/src/gate.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.

Facts

Implementation material. A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.

Components

componentlabelwhere
approximantpartial source modelforward
astpartial../syntax.json
compositionpartial source modelcomposition
costpartial source modelcost
descriptantpartial source modelepoch-memory
invariantpartial source modelinvariant
testsfinite observationchecks

Obernants

The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.

idtypelabelwhere
qagen-gate-lexical-complementbehavior_complementpartial source modelbehavior-complement
qagen-gate-lexical-reconstructionreverse_reconstructionpartial source modelreverse-reconstruction
qagen-gate-lexical-specializedgate_lexical_observationpartial source modelspecialization

Parts

Model text

Source SHA-256: 09328f711abf4b6453f95bed3d873deb205c8801d939841974416fe74e3e5806. Domain: finite supplied UTF-8 strings and synthetic Para values; rule V1/V2. Observation is the operation result specified below. Mathematical descriptions are source-level exact relations under stated assumptions, not a certified implementation theorem or numerical approximant.

forward

W maps scalar sequences to lowercase alphanumeric tokens with internal selected apostrophes; N removes quote classes, preserves internal apostrophes and punctuation, collapses whitespace; A trims nonalphanumeric edges of N; B(a,s) is existence of a substring interval with alphanumeric boundary guards.

behavior-complement

No empty answer span is accepted; skipped or reordered characters cannot be a span. This is scalar-boundary matching, not linguistic words or graphemes; apostrophe boundaries admit king in king's.

reverse-reconstruction

For normalized observation n, preimage is all strings x satisfying N(x)=n. Case, quote and whitespace variants supply nonunique witnesses; no universal idempotence or NFC claim. For span=true reconstruct all (a,s,i,j) satisfying interval equality and boundary predicates.

specialization

lexical_quotient: W and N are separate views, not interchangeable: red-ring and red,ring share W but have different N.

invariant

All accepted anchors are sorted unique local indices; accepted paragraph and question indices are 1-based. span_reason requires equal word/normalized sentence lengths and prevalidated in-range anchors; arbitrary direct callers can violate that precondition. Integer multiplication assumes representable counts; memory exhaustion and usize overflow are outside this model.

composition

Lexical children produce distinct W and N views. Row checks consume both plus parsed anchors; batch classification precedes row checks and paragraph accumulation adds deduplication/cap. Accepted tuples cannot be fed back as full rejection logs: that projection loses information. The lexical node composes normalization followed by boundary matching; it does not identify word equality with span equality.

cost

Let B be supplied bytes, R rows, S total paragraph sentence bytes and A answer length. Lexical normalization is O(B) scalar work/storage (lowercase expansion bounded by Unicode tables). Verbatim window comparisons cost O(total sentence tokens * answer tokens). Span matching with repeated suffix checks is conservatively O(S*A); anchors O(K log K). Batch indexing O(R log N), stored raw/column rows O(B); each row rebuilds answer views and scans relevant sentence views. No measured speed or approximation-error claim.

epoch-memory

2026-10-30: prospective ratio/fold model predicted strict malformed-anchor and single-prefix repairs. Original production accepted 1,,2 and PP1. These are repaired without changing signatures; valid local numbering unchanged. Unicode interval search passed independent finite enumeration, including invalid first occurrence followed by valid occurrence. A test expectation counted six rejects for eleven rows capped at six; corrected to five before final evidence, not a production bug.

checks

Eight gate::wave17_models tests: Unicode interval oracle 341 squared = 116281 comparisons plus two overlap witnesses; batch integer-ratio oracle 220 cases; literal normalization; empty anchors; single prefix; cap/dense numbering; span/implicit composition; accepted-projection reconstruction. Synthetic Para only, no live teacher/parser/corpus/database. Debug/release twice and compiled mutations are recorded in root evidence.md. Finite evidence does not establish all Unicode/grapheme semantics or full source correctness.

This page in Markdown โ†’ https://md.groupants.elamur.ai/free/en/mova/qagen/src/gate.rs.groupant/lexical.groupant/