---
title: "latex-tomath — Mova code model"
description: "Mova code model of latex/src/tomath.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/latex/src/tomath.rs.groupant/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · **Groupants**

This page as HTML: <https://groupants.elamur.ai/free/en/mova/latex/src/tomath.rs.groupant/>

# latex-tomath

The groupant beside latex/src/tomath.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

- **kind:** groupant
- **status:** partial source bound model
- **source:** [`latex/src/tomath.rs`](https://github.com/ElamurAI/mova-free/blob/main/latex/src/tomath.rs)
- **source SHA-256:** `794488f6ec9ddcdf…`
- **repository folder:** [`latex/src/tomath.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/latex/src/tomath.rs.groupant)
- **repository commit:** `48f2e6f74146`

> **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](#approximant) |
| **ast** | partial | `syntax.json` |
| **composition** | partial | [composition](#composition) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant](#invariant) |
| **tests** | executed bounded checks | [tests](#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](#behavior-complement) |
| `reverse_reconstruction` | reverse_reconstruction | partial source derived model | [reverse_reconstruction](#reverse-reconstruction) |
| `failure_order` | failure_order | partial source derived model | [failure_order](#failure-order) |
| `literal_policy` | literal_policy | partial source derived model | [literal_policy](#literal-policy) |
| `precedence` | precedence | partial source derived model | [precedence](#precedence) |
| `inverse_domain` | inverse_domain | partial source derived model | [inverse_domain](#inverse-domain) |

## Parts

- [latex-tomath-precedence](https://md.groupants.elamur.ai/free/en/mova/latex/src/tomath.rs.groupant/precedence.groupant/)
- [latex-tomath-emission](https://md.groupants.elamur.ai/free/en/mova/latex/src/tomath.rs.groupant/emission.groupant/)

## Model text


### descriptant

#### latex-tomath

to_expr rejects top-level relations before sequence; P applies additive/multiplicative/unary/script precedence and function juxtaposition. to_relation validates/splits supported relation symbols before operands. Irreducible integer fractions become Rat, reducible remain Div. from_expr emits wrapping; roundtrip compares fold_literals after emit/print/parse/convert.

Epoch 2026-10-31: complete sources read before tests/model edits. Partial source-bound modeling; no production optimization or speed claim. Nested fragments share the parent lexical syntax. Caller/callee contracts outside owned files remain delegated.

### approximant

#### Forward relation

to_expr rejects top-level relations before sequence; P applies additive/multiplicative/unary/script precedence and function juxtaposition. to_relation validates/splits supported relation symbols before operands. Irreducible integer fractions become Rat, reducible remain Div. from_expr emits wrapping; roundtrip compares fold_literals after emit/print/parse/convert.

#### Domain and executable surrogate gap

Bounded UTF-8 inputs and synthetic local files; supported parser-produced trees and representable arithmetic. Arbitrary public constructors are not certified total. Exact categorical semantics lack a useful percentage surrogate; no executable approximant attachment. Future numerical profiles require an explicit metric, zero case, source/evidence binding and supported 1/2/5/10% cap. Failure/effect differences cannot count as numerical error.

### invariant

#### Invariant

Supported tested trees preserve ordered arithmetic modulo fold; sub/div left associative, unparenthesized function stops at next function. Rat explicit parse/neg overflow errors delegated; abs extreme and arbitrary constructors unproved.

#### Cost

Ordinary rows linear plus recursive conversion, nested group scans potentially quadratic. Output/error rendering allocates; O(depth) stack; Rat cost delegated.

Allocation failure, stack exhaustion and unchecked counter overflow have no additional certificate. No timing claim or global error bound.

### composition

#### Composition

to_expr rejects top-level relations before sequence; P applies additive/multiplicative/unary/script precedence and function juxtaposition. to_relation validates/splits supported relation symbols before operands. Irreducible integer fractions become Rat, reducible remain Div. from_expr emits wrapping; roundtrip compares fold_literals after emit/print/parse/convert.

Supported tested trees preserve ordered arithmetic modulo fold; sub/div left associative, unparenthesized function stops at next function. Rat explicit parse/neg overflow errors delegated; abs extreme and arbitrary constructors unproved.

Parser, printer, AST equality, Macros, Rat and evaluator dependencies retain their own contracts. Structural roundtrip is not arithmetic definedness or numeric truth. Exact lexical binding does not prove caller/callee semantics.

### models

### behavior_complement

Unsupported variables/functions/scripts/constructs categorized, relation precheck preempts malformed operand. No solving/evaluation/definedness guarantee: 1/0 can structurally roundtrip while numeric evaluator rejects. Scripts missing sup can panic via unwrap for manual AST.

### reverse_reconstruction

Expr preimage includes alternative grouping, decimal/fraction forms, fonted Euler e. from_expr chosen presentation, not total inverse. fold_literals maps integer Div(p,q) with p>=0 and q>1 to Rat when Rat construction succeeds and its normalized numerator still equals p; this includes Div(0,2) mapping to zero despite reducibility. Nested operation shape otherwise remains.

### failure_order

Top-level relation before seq; unsupported relation before operands; function arity before emission support.

### literal_policy

Frac/DFrac/TFrac irreducible integers denom>1 become Rat; CFrac stays Div.

### precedence

sin 2x=sin(2*x); sin x cos x product; closing script powers group.

### inverse_domain

Empty Add/Mul emits empty tree rejected by inverse/roundtrip; arbitrary public constructors not guaranteed.


### tests

#### Selected evidence

cargo test -p latex --features math --test bridge

Two debug/two release executions retained matching sorted named outcomes. External wave28 latexbridge receipts retain numeric exits, compiled assertion controls, restoration, feature checks and source-test map. This scope is not exhaustive branch coverage; parent tests may only exercise some child transitions. Frozen VMM DATA/classification/hash subprocess, live corpus, teacher/API, training/GPU excluded. Reexport/feature compilation is separate from runtime semantics.

#### Recorded outcome, 2026-10-31

Selected source tests: 6. See evidence.json for exact names, source/log hashes and paired debug/release receipts. Control prefix: control-bridge; when present compile=0, assertion-failure=101, restored-positive=0. Seven distinct controls total across this subsystem; bridge implementation shares its integration-test control. No independent runtime control for reexports. Strict Clippy returned 101 on 14 pre-existing library lints in unchanged code.
