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

# math-eval-gate

The groupant beside math/src/eval.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_fragment
- **status:** partial source bound model
- **source:** [`math/src/eval.rs`](https://github.com/ElamurAI/mova-free/blob/main/math/src/eval.rs)
- **source SHA-256:** `8b593135200d357a…`
- **covers:** Expr -> eval using Rat/units -> Q plus Ctx -> gate using fcheck. Raw eval success is insufficient: existing checks or SI mismatch can reject. Context mutations survive raw errors; answer owns fresh context. No global relative-error budget follows. (bytes 34232–35748)
- **part of:** [math-eval](https://md.groupants.elamur.ai/free/en/mova/math/src/eval.rs.groupant/)
- **repository folder:** [`math/src/eval.rs.groupant/gate.groupant`](https://github.com/ElamurAI/mova-free/tree/main/math/src/eval.rs.groupant/gate.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` |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant](#invariant) |
| **tests** | 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) |
| `temperature_kind` | temperature_kind | partial source derived model | [temperature_kind](#temperature-kind) |
| `failure_precedence` | failure_precedence | partial source derived model | [failure_precedence](#failure-precedence) |
| `gate_boundary` | gate_boundary | partial source derived model | [gate_boundary](#gate-boundary) |
| `empty_nonfinite` | empty_nonfinite | partial source derived model | [empty_nonfinite](#empty-nonfinite) |

## Model text


### descriptant

Scoped gate fragment, source bytes [34232,35748).

Expr -> eval using Rat/units -> Q plus Ctx -> gate using fcheck. Raw eval success is insufficient: existing checks or SI mismatch can reject. Context mutations survive raw errors; answer owns fresh context. No global relative-error budget follows.

Inherited family observations are parent context; only the explicit byte range belongs to this fragment.

### approximant

eval recursively produces Q and appends Ctx evidence. Exact pairs use Rat; mixed approximate pairs use f64. Aggregates convert to first operand units. answer uses fresh context then gate checks independent fcheck SI value and recorded booleans.

O(N) traversal plus numeric costs; aggregate O(k log k); exact probability enumeration O(T*2^T) for T<=16. Trace size includes formatted intermediates; stack/allocation unbounded. Gate tolerance is policy, not universal numerical assurance.

Executable approximant gap: no useful percentage surrogate for exact arithmetic and categorical branch contracts. Existing float pruning/tolerances do not establish an approximation guarantee.

### invariant

Point+point and point scaling are excluded, dimension mismatch excludes conversion. Gate rejects any false check or SI disagreement; raw eval does not enforce gate. Empty Add/Mul indexing, nonfinite handling, unchecked count sum and exponent narrowing remain gaps.

Output Q admits many Expr/environment/trace antecedents and equivalent units. Fixed-scale exact conversion has unique inverse only when all arithmetic succeeds. Gate accepts SI-equivalent representations, not a unique syntax or provenance.

Cost: O(N) traversal plus numeric costs; aggregate O(k log k); exact probability enumeration O(T*2^T) for T<=16. Trace size includes formatted intermediates; stack/allocation unbounded. Gate tolerance is policy, not universal numerical assurance.

Finite fixtures do not prove all-domain correctness or resource behavior.

### models

### behavior_complement

Answer is excluded by any false Ctx check, fcheck None, or false SI agreement. Raw eval success is insufficient. Equivalent display units are permitted; upstream structural validity is assumed.

### reverse_reconstruction

Accepted Answer has a set of expression/value/context antecedents producing its retained Q/steps/notes and checks augmented with independent comparison. Numeric SI agreement cannot identify original syntax or provenance uniquely.

### temperature_kind

Q.base transports affine points to Kelvin and multiplicative units by scale. Gate compares transported numbers and does not independently validate point/delta structural legality in publicly constructed Q.

### failure_precedence

answer evaluates before gate. Gate calls fcheck before Q.base; base error propagates before failed-check aggregation. fcheck None appends failure without evaluating base. Previous checks are inspected after independent processing.

### gate_boundary

Tolerance is1e-9*(1+max(abs(b),abs(fv))). Checks append, preserving previous false values. The compiled control bypasses failed-list rejection and must fail the wrong-answer test. This is a gate policy, not a universal approximation guarantee.

### empty_nonfinite

An empty prior check list still receives the independent check. NaN comparisons fail ordinarily; infinities require separate analysis, so no finite-answer guarantee is claimed. Ctx variable bindings are not passed through this interface to fcheck.

### tests

Actual source module filter: eval::. Inspected synthetic module tests only, selected independently; numeric run statuses, sorted named outcomes and compiled controls retained in wave27-math external receipts. No full crate suite, corpus, teacher, GPU or training. See source-test-map.json for exact evidence and limitations.
