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

# learning-memo-execution-ordered-visits

The groupant beside world/src/knowledge/learning.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 derived
- **source:** [`world/src/knowledge/learning.rs`](https://github.com/ElamurAI/mova-free/blob/main/world/src/knowledge/learning.rs)
- **source SHA-256:** `27a2ad1ec4a2548c…`
- **covers:** learn_lesson_with function, excluding the surrounding impl closing brace. (bytes 2247–4321)
- **part of:** [learning-memo-execution](https://md.groupants.elamur.ai/free/en/mova/world/src/knowledge/learning.rs.groupant/execution.groupant/)
- **repository folder:** [`world/src/knowledge/learning.rs.groupant/execution.groupant/ordered-visits.groupant`](https://github.com/ElamurAI/mova-free/tree/main/world/src/knowledge/learning.rs.groupant/execution.groupant/ordered-visits.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 | `model.md` |
| **ast** | partial | `../../syntax.json` |
| **descriptant** | present | `model.md` |
| **invariant** | partial | `model.md` |
| **tests** | references only | [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 |
|---|---|---|---|
| `excluded-traces` | behavior_complement | partial source derived | [Behavior complement](#behavior-complement) |
| `compatible-antecedents` | reverse_reconstruction | partial source derived | [Reverse reconstruction](#reverse-reconstruction) |
| `trace-correspondence` | trace_correspondence | partial source derived | [Specialized relation](#specialized-relation) |

## Model text


### model

## execution/ordered-visits fragment

Source coverage: UTF-8 bytes [2236, 4310) in learning.rs at the manifest digest. learn_lesson_with function, excluding the surrounding impl closing brace. This is a source-derived partial model, not a new runtime unit.

### Forward approximant

Return default work for P=0. Otherwise shuffle options once, allocate Empty memos, and traverse P passes in exercise order. A valid Inert increments inert only; valid Scored increments reused then learns; a miss evaluates, increments evaluated, snapshots before learning when reuse is enabled. Observe after every visit.

### Invariant

Under normal return and nonoverflowing counts, evaluated+reused+inert=P*E. Each call begins with Empty slots; its nonempty first pass evaluates every exercise. Reusing an Answer never bypasses the scored learning update.

### Cost approximation

O(E) preparation plus P*E validity/dispatch work and reached evaluator/learner costs; timing appends at most P values. E=0 still permits P timing samples.

### Behavior complement

Let U be finite helper traces with fixed inputs, valid indices, normal completion and nonoverflowing counters, and R the actual relation restricted to U. The candidate inner approximant C_hat to U \ R contains traces whose work counters do not sum to P*E, whose observer count differs from P*E, or whose scored snapshot occurs after its associated learning update. This is an explicit excluded relation, not merely a list of negative tests; it does not enumerate the entire complement or prove completeness.

### Reverse reconstruction

B(work,observed weights) contains all ordered visit branch sequences and input states compatible with those counts and vectors. Totals lose exercise attribution; P=0 and E=0 can both yield zero counters. Observations do not uniquely recover answers or lesson seeds.

### Specialized relation

The target relation equates every ordered weight vector to reuse=false recomputation for the same exercise order. It requires fixed evaluator dependencies and that Inert answers cannot update reference state; equal final scores alone are weaker.

### Epoch memory and limits

2026-10-29: decomposed existing source without moving code. Existing root observations and all twenty root obernants remain authoritative. Child anchors select source-bound partial syntax nodes; name resolution and macro expansion remain absent. No new runtime test or measured performance gain is claimed.

### tests

#### Existing bounded oracles

Existing every_ordered_update_matches_recomputation_over_multiple_passes checks a nontrivial 30-visit trace. Existing bounded_cache_reference_traces_cover_weights_orders_seeds_and_passes compares ordered and final vectors over 270 cases, exercising pass counts, seeds, orders and initial weights.

Run the existing suite from the repository root:

`cargo test -p world knowledge::learning::tests --lib --locked`

Test definitions are in ../../../learning.rs. These are references to existing oracles; this fragment adds no executable test. Historical execution evidence is retained in ../../tests.md. The fixture's simplified evaluator does not establish full parser/inference correspondence.
