Elamur: **Mova** · [Parse](https://mova.elamur.ai/free/en/parse/) · [Research](https://md.research.elamur.ai/free/en/) · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Shryfti](https://md.shryfti.elamur.ai/free/en/)

[Mova](https://md.mova.elamur.ai/free/en/) · [this page in HTML](https://mova.elamur.ai/free/en/docs/repo-docs/logic-language/)

[Mova](https://md.mova.elamur.ai/free/en/) / [docs](https://md.mova.elamur.ai/free/en/docs/) / [repo-docs](https://md.mova.elamur.ai/free/en/docs/repo-docs/) / The Mova Logic Language

# The Mova Logic Language

The Mova Logic Language (LL) is the token interchange between Mova's layers. Mova is being rebuilt so that every layer talks to the next through LL records, both ways:

```
AST → pragmatics → LL → world → LL → pragmatics → AST
```

A layer reads LL, does its work, and writes what it knows back as LL tokens. Where a layer cannot give something back, the difference is its **residual**: the round trip through LL is the diagnostic that shows where information is lost (the same idea as [the round trip of the layers](https://md.mova.elamur.ai/free/en/docs/repo-docs/english/#the-round-trip-what-each-layer-keeps-and-loses)). The crate is [`tools/lobster`](https://md.mova.elamur.ai/free/en/docs/tools/lobster/); the Lobster 🦞 is the animal that keeps it ([animals](https://md.mova.elamur.ai/free/en/docs/repo-docs/animals/)).

## The principle: the more we know, the more tokens

Every piece of knowledge about a word **adds** tokens and never replaces any. Nothing is dropped because something else implies it: a word the world knows is longer than a word it does not. The class of a word does not replace its letters, its own token does not replace its class, and the world's tokens do not replace the parse.

## A sentence

One line is one sentence: a header, then one record per token of Mova's tree (punctuation and function words included). A stream starts with a version line, `@ll:0.6`.

```
@prag @form:decl @act:assert @indirect:0 @hedge:0 @polarity:none @voice:narrator @conf 6 4 . 9 2 …
@frame 3 @shown @frame:Fact ( ^I IS S$ @w … @role:patient … @world @do:char @C 1 … @body
RECORD RECORD …
```

**Header.** `@prag` and Mova's prag row, one token per field in its column order (`@form:`, `@act:`, `@indirect:`, `@hedge:`, `@polarity:`, `@voice:`; the confidences after `@conf`, character by character). Then the frame rows: `@frame` and the row's frame count, `@shown` and the frames' text. In frame text a frame kind is one token (`@frame:Event`, `Fact`, `Say`, `Bare`), a role before `=` is one token (`@role:patient`, `@role:of` …), other words are spelled (bigrams, `@w` after each; a case flag before: `@cap`, `@caps`, or `@mixed` with `@uK` per upper-case position); digits and signs are themselves; a space is `@sp`. When the world has read the sentence, a `@world` block lists the changes the sentence made to it (`@do:char @C 1`, `@do:event @E 7 @C 1 @O 2`, `@do:say @E 8`). `@body` closes the header.

**Record**, always in this order:

| # | tokens | present |
| --- | --- | --- |
| 1 | own token | only for a popular word of the registry |
| 2 | `<class>`, the semantic class | always |
| 3 | entity attributes: `@ent:K` `@kind:X` `@gender:G` `@animacy:A` `@number:N` `@main` | at the head of a mention of an entity (coreference) |
| 4 | world tokens: `@C 3` (the entity), `@at @L 1`, `@has @O 2`, `@kin:mother @C 1`, `@age:young`, `@story:main`; on a predicate `@E 7`, `@t 5`, `@next @E 8`, `@cause @E 3` | where the world knows them |
| 5 | `language_en` | always |
| 6 | `<upos>` | always |
| 7 | `@rel:REL` (with subtype), `@h±K` (the head as a relative offset) or `@root` | always |
| 8 | UD features, one token each, in the FEATS column's order | when the token has them |
| 9 | `@cap` / `@caps`: the case of the form | when the form is title or upper case |
| 10 | the n-grams of the lemma | always |
| 11 | `@end` | always |

```
<function> language_en <det> @rel:det @h+1 Definite=Def PronType=Art @cap ^T ^TH TH THE HE HE$ E$ @end
london <location> @ent:10 @kind:location @number:sg @L 4 language_en <propn> @rel:conj @h-2 Number=Sing @cap ^L LO ON ND DO ON ON$ N$ @end
```

- **Own token**: optional and rare, admitted with evidence per registry row: animals (a core word whose first WordNet sense is an animal, in at least 1,000 articles, with a lemma in two languages of the English–French concept inventory, **and whose animal sense dominates its linked uses in context**, measured by `lobster animal-context`), given names, surnames and places (by their counts in person-article titles and place articles).
- **Semantic class**: for a name, the entity type of its article (the head of its short description); for a noun, the head table then the WordNet lexicographer file (`<animal>`, `<artifact>`, `<person>` …); verbs `<v.motion>` and the other verb files; adjectives `<a.all>`, `<a.pert>`, `<a.ppl>`; adverbs `<r.all>`; closed classes `<function>`; `<number>`, `<punctuation>`, `<symbol>`; anything else `<unknown>`.
- **Entity attributes** come from Mova's coreference (`coref`): the entity's number in the document, the class of its first non-pronoun mention, gender, animacy, number, and `@main` for the entity with the most mentions. Accumulating by default (what is known up to that mention), the whole text's knowledge as an option.
- **Head** as a relative offset: an inserted word elsewhere in the sentence changes no offset.
- **N-grams** usually spell the lemma with every bigram of `^lemma$` and the admitted 3- and 4-grams. Lemmas containing CJK or characters and separators that the bigrams cannot recover use one token per Unicode scalar. Admitted CJK characters and underscores are literal. Other scalars use `U+XXXX` escapes.
- **World tokens** are numbers written digit by digit after a registry letter (`@E 1 2` is event E12), so the vocabulary does not grow with the size of a document.

## The vocabulary

The registry (`registry.tsv`: `id range kind token evidence date`) holds every token with the evidence that admitted it. Its first row is the version (`@ll:0.6`).

| range | what |
| --- | --- |
| 0–30k | markers: UPOS, semantic classes, entity attributes, header markers (prag fields, frame kinds, roles, case), the tree (`@rel:*`, `@root`, `@h-200`…`@h+200`), UD features, the world writer's markers |
| 30k–330k | n-grams: all bigrams of the Latin, IPA, Greek, Cyrillic, Arabic and Hebrew alphabets with the digits and `' - .`, admitted 3- and 4-grams, admitted CJK characters |
| 330k–512k | the popular own tokens |

## Versions and compatibility

The language has no numbering of its own: its version is the Mova release it ships with. The current one is **Mova Logic 0.6**, for Mova 0.6.

- **Before Mova 0.6 ships**, the language is rebuilt from zero as often as needed, with no compatibility: the registry, the ids and the record shape may all change.
- **From 0.6 on**, every later 0.x release keeps it compatible: the registry is append-only (no renumbering, no reuse; a row may only be retired or re-admitted) and the record shape changes only by additions old readers can skip.
- **At Mova 1.x**, compatibility may break once more.

`lobster registry-check OLD NEW` enforces this: against an earlier 0.x registry from 0.6 on it requires append-only; a new major version passes with the break declared; a rebuild of the same version needs `--rebuild`. A reader refuses a stream of another major version, a stream newer than itself, and an unversioned stream. The earlier experimental versions (v1–v4, from an earlier tokenizer project) are prehistory: Mova Logic does not continue their numbering.

## The world reader and writer

**LL → world** (`lobster::world4`). A document's LL lines are read into a reading (tokens, entity marks, frames with their filler words, the prag row) and a builder turns it into Mova's change language (`world::lang`) through `World::apply` and its gates:

- an entity is a coreference entity (`@ent:K`) or, for a frame filler without a mark, its lemma; by its kind it is a character (person, animal; organisations and groups as personified characters), a place (location) or an object; an entity of no known kind that the document's pronouns call animate (and never inanimate), or a proper name of no known kind that is the agent of a frame, is a person («Alice … she», «Alice gave …»);
- a frame is an event (or an utterance for `Say`), its roles as the world allows them (an agent is a character, a place a location); negation, cause, tense (`when=`) and `attrs=when:X` (story time) go with it;
- every sentence is an utterance with its act, its indirectness and its speaker;
- age words set an age group, kin nouns with a possessor set `mother=`/`father=` or a relation.

The same builder reads Mova's own products in memory (frames with their exact token anchors and tense, coreference marks): that world is the reference, and the LL world is compared with it.

**World → LL** (`lobster::worldtok`). The writer adds the world tokens of the record table and the header's `@world` block. Stripping them gives the LL line back exactly; that is a gate, with a negative control.

## One document in memory: `lobster::record` and the parse service

`lobster::record::document` turns one parsed document (tree rows, the prag row; frame rows re-read by Mova from the tree when none are given) into its records with the world's tokens: `v4::doc_lines` (what `write4` writes) and `worldtok::with_world` (`read_ll` → `build` → `write_line`, what `world4` writes as `plus.ll`). It also lays each record out as a view: the events (each frame with its kind, verb, tense, negation, role fillers and their world ids, cause and next event), the entities of the sentence (world id and type, attributes, world facts, mentions) and the words. `lobster logic` runs it over a slice; the parse service ([mova-serve](https://md.mova.elamur.ai/free/en/docs/tools/mova-serve/)) runs it per discourse unit and shows the view and the record beside the tree and the pragmatics, in every format. Measured on the first chapter of *Alice's Adventures in Wonderland* (26 paragraphs, 2026-11-17): `lobster logic` gives exactly `world4`'s `plus.ll`, and the short-description index (`lobster desc-index`, read from disk by binary search) gives exactly the whole table's records.

## The chain and its residual

`lobster world4` runs the chain AST → LL → world → LL → AST on a slice and reports, per step, what survives: tokens and sentences of the tree through LL; entity marks registered, frames turned into events, roles filled and utterances; what the world alone gives back per record field (class, entity attributes, POS, lemma, case; the tree and the features are never in the world), per prag field and per frame field; and the residual by pattern with examples. Negative controls: a corrupted record must change the world, a dropped world-carried token must show up as residual, and a token dropped from a written line must turn the strip gate red.

The residual is where the debuggers look first: what the world does not hold is either outside its job (the tree, features, punctuation) or a gap of the world layer (number, neuter gender, frame kinds, obliques, links).

## How to run

```
cd tools/lobster && cargo build --release --offline
L=$CARGO_TARGET_DIR/release/lobster
$L slice $STORE $DEV_TSV dev-store.tok && $L reframe dev-store.tok dev.tok
$L write4 registry.tsv $MOVA_DATA/raw/en-oewn/json shortdesc.tsv dev.tok dev.ll
$L check4 dev.tok dev.ll
$L world4 registry.tsv $MOVA_DATA/raw/en-oewn/json shortdesc.tsv dev.tok dev.ll chain/
$L desc-index shortdesc.tsv shortdesc-index.tsv          # the index the parse service reads
$L logic registry.tsv $MOVA_DATA/raw/en-oewn/json shortdesc-index.tsv dev.tok dev-world.ll dev-view.txt
```

Releases live outside the repository in <Mova release>.

## Limits

- One sense per word (the first WordNet sense); no word-sense disambiguation.
- Entity numbers wrap at 512 per document (`@ent:K`).
- The world is Mova's tale world: its closed sets (character, place and object types, male/female) do not hold everything the records say; the rest is residual.
- The LL reader finds a filler's token by its lemma near the predicate; Mova's own reader knows the exact token.
- Only the world layer reads and writes LL so far (the parse service shows the records); the other layers still talk through their own structures.
- [← previous Worlds and knowledge](https://md.mova.elamur.ai/free/en/docs/repo-docs/knowledge/)
- [next → Mathematical modeling of code](https://md.mova.elamur.ai/free/en/docs/repo-docs/mathematical-modeling/)
- [↑ back to Documentation](https://md.mova.elamur.ai/free/en/docs/repo-docs/)

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://mova.elamur.ai/sitemap.xml) · [llms.txt](https://mova.elamur.ai/llms.txt)
