---
title: "latex-extract — Mova code model"
description: "Mova code model of latex/src/extract.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/latex/src/extract.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/extract.rs.groupant/>

# latex-extract

The groupant beside latex/src/extract.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/extract.rs`](https://github.com/ElamurAI/mova-free/blob/main/latex/src/extract.rs)
- **source SHA-256:** `b717bad28ee0917e…`
- **repository folder:** [`latex/src/extract.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/latex/src/extract.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) |
| `coordinates` | coordinates | partial source derived model | [coordinates](#coordinates) |
| `display` | display | partial source derived model | [display](#display) |
| `recovery` | recovery | partial source derived model | [recovery](#recovery) |
| `environment` | environment | partial source derived model | [environment](#environment) |

## Parts

- [latex-extract-dollars](https://md.groupants.elamur.ai/free/en/mova/latex/src/extract.rs.groupant/dollars.groupant/)
- [latex-extract-environment](https://md.groupants.elamur.ai/free/en/mova/latex/src/extract.rs.groupant/environment.groupant/)

## Model text


### descriptant

#### latex-extract

Byte scanner returns borrowed formula bodies in order plus unterminated opener records. Skips comments/escapes/closed verbatim. Dollar closers skip comments and escapes, inline also tracks signed depth and paragraph boundary. Bracket/environment closers are first literal match. Unmatched openers recover by advancing past opening syntax.

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

Byte scanner returns borrowed formula bodies in order plus unterminated opener records. Skips comments/escapes/closed verbatim. Dollar closers skip comments and escapes, inline also tracks signed depth and paragraph boundary. Bracket/environment closers are first literal match. Unmatched openers recover by advancing past opening syntax.

#### 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

tex[f.start..f.start+f.body.len()]==f.body; offsets are UTF-8 bytes, body starts for Formula but opener for bad. Returned bodies ordered; empty input empty vectors.

#### Cost

Ordinary closed scanning O(B); repeated missing closer searches O(B²). Returned metadata O(F+U), bodies borrowed. i32 depth unchecked overflow on unbounded input.

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

### composition

#### Composition

Byte scanner returns borrowed formula bodies in order plus unterminated opener records. Skips comments/escapes/closed verbatim. Dollar closers skip comments and escapes, inline also tracks signed depth and paragraph boundary. Bracket/environment closers are first literal match. Unmatched openers recover by advancing past opening syntax.

tex[f.start..f.start+f.body.len()]==f.body; offsets are UTF-8 bytes, body starts for Formula but opener for bad. Returned bodies ordered; empty input empty vectors.

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

Escaped dollar cannot open; positive brace depth excludes inline close; blank lines stop inline search. Bracket/environment matching is not nested TeX parsing. Unclosed verbatim may resume internal scanning.

### reverse_reconstruction

Compatible documents contain arbitrary ignored text constrained by byte offsets and scanner state. Delimiter metadata constrains spellings but cannot recover prose, comments or preambles. Empty result admits empty/prose/comment-only input.

### coordinates

Starts after delimiters/consumed environment argument, byte not char.

### display

Dollar/Paren/math env false; DoubleDollar/Bracket/other math env true.

### recovery

Unterminated opener does not forbid later valid formula.

### environment

Listed names only; alignat/IEEEeqnarray first braced argument skipped nonrecursively.


### tests

#### Selected evidence

cargo test -p latex --features math --lib extract::tests

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: 2. See evidence.json for exact names, source/log hashes and paired debug/release receipts. Control prefix: control-extract; 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.
