Elamur GroupantsāŒ•
☰

mathlib-main

The groupant beside tools/mathlib/src/main.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
astpartialsyntax.json
costpartialinvariant-and-cost
descriptantpresentdescriptant
invariantpartialinvariant-and-cost
testsbounded 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
flag_partitionflag_partitionpartial source derived modelflag_partition
numeric_defaultsnumeric_defaultspartial source derived modelnumeric_defaults
route_joinroute_joinpartial source derived modelroute_join
arity_asymmetryarity_asymmetrypartial source derived modelarity_asymmetry

Model text

descriptant

mathlib-main

CLI argv chooses a command, partitions rest with skip-next semantics for all nonboolean --flags, derives first-occurrence flag values/numbers, then invokes exactly the guarded command branch. sql joins duck::fill and duck::run; other routes remain separate.

Epoch 2026-10-31

Prospective model retained before changes. Existing production bytes are preserved; additions are bounded inline tests. Nine source groupants expose ingestion and routing boundaries; typed children bind exact source bytes and reuse their parent syntax projection. Native tests run twice per profile; behavior mutants run as compiled source changes and exact bytes are restored before positive checks.

Important retained observation: network-looking helpers are not all pure (DNS inside github_host and books build); selection deliberately excludes those effects. Mixed-format manifest order is not deterministic, and error paths do not imply rollback.

No network/DNS/download, real catalog/corpus/model/teacher or database execution. Effect paths are source-derived; finite helper tests are not universal verification. No executable percentage surrogate or speed claim; future caps require metric/domain/reference and remain 1/2/5/10%.

approximant

Forward relation

CLI argv chooses a command, partitions rest with skip-next semantics for all nonboolean --flags, derives first-occurrence flag values/numbers, then invokes exactly the guarded command branch. sql joins duck::fill and duck::run; other routes remain separate.

Model observations include returns, retained state and ordered partial effects; on external failures the successful-prefix relation replaces a total-function claim.

Composition

CLI argv chooses a command, partitions rest with skip-next semantics for all nonboolean --flags, derives first-occurrence flag values/numbers, then invokes exactly the guarded command branch. sql joins duck::fill and duck::run; other routes remain separate.

Scoped children isolate the declared contiguous source intervals. Their operations compose only where the source calls them; costs of overlapping parent/child descriptions are not added twice. Remaining effect paths retain explicit gaps.

catalog

behavior_complement

Subject: mathlib-main, source SHA-256 b350b04af0e7b74d484cab2bef3f8858eb76a9cf89fea724e18e3130028d2508; finite transition observation.

Unknown command or failed positional arity cannot invoke a module route. Malformed numeric value on selected route fails before invoking that route. A dangling valued flag returns None/default rather than a missing-value error.

Domain: stated source predicates, bounded inputs and available resources; arithmetic assumptions and external effect gaps as in the invariant. Operator is the stated relation/projection; complement is a source-derived inner exclusion, reverse retains compatible antecedents. Other views are source-derived partial constraints, not inverse laws.

Evidence: tests.md identifies executed helpers and unexecuted paths. No universal guarantee follows from the finite fixtures.

reverse_reconstruction

Subject: mathlib-main, source SHA-256 b350b04af0e7b74d484cab2bef3f8858eb76a9cf89fea724e18e3130028d2508; finite transition observation.

Given route and effective options, reconstruct all argv lists whose first flag values and positional partition select it. Unknown flags, redundant options and ignored tails can differ; defaults are indistinguishable from explicit values.

Domain: stated source predicates, bounded inputs and available resources; arithmetic assumptions and external effect gaps as in the invariant. Operator is the stated relation/projection; complement is a source-derived inner exclusion, reverse retains compatible antecedents. Other views are source-derived partial constraints, not inverse laws.

Evidence: tests.md identifies executed helpers and unexecuted paths. No universal guarantee follows from the finite fixtures.

flag_partition

Subject: mathlib-main, source SHA-256 b350b04af0e7b74d484cab2bef3f8858eb76a9cf89fea724e18e3130028d2508; finite transition observation.

Scan consumes the next token after every -- token except two boolean names, even if that token itself looks like a flag. flag independently searches the raw list; these two projections can disagree about token role.

Domain: stated source predicates, bounded inputs and available resources; arithmetic assumptions and external effect gaps as in the invariant. Operator is the stated relation/projection; complement is a source-derived inner exclusion, reverse retains compatible antecedents. Other views are source-derived partial constraints, not inverse laws.

Evidence: tests.md identifies executed helpers and unexecuted paths. No universal guarantee follows from the finite fixtures.

numeric_defaults

Subject: mathlib-main, source SHA-256 b350b04af0e7b74d484cab2bef3f8858eb76a9cf89fea724e18e3130028d2508; finite transition observation.

num deletes all underscores then parses u64, default only if flag has no next value. OAI delay clamps >=3000 ms; fetch >=1000 ms. max-pages cast and min-free GiB multiplication retain platform/arithmetic caveats.

Domain: stated source predicates, bounded inputs and available resources; arithmetic assumptions and external effect gaps as in the invariant. Operator is the stated relation/projection; complement is a source-derived inner exclusion, reverse retains compatible antecedents. Other views are source-derived partial constraints, not inverse laws.

Evidence: tests.md identifies executed helpers and unexecuted paths. No universal guarantee follows from the finite fixtures.

route_join

Subject: mathlib-main, source SHA-256 b350b04af0e7b74d484cab2bef3f8858eb76a9cf89fea724e18e3130028d2508; finite transition observation.

sql read_file -> parse key=value pairs -> duck fill -> child run; first I/O error stops later stages. parse routes raw::run; books/build includes DNS despite nominal offline command description. No live CLI routes exercised.

Domain: stated source predicates, bounded inputs and available resources; arithmetic assumptions and external effect gaps as in the invariant. Operator is the stated relation/projection; complement is a source-derived inner exclusion, reverse retains compatible antecedents. Other views are source-derived partial constraints, not inverse laws.

Evidence: tests.md identifies executed helpers and unexecuted paths. No universal guarantee follows from the finite fixtures.

arity_asymmetry

books-fetch accepts any nonempty positional list and uses only positions zero and one; parse accepts two or more and consumes all directories; fetch/books/gcs-list require exact arities. Extra positional tokens therefore have route-specific effects rather than one global rejection rule.

Subject and source identity: manifest.json. Domain: scoped forward/invariant; relation is source-derived and partial. Evidence: tests.md distinguishes actual checks from unexecuted effect paths; finite fixtures do not prove all inputs.

tests

Bounded evidence

Selected actual source checks:

These checks are file-level evidence; fragment branches not reached by these names remain source-derived.

External wave33 mathlib receipt retains native-commands.json, numeric statuses, raw debug/release logs, sorted exact outcomes, mutation logs and original/restored hashes. Seventeen named checks pass twice per profile; six production behavior mutants reject in both profiles, with restored positives. Source syntax is regenerated twice after formatting and compared byte-for-byte. Structural validation tests bindings, not Rust semantics.

No network/DNS/download, real catalog/corpus/model/teacher or database execution. Effect paths are source-derived; finite helper tests are not universal verification. No executable percentage surrogate or speed claim; future caps require metric/domain/reference and remain 1/2/5/10%.

invariant-and-cost

Invariant and cost

Invariant

No arguments yield usage without indexing panic. Only --expect-pdf and --compact-src avoid consuming following positional token. Unknown flags are not validated. Numeric overflow in min-free multiplication is outside nonoverflowing model domain.

Cost

Argument scans O(F*A) for F requested flags; positional O(A), allocations O(A). Downstream costs are tagged by selected route, not summed across commands.

Domain and gaps

No network/DNS/download, real catalog/corpus/model/teacher or database execution. Effect paths are source-derived; finite helper tests are not universal verification. No executable percentage surrogate or speed claim; future caps require metric/domain/reference and remain 1/2/5/10%.

This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/tools/mathlib/src/main.rs.groupant/