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

# wordgraph-rel

The groupant beside wordgraph/src/rel.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:** [`wordgraph/src/rel.rs`](https://github.com/ElamurAI/mova-free/blob/main/wordgraph/src/rel.rs)
- **repository folder:** [`wordgraph/src/rel.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/wordgraph/src/rel.rs.groupant)

> **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) |
| **Cost** | partial | [Cost](#cost) |
| **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.

| relation | 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) |

## Model text


### Descriptant

Relation codes of the word graph: an 8-bit base relation (15 kinds) and a 24-bit preposition slot holding the `en`
lemma number of an `obl`/`nmod` case word (0 = none, `0xFFFFFF` = outside the dictionary). Names print as `obl:in`.
Epoch 2026-11-06: first version; the dictionary has about 110 k lemmas, well under 2^24.

### Approximant

`code(b, p) = b << 24 | (p & 0xFFFFFF)`; `base_of(c) = Base::from_u8(c >> 24)`; `prep_of(c) = c & 0xFFFFFF`.
`parse` accepts a bare base name (prep 0), or `obl|nmod:<word>` with the word looked up in `en::dict`, or `:?`.
`name(code(b, p))` prints `b`, `b:?` or `b:<lemma text>`.

### Invariant

Codes sort by base first, so all codes of one base are contiguous. `parse(name(c)) = c` for every code whose
preposition is 0, `PREP_OTHER` or a dictionary lemma whose text is unique. `base_of(code(b, p)) = b` for all b, p.

### Cost

O(1) per code operation; `parse`/`name` do one dictionary hash probe and one allocation.

### Composition

Used by `extract` (to emit codes), `compile` (bounds by base), `graph` (relation table, `edges_base`), `eval` and the
CLI. No state.

### Tests

`rel::tests::names_round_trip`: every base round-trips; `obl:in` parses and prints; `obj:in` and unknown names are
refused (negative cases).

### Behavior complement

Does not represent multiword prepositions («because of»: only the first case word), subtypes other than `pass`,
`agent`, `poss`, or prepositions on relations other than `obl`/`nmod`. Never panics; unknown bytes print `rel#hex`.

### Reverse reconstruction

`code` is injective on (base, prep mod 2^24). From a code, base and preposition number are recovered exactly; the
preposition's surface form, case and any second case word are not. `PREP_OTHER` admits every out-of-dictionary word.

## Provenance

- **source SHA-256:** `5fbd25381c907e97…`
- **repository commit:** `c24d02b4c83b`
