math-understand-frames
The groupant beside math/src/understand.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 |
| 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 |
condition_selection | condition_selection | partial source derived model | condition_selection |
scale_transport | scale_transport | partial source derived model | scale_transport |
Model text
descriptant
math-understand-frames
Interp first rejects unknown words/symbols, then requires a quantity. It selects chance, percent change/share, percent adjustment, comparison, temperature-state, then source/conversion in order. default_scale is the first explicit quantity Scale, never a bare target.
Epoch 2026-10-31: replaced duplicate catalog sentences with concrete exclusions, compatible-antecedent examples and two distinct scoped behavioral views. Source and prior execution evidence are unchanged; this revision ran no tests.
approximant
Scoped forward relation
Interp first rejects unknown words/symbols, then requires a quantity. It selects chance, percent change/share, percent adjustment, comparison, temperature-state, then source/conversion in order. default_scale is the first explicit quantity Scale, never a bare target.
This source-derived relation is partial; no executable percentage surrogate or replacement is supplied.
invariant
Scoped domain and invariants
Nonempty Sent list and valid head indices are required. Error reasons encode first selected failure, not all possible failures. Downstream eval remains responsible for arithmetic/dimensional validity.
Cost
Repeated item cloning/scanning and subtree membership contribute costs; function subtree fallback and Rat duration conversion are distinct operations. Annotation cost is outside this fragment.
models
behavior_complement
Unknown alphabetic token cannot reach frame dispatch. A bare Fahrenheit target cannot supply a source scale for20 degrees. Later frame triggers cannot override an earlier selected frame, even if the earlier frame fails.
reverse_reconstruction
The same Expr may originate from a direct quantity, a sole condition quantity, or different synonym-based function frames. An unknown-word error admits sentences with or without numbers because that gate runs first.
condition_selection
All preceding sentence items are conditions; in the last sentence only cond=true items qualify. A lone condition quantity can supply source; multiple earlier-sentence quantities can fail as ambiguous.
scale_transport
A Scale quantity becomes Temp unless delta=true, when it becomes Qty with the delta unit. Degrees uses default_scale or fails; it does not infer source scale from conversion destination.
tests
Scoped evidence
Unknown/empty/ambiguous source scale and source-to-chain path; most frame branches and annotation unexecuted.
Named actual source fixtures: understand::wave28::{rejection_precedence_and_scale_ambiguity; pratt_precedence_and_percent_rewrite}.
Parent tests.md records commands and paired profiles. No additional coverage inferred from parent fixtures outside this byte range; source-scoped numeric/parse properties remain partial.
This page in Markdown โ https://md.groupants.elamur.ai/free/en/mova/math/src/understand.rs.groupant/frames.groupant/