latex-main-parse
The groupant beside latex/src/main.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
| component | label | where |
|---|---|---|
| approximant | partial | approximant |
| ast | partial | ../syntax.json |
| composition | partial | composition |
| descriptant | present | descriptant |
| invariant | partial | invariant |
| tests | executed bounded checks | tests |
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.
| id | type | label | where |
|---|---|---|---|
behavior_complement | behavior_complement | partial source derived model | behavior_complement |
reverse_reconstruction | reverse_reconstruction | partial source derived model | reverse_reconstruction |
options | options | partial source derived model | options |
read_order | read_order | partial source derived model | read_order |
gate_exit | gate_exit | partial source derived model | gate_exit |
unknown_exit | unknown_exit | partial source derived model | unknown_exit |
Model text
descriptant
latex-main-parse
cmd_parse selects last source/macros, loads macro file, parses, prints tree/text/unknown/gate then calls bridge. Read/parse fail, gate diagnostics do not change success.
Epoch 2026-10-31: complete sources read before tests/model edits. Partial source-bound modeling; no production optimization or speed claim. Nested fragments share the parent lexical syntax. Caller/callee contracts outside owned files remain delegated.
approximant
Forward relation
cmd_parse selects last source/macros, loads macro file, parses, prints tree/text/unknown/gate then calls bridge. Read/parse fail, gate diagnostics do not change success.
Domain and executable surrogate gap
Bounded UTF-8 inputs and synthetic local files; supported parser-produced trees and representable arithmetic. Arbitrary public constructors are not certified total. Exact categorical semantics lack a useful percentage surrogate; no executable approximant attachment. Future numerical profiles require an explicit metric, zero case, source/evidence binding and supported 1/2/5/10% cap. Failure/effect differences cannot count as numerical error.
invariant
Invariant
For the scoped transition bytes [1243,2870): cmd_parse selects last source/macros, loads macro file, parses, prints tree/text/unknown/gate then calls bridge. Read/parse fail, gate diagnostics do not change success. Parse Err excludes tree print/gate/bridge; absent source usage precedes read.
Cost
Linear args plus macro file bytes, parse/print/gate/bridge and output.
Allocation failure, stack exhaustion and unchecked counter overflow have no additional certificate. No timing claim or global error bound.
composition
Composition
cmd_parse selects last source/macros, loads macro file, parses, prints tree/text/unknown/gate then calls bridge. Read/parse fail, gate diagnostics do not change success.
For the scoped transition bytes [1243,2870): cmd_parse selects last source/macros, loads macro file, parses, prints tree/text/unknown/gate then calls bridge. Read/parse fail, gate diagnostics do not change success. Parse Err excludes tree print/gate/bridge; absent source usage precedes read.
Parser, printer, AST equality, Macros, Rat and evaluator dependencies retain their own contracts. Structural roundtrip is not arithmetic definedness or numeric truth. Exact lexical binding does not prove caller/callee semantics.
models
behavior_complement
Parse Err excludes tree print/gate/bridge; absent source usage precedes read.
reverse_reconstruction
Same exit/output compatible with overwritten earlier args; success cannot establish supported math or known commands.
options
Complete macros consumes next token, other values overwrite source.
read_order
Macro read failure before source print.
gate_exit
Mismatch/reparse error diagnostic only.
unknown_exit
Unknown positions printed without failure.
tests
Selected evidence
cargo test -p latex --features math --bin latex wave28
Two debug/two release executions retained matching sorted named outcomes. External wave28 latexbridge receipts retain numeric exits, compiled assertion controls, restoration, feature checks and source-test map. This scope is not exhaustive branch coverage; parent tests may only exercise some child transitions. Frozen VMM DATA/classification/hash subprocess, live corpus, teacher/API, training/GPU excluded. Reexport/feature compilation is separate from runtime semantics.
This page in Markdown โ https://md.groupants.elamur.ai/free/en/mova/latex/src/main.rs.groupant/parse.groupant/