math-deduct
The groupant beside math/src/deduct.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 |
dag_reuse | dag_reuse | partial source derived model | dag_reuse |
numeric_guard | numeric_guard | partial source derived model | numeric_guard |
representation_transport | representation_transport | partial source derived model | representation_transport |
inference_training_state | inference_training_state | partial source derived model | inference_training_state |
Parts
Model text
descriptant
math-deduct
Reusable quantity-pool DAG search and postfix gold conversion.
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
Comb appends node retaining pool; Stop marks done. Candidate self-pairs absent, +/* only i<j. apply rejects zero divisor then nonfinite/negative/>1e12. Gold memoizes ordered subtree keys, normalizes commutative operand indices, allows1..8 operations and child indices<=255.
Domain
Valid pool/feature indices and finite scores assumed. Gold can emit self-combinations for repeated subtrees although search forbids them; gold acceptance is not reachability. u8 indices/uses and training clocks lack overflow certificates.
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 pool/feature indices and finite scores assumed. Gold can emit self-combinations for repeated subtrees although search forbids them; gold acceptance is not reachability. u8 indices/uses and training clocks lack overflow certificates.
Cost
Training constructor has three 2^22 arrays (~48MiB); averaged weights~16MiB. Precompute O(N²F); search O(SB(N+S)²) transitions times scoring/clone work and sorting.
Allocation failure, deep recursion, malformed public structures and universal numerical bounds are not verified.
composition
Scoped composition
Reusable quantity-pool DAG search and postfix gold conversion.
Comb appends node retaining pool; Stop marks done. Candidate self-pairs absent, +/* only i<j. apply rejects zero divisor then nonfinite/negative/>1e12. Gold memoizes ordered subtree keys, normalizes commutative operand indices, allows1..8 operations and child indices<=255.
steps::Prob descriptions build Pre feature tables; gold_of maps Tree supervision into graph constraints and gold_steps. Search disallows self-pairs even where repeated gold subtree maps to same child id, so that join is partial.
models
Typed relations
behavior_complement
Successful Comb excludes zero divisor and invalid/range-exceeding result. Gold rejects leaf-only or>8 operations; does not establish leaf index<n. beam0 training and huge pools unsupported.
reverse_reconstruction
Canonical tkey admits swapped commutative children; final value admits many DAGs and weights. Memoized repeated subtrees hide repeated source tree occurrences.
dag_reuse
Pool persists so previous intermediate values can be reused; self-pair gold/search mismatch remains explicit.
numeric_guard
Result interval [0,1e12], finite; integrality tolerance1e-6 only applied at topk.
representation_transport
tkey sorts commutative child strings, gold memo key does not; permuted equal trees need not share memo node.
inference_training_state
averaged empties acc/stamp; inference use only, subsequent learn unsafe.
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 deduct::wave28::dag_gold_reuses_subtrees_and_canonicalizes ... ok
test deduct::wave28::numeric_transition_boundary ... 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 dense Model allocation, beam/training/topk run; private apply/cands and gold conversion only. Gold self-pair/search mismatch documented without production change.
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/deduct.rs.groupant/