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

# mlab-parser-expression-precedence

The groupant beside mlab/src/parser.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:** [`mlab/src/parser.rs`](https://github.com/ElamurAI/mova-free/blob/main/mlab/src/parser.rs)
- **source SHA-256:** `264bd8e53dd79007…`
- **covers:** oror→andand→or→and→cmp→range→additive→mult→unary→power establishes binding. power repeatedly folds left over power_operand; unary recursively prefixes before power. range accepts one or two colons. (bytes 18030–22899)
- **part of:** [mlab-parser](https://md.groupants.elamur.ai/free/en/mova/mlab/src/parser.rs.groupant/)
- **repository folder:** [`mlab/src/parser.rs.groupant/expression-precedence.groupant`](https://github.com/ElamurAI/mova-free/tree/main/mlab/src/parser.rs.groupant/expression-precedence.groupant)
- **repository commit:** `855da7bd4a7b`

> **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` |
| **cost** | symbolic source derived | [invariant](#invariant) |
| **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) |
| `representation_transport` | representation_transport | partial source derived model | [representation_transport](#representation-transport) |
| `failure_precedence` | failure_precedence | partial source derived model | [failure_precedence](#failure-precedence) |
| `resource_domain` | resource_domain | partial source derived model | [resource_domain](#resource-domain) |
| `interaction_relation` | interaction_relation | partial source derived model | [interaction_relation](#interaction-relation) |

## Model text


### descriptant

#### Expression precedence ladder

oror→andand→or→and→cmp→range→additive→mult→unary→power establishes binding. power repeatedly folds left over power_operand; unary recursively prefixes before power. range accepts one or two colons.

##### Modeling epoch 2026-10-31

Prospective source reading precedes test additions. Retained observations: Whitespace flag from lexer determines matrix boundary; returned BinOp tags drive ops or interpreter short circuit.

This is partial source-derived modeling, not proof, full semantic coverage, or a performance result. Public malformed representations, unbounded allocations and exhaustive numerical edge cases remain outside the checked fixtures.

### approximant

#### Expression precedence ladder forward relation

oror→andand→or→and→cmp→range→additive→mult→unary→power establishes binding. power repeatedly folds left over power_operand; unary recursively prefixes before power. range accepts one or two colons.

Domain: Token stream with EOF sentinel, bounded recursive depth. Lex errors already resolved.

No executable Rust surrogate is supplied: categorical decisions require exact observations; numerical kernels have no measured approximation metric here. Future supported caps are 1%, 2%, 5%, 10% only.

### invariant

#### Invariant and cost

Operator sequence and precedence retained; comparison chains are left-folded rather than conjunctions. No evaluation or shape checking occurs.

Cost: O(consumed tokens) for ladder itself; recursion follows unary depth.

Failure ordering: Lower-precedence layers request tighter operands before folding; power_operand handles unary prefixes but calls postfix rather than power.

### models

### behavior_complement

2^3^2 cannot become Pow(2,Pow(3,2)); -2^2 cannot become Pow(Neg(2),2). In matrix context a sign with space before and no space after cannot be consumed as additive binary op.

### reverse_reconstruction

A left-fold power tree admits unparenthesized chain; inserted Paren nodes create distinct ASTs. Range without step admits a:b; explicit 1 produces Some(1), not identical AST.

### representation_transport

Operator sequence and precedence retained; comparison chains are left-folded rather than conjunctions. No evaluation or shape checking occurs.

### failure_precedence

Lower-precedence layers request tighter operands before folding; power_operand handles unary prefixes but calls postfix rather than power.

### resource_domain

Token stream with EOF sentinel, bounded recursive depth. Lex errors already resolved.

### interaction_relation

Whitespace flag from lexer determines matrix boundary; returned BinOp tags drive ops or interpreter short circuit.


### tests

#### Bounded evidence

Selected actual-code Rust test: `parser::wave30::precedence` with `cargo test --offline --locked -p mlab --lib`. CPU synthetic fixtures only. Two debug and two release runs, sorted named outcomes, numeric statuses, compiled assertion controls and exact source restoration are retained externally under the wave30 expressions receipt directory. The source-to-test map distinguishes runtime semantics from AST representation checks. This fragment shares the parent test: only the exercised branches are observed; its whole prose is not runtime coverage. No corpus, GPU, live filesystem inspection, callbacks, RNG shuffle or wall-clock execution.

Syntax is generated twice from exact source and compared. Lexical projection has no expansion/type/name resolution. No strict Clippy claim; existing dependency/style findings are not re-run merely for repetition.
