math-steps-transition
The groupant beside math/src/steps.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 |
stack_accounting | stack_accounting | partial source derived model | stack_accounting |
oracle_reachability | oracle_reachability | partial source derived model | oracle_reachability |
Model text
descriptant
math-steps-transition
SHIFT increases next and stack length by1, then fix_leaf_vals restores qs[leaf].val; SKIP increases next only. REDUCE/FAR consumes two stack items and appends one operation tree, representative=max(source indices). legal precedes apply only in generated search.
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
SHIFT increases next and stack length by1, then fix_leaf_vals restores qs[leaf].val; SKIP increases next only. REDUCE/FAR consumes two stack items and appends one operation tree, representative=max(source indices). legal precedes apply only in generated search.
This source-derived relation is partial; no executable percentage surrogate or replacement is supplied.
invariant
Scoped domain and invariants
Aligned arrays and valid direct replay actions are preconditions. n<=64 is needed for oracle shift-mask operations. Empty prediction has no final single-item stack.
Cost
At most3N+2 rounds expand up to20 actions per beam state, with feature generation, state/tree cloning and candidate sorting; ACTIONS counts expansions, not wall time or exact arithmetic work.
models
behavior_complement
Generated SHIFT cannot consume a forbidden/out-of-range input. Generated reduction cannot divide by zero or make negative subtraction. oracle cannot accept overlapping leaf masks. Direct replay is not covered by these exclusions and may panic on invalid actions.
reverse_reconstruction
Two legal reduction schedules for (a+b)*(c+d) can produce the same tree; skipped unused quantities can differ while the resulting scalar agrees. Tree::Leaf0 and another equal-valued leaf can agree numerically without the same provenance.
stack_accounting
For a valid prefix, next=#SHIFT+#SKIP and stack_len=#SHIFT-#REDUCE-#FAR. Every reduction preserves the union of operand source leaves; no reuse transition is present.
oracle_reachability
oracle uses 64-bit masks and reduces only sibling subtrees within stack distance1..3. Disjoint leaf masks are necessary but do not alone guarantee a returned action sequence for arbitrary n/tree order.
tests
Scoped evidence
Oracle/replay and empty prediction only; no nonempty beam or training.
Named actual source fixtures: steps::wave28::{equation_oracle_and_exact_replay; calculator_validation_and_script_bounds}.
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/steps.rs.groupant/transition.groupant/