formula-syntax
The groupant beside models/formula-syntax.groupant 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 | forward |
| ast | not materialized | |
| composition | partial | composition |
| cost | symbolic source derived | cost |
| descriptant | present | descriptant |
| invariant | partial | invariant |
| tests | see source local evidence | checks |
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 |
table-transport | representation_transport | partial source derived model | table-transport |
marker-discipline | substream_boundary | partial source derived model | marker-discipline |
canonical-adapters | roundtrip_adapter | partial source derived model | canonical-adapters |
resource-guards | resource_boundary | partial source derived model | resource-guards |
Model text
descriptant
formula-syntax: wave28
Generated enum order must match canonical arrays. Stack reversal preserves expansion order. Printer relax adapters prevent unknown swallowing groups and aligned swallowing brackets; optional rbrack and trailing-row compensation preserve parser structure. Span quotient cannot validate original coordinates.
This source-bound partial group organizes existing Mova code. Native evidence and excluded effects are recorded in source sidecars and the root wave28 report. Registration is not a universal proof or whole-system runtime claim.
model
formula-syntax
forward
Ordered command rows compile to enums/lookups. Lex(source)->positioned tokens; scan(preamble)->macro map; parse_with(tokens,map)->Result<Node,Error>; print(Node)->canonical bytes; gate compares reparsed Node modulo Span. Text is a separate lossy projection.
invariant
Local macros shadow document definitions, CmdRaw preserves captured built-ins. Normalized parser trees retain unknown names and presentation structure; coordinates are outside equality.
cost
Build O(B+V²+E) expected hash work; lex O(B); parse cost depends on expanded tokens and substitution copies, not input bytes alone. LaTeX O(nodes+output); text nested temporary copies conservatively O(depth*output+nodes). No speed claim.
composition
Generated enum order must match canonical arrays. Stack reversal preserves expansion order. Printer relax adapters prevent unknown swallowing groups and aligned swallowing brackets; optional rbrack and trailing-row compensation preserve parser structure. Span quotient cannot validate original coordinates.
domain
Finite valid UTF-8, representable u32 positions, available memory/filesystem. Roundtrip restricted to normalized supported parser trees, not arbitrary public AST.
limitations
Generated include matches command table. No semantic TeX engine, precedence inference or live effects. Build compile evidence does not inject write/read failures.
checks
- Selected library/gate/build tests twice debug/release, matching sorted outcomes
- Four compiled assertion-failing mutants and restored positives
- Eight paired syntax projections
catalog
behavior-complement
Exclude tuples violating byte coordinates, local-first expansion, stop errors and supported fixture canonicalization; no universal arbitrary-AST contract.
reverse-reconstruction
Canonical tree preimages contain aliases, whitespace/comments, dropped styles and macro programs. Original coordinates/definitions are not uniquely recoverable.
table-transport
Ordered build rows induce discriminants/arrays and lookup Entry joins parser dispatch.
marker-discipline
End markers delimit parser substreams. Stream group_tokens/opt_tokens and macros collect_until explicitly restore End on their failure paths. Macro match_pattern literal matching consumes the next token before comparison and can consume End on mismatch; read_let can likewise consume an invalid End target. No universal scan-failure preservation law is claimed.
canonical-adapters
relax, rbrack and row compensation preserve parsing boundaries.
resource-guards
Depth and expansion thresholds are local; pre-expansion token check does not bound peak substituted vector.
This page in Markdown ā https://md.groupants.elamur.ai/free/en/mova/models/formula-syntax.groupant/