Elamur Groupants⌕
☰

prag-lens

The groupant beside prag/src/lens.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
astpartialsyntax.json
compositionpartial source modelcomposition
costpartial source modelcost
descriptantpartial source modelepoch-memory
invariantpartial source modelinvariant
testspartial source modelchecks

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
prag-lens-behavior-complementbehavior_complementpartial source modelbehavior-complement
prag-lens-reverse-reconstructionreverse_reconstructionpartial source modelreverse-reconstruction
prag-lens-couplingconstraint_relationpartial source modelcoupling

Model text

model

prag-lens

forward

Domain X is tagged calls Lens(W;E) or Means(L), with finite supplied Word sequence W, fixed compiled expression snapshot E and arbitrary finite Reading/Lens values L. No live lexical learning occurs. Let M=expressions_in_sentence(lower(forms W),lower(lemmas W);E). Lens maps each match m in M order to (join(original forms W[m.start..m.end],space),phrase,kind,meaning,register); its domains are sorted unique union of m.domains. Means selects readings whose phrase contains ASCII space, renders text + ' = ' + meaning stripped of every trailing period, joins with '; ', or returns '-' when selection is empty.

invariant

For Lens calls, reading count/order equal M count/order; text uses original surfaces, and domains=sort(unique(union domains(M))). For Means calls, only selected readings contribute, in order with multiplicity; empty selection yields '-'. Source-matcher span validity is a dependency premise.

cost

O(total form/lemma bytes) normalization plus external matcher cost; D emitted domain occurrences require O(D log D) sorting and O(D) storage. Reading and meaning rendering cost is linear in emitted bytes; matching costs are not measured here.

composition

Native supplied Words -> lens -> means uses compiled dictionary kick the bucket = To die. world::domains_with consumes means but independently filters expression domains; downstream world join is inspection only.

epoch-memory

2026-10-30 initial source-bound epoch. Irony malformed-head native witness panicked before bounds repair. Missing parent evidence now abstains while linear evidence remains. Lens/roles production unchanged. Costs are prospective asymptotic models; no optimization, percentage guarantee or timing claim.

Documentation audit, 2026-10-30: root relations now retain tagged API inputs, concrete observation constraints and compatible intermediates. Runtime source, syntax and existing test evidence are unchanged.

checks

cargo test -p prag --lib lens::wave12_models -- --test-threads=1. File-root evidence.md binds repeated profiles and mutants. No live parser/teacher/corpus or persisted exam evaluation.

behavior-complement

For the tagged input domain X above and matching output schema Y, let J(x,y) be the concrete forward/invariant constraints above. C_inner={(x,y) in X×Y | not J(x,y)} is a source-derived inner model of absent behavior. In particular exclude candidate outputs that violate: For Lens calls, reading count/order equal M count/order; text uses original surfaces, and domains=sort(unique(union domains(M))). For Means calls, only selected readings contribute, in order with multiplicity; empty selection yields '-'. Source-matcher span validity is a dependency premise. The native finite checks support selected members/nonmembers; no general Rust correspondence proof or claim about malformed state outside X is made.

reverse-reconstruction

B(tag,y)={tagged inputs and compatible matcher intermediate M satisfying the forward relation and yielding y}. Lens readings lose token boundaries inside joined surfaces and original lemma/head/POS fields; domain union loses occurrence multiplicity and order. Means loses all single-word readings, kind/register/domains and trailing-period multiplicity. Preserve E as a fixed provenance parameter; do not reconstruct one chosen dictionary or original sentence uniquely.

coupling

Native supplied Words -> lens -> means uses compiled dictionary kick the bucket = To die. world::domains_with consumes means but independently filters expression domains; downstream world join is inspection only.

Typed entries bind the manifest revision, stated domain and observation, assuming stable compiled dependencies and bounded execution. Status is partial source-derived relation with finite named checks. Partial syntax leaves macro bodies opaque and is no semantic proof.

evidence

Native evidence, 2026-10-30

Source SHA-256: a84730ba30aaee9f91a8581f16544d5769a824f59b7a6ba43470d8aa6a641603. Filter: cargo test -p prag --lib wave12_models -- --test-threads=1, with --release for release. Eight tests pass twice per profile with identical normalized names/results; each compiled production mutant fails a named assertion, exact byte restoration and all eight tests pass after each. Two legacy irony and two legacy roles tests also pass. No full-prag/world suite or Clippy claim.

Old-code witness invalid_heads_abstain_from_ancestry failed with an index panic (head 3 on two words). Repair ignores invalid parent evidence while retaining linear explicit incongruity. Ctx summaries are temporary document state, not persistent lesson-to-exam learning. Lexical test requires the compiled expression snapshot without silent skip. Fixture expectations are hand-authored independently of output.

Production control: Replace matched meaning with wrong: supplied_lexical_observation rejects exact meaning.

Three file roots and four fragments declare 21 typed views. Syntax generation repeats byte-identically; structural checks validate bindings and bounds, not semantics. Compiled dictionary and frame dependencies are premises. No live parser, teacher, corpus, GPU, held-out run or performance claim.

This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/prag/src/lens.rs.groupant/