math-understand
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 |
| 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 |
placeholder_transport | placeholder_transport | partial source derived model | placeholder_transport |
failure_precedence | failure_precedence | partial source derived model | failure_precedence |
unit_semantics | unit_semantics | partial source derived model | unit_semantics |
operator_associativity | operator_associativity | partial source derived model | operator_associativity |
Parts
Model text
descriptant
math-understand
Dictionary chunks, parser placeholder transport and ordered arithmetic frames.
Epoch 2026-10-31: source-derived partial model; prospective hypotheses retained before changes. Existing behavior unchanged except test helper path extraction. New bounded fixtures avoid annotated text/model/corpus/teacher paths. Child scopes use the parent syntax projection; lexical AST has no macro expansion or semantic resolution. Numeric thresholds and adapter differences are observations, not mathematical correctness proofs.
approximant
Forward relation
chunk prefers number then unit then word; standins preserve owner index but erase sign/unit details. parse_sentence maps heads, tree cases then fallback, conditions and deltas. Interp rejects unknown before absent numbers, then chance/percent/comparison/state/source/conversion. Pratt precedence1/2/3/4, power right-associative.
Domain
Valid annotation heads and nonempty Interp sentences assumed. Bare conversion target cannot supply default source scale. Rat parse errors may become unknown words. No teacher calls; annotation/model paths unexecuted.
Executable approximant gap
No useful measured percentage surrogate is supplied for these categorical parse/search/effect observations. Supported future caps are 1%, 2%, 5%, 10% only, requiring an explicit metric and reference comparison. No speed or accuracy guarantee follows.
invariant
Invariants and cost
Valid annotation heads and nonempty Interp sentences assumed. Bare conversion target cannot supply default source scale. Rat parse errors may become unknown words. No teacher calls; annotation/model paths unexecuted.
Cost
Token progression plus Rat/lookup work; repeated item/placeholder scans and subtree membership can be cubic; Pratt linear with nesting-depth recursion. Annotation separate.
Allocation failure, deep recursion, malformed public structures and universal numerical bounds are not verified.
composition
Scoped composition
Dictionary chunks, parser placeholder transport and ordered arithmetic frames.
chunk prefers number then unit then word; standins preserve owner index but erase sign/unit details. parse_sentence maps heads, tree cases then fallback, conditions and deltas. Interp rejects unknown before absent numbers, then chance/percent/comparison/state/source/conversion. Pratt precedence1/2/3/4, power right-associative.
lex lookup and units/Rat produce chunks; parser standins return mapped roles; ordered frames/Pratt produce Expr, which eval validates separately. Private helper tests bypass actual Annotator and cannot establish English quality.
models
Typed relations
behavior_complement
Unknown alphabetic token excludes success before quantity/frame gates. Missing scale and malformed fraction/parentheses reject. Helper success does not certify English parse or dimensional evaluation.
reverse_reconstruction
Many synonyms and parentheses lead to same Expr. standins cannot recover sign/unit/exact fraction without original Items; decimal fallback7 is lossy.
placeholder_transport
Quantity unit creates two tokens; fractions become half, sign removed, decimal failure uses7; owner index maps back to retained Item.
failure_precedence
Unknown-word gate before quantity and frames; chance preempts other triggers.
unit_semantics
Scale->Temp for absolute, delta->Qty(delta unit); Degrees requires explicit quantity scale, never bare target.
operator_associativity
Unary parses before power; nonpercent lhs +/- percent rhs rewrites lhs*(1 +/- rhs); slash fraction of multiplies.
tests
Source execution evidence
Safe command: cargo test -p math --lib wave28 -- --test-threads=1
Named outcomes (twice debug, twice release; sorted names equal; exits0):
test understand::wave28::chunk_units_and_placeholder_transport ... ok
test understand::wave28::pratt_precedence_and_percent_rewrite ... ok
test understand::wave28::rejection_precedence_and_scale_ambiguity ... ok
One compiled assertion control for this source: compilation0, false expectation test101, exact byte restore, focused positive rerun0. These are actual source assertions, not copied implementations or semantic proof. Controls ran before rustfmt-only test-block formatting.
No model load or parse_sentence; actual chunk/standins/Interp/Pratt helpers with synthetic tokens. English frames and annotation mapping remain partial.
Strict math lib Clippy reports113 pre-existing production lints. No executable percentage surrogate, speed claim, model/corpus/teacher/GPU/full-school or held-out execution.
This page in Markdown โ https://md.groupants.elamur.ai/free/en/mova/math/src/understand.rs.groupant/