Elamur Groupants⌕
☰

math-poly-rational

The groupant beside math/src/poly.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

componentlabelwhere
approximantpartialapproximant
astpartial../syntax.json
descriptantpresentdescriptant
invariantpartialinvariant
testsexecuted bounded checkstests

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.

idtypelabelwhere
behavior_complementbehavior_complementpartial source derived modelbehavior_complement
reverse_reconstructionreverse_reconstructionpartial source derived modelreverse_reconstruction
constant_evaluationconstant_evaluationpartial source derived modelconstant_evaluation
fraction_joinfraction_joinpartial source derived modelfraction_join
power_domainpower_domainpartial source derived modelpower_domain
failure_orderfailure_orderpartial source derived modelfailure_order

Model text

descriptant

math-poly-rational

rf converts expressions to reduced fractions, evaluating constant subtrees through calc Env; only exact Q constants and target-independent integer powers admitted. Divisor roots are saved before cancellation. Original syntax is not reconstructible from normalized fraction/domain. Parent Poly operations supply cost and normalization assumptions.

Epoch 2026-10-31: complete source read, parent AST reused; partial finite evidence only.

approximant

Scoped forward and cost

rf converts expressions to reduced fractions, evaluating constant subtrees through calc Env; only exact Q constants and target-independent integer powers admitted. Divisor roots are saved before cancellation. Original syntax is not reconstructible from normalized fraction/domain. Parent Poly operations supply cost and normalization assumptions.

No executable percent surrogate claimed.

invariant

Scoped invariant

rf converts expressions to reduced fractions, evaluating constant subtrees through calc Env; only exact Q constants and target-independent integer powers admitted. Divisor roots are saved before cancellation. Original syntax is not reconstructible from normalized fraction/domain. Parent Poly operations supply cost and normalization assumptions.

Source range[6191,9459) bound by manifest digest. Parent domain applies, not arbitrary public states.

models

Source-scoped typed relations

behavior_complement

rf division by identically zero divisor numerator excludes success. After (x²-1)/(x-1) reduction, a result omitting the recorded denominator root1 contradicts the domain trace.

reverse_reconstruction

Reduced(x+1)/1 admits both x+1 and (x²-1)/(x-1), but dens distinguishes their admitted domains. Even num,den,dens together admit multiple syntax/evaluation histories.

constant_evaluation

If target variable absent, evaluate through calc Env before syntax dispatch; only V::Q is accepted as constant. Approximate/string/list constants error, potentially after effects in Env.

fraction_join

Add/sub combine n1d2 ± n2d1 over d1d2; multiply n1n2/d1d2; division n1d2/d1*n2 after recording nonconstant n2. reduce divides gcd and makes denominator monic.

power_domain

Exponent must be target-independent and exact integer with |k|<=200. Negative powers swap numerator/denominator and record nonconstant numerator; no explicit identically-zero check on this negative-power branch.

failure_order

For ordinary binary forms rf processes left child then right. Division tests right numerator zero after both; power evaluates/checks exponent before base conversion. Failed conversion can retain earlier Env effects.

tests

Evidence

See ../tests.md for actual checks and source mutant; this fragment adds no runtime test.

rf converts expressions to reduced fractions, evaluating constant subtrees through calc Env; only exact Q constants and target-independent integer powers admitted. Divisor roots are saved before cancellation. Original syntax is not reconstructible from normalized fraction/domain. Parent Poly operations supply cost and normalization assumptions.

This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/math/src/poly.rs.groupant/rational.groupant/