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

# math-understand-pratt

The groupant beside math/src/understand.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/understand.rs`](https://github.com/ElamurAI/mova-free/blob/main/math/src/understand.rs)
- **source SHA-256:** `5b3ac990c5e46e75…`
- **covers:** expr(min) parses unary first; +,- have precedence1, *,/2, power3 right-associative, square/cube4 postfix. For a nonpercent lhs and percent rhs under +/-, construct lhs*(1 +/- rhs). (bytes 41081–44996)
- **part of:** [math-understand](https://md.groupants.elamur.ai/free/en/mova/math/src/understand.rs.groupant/)
- **repository folder:** [`math/src/understand.rs.groupant/pratt.groupant`](https://github.com/ElamurAI/mova-free/tree/main/math/src/understand.rs.groupant/pratt.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** | 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) |
| `unary_power_order` | unary_power_order | partial source derived model | [unary_power_order](#unary-power-order) |
| `of_dispatch` | of_dispatch | partial source derived model | [of_dispatch](#of-dispatch) |

## Model text


### descriptant

#### math-understand-pratt

expr(min) parses unary first; +,- have precedence1, *,/2, power3 right-associative, square/cube4 postfix. For a nonpercent lhs and percent rhs under +/-, construct lhs*(1 +/- rhs).

Epoch 2026-10-31: replaced duplicate catalog sentences with concrete exclusions, compatible-antecedent examples and two distinct scoped behavioral views. Source and prior execution evidence are unchanged; this revision ran no tests.

### approximant

#### Scoped forward relation

expr(min) parses unary first; +,- have precedence1, *,/2, power3 right-associative, square/cube4 postfix. For a nonpercent lhs and percent rhs under +/-, construct lhs*(1 +/- rhs).

This source-derived relation is partial; no executable percentage surrogate or replacement is supplied.

### invariant

#### Scoped domain and invariants

Successful consumption advances cursor; parenthesized parsing consumes the matching RParen. Complete-stream checking belongs to chain, not expr alone.

##### Cost

Token traversal is linear for the grammar, with recursion proportional to nesting/operator association. Expr allocation and downstream exact evaluation are separate costs.

### models

### behavior_complement

A missing operand, unmatched closing/opening parenthesis, or fraction word without of cannot yield successful parse on that path. Unary-first parsing excludes treating -2^2 as -(2^2) in this grammar.

### reverse_reconstruction

Extra parentheses around a value can yield the same Expr. Both percent tokens and equivalent explicit multiplication can evaluate alike while producing different trees; value equality does not recover token form or the rewrite path.

### unary_power_order

expr calls unary before its operator loop, so unary minus becomes part of the power base. Power RHS uses min=3, while left-associative operators recurse at prec+1.

### of_dispatch

Frac requires Of; a slash-form nonpercent Val followed by Of builds multiplication; a percent Val followed by Of builds PctOf; ordinary nonpercent Val followed by Of errors.

### tests

#### Scoped evidence

Precedence, right-associative power, percentages, slash-fraction multiplication and malformed parentheses/fraction.

Named actual source fixtures: understand::wave28::{pratt_precedence_and_percent_rewrite}.

Parent tests.md records commands and paired profiles. No additional coverage inferred from parent fixtures outside this byte range; source-scoped numeric/parse properties remain partial.
