wordgraph-tamp-anchor
The groupant beside wordgraph/tamp/src/anchor.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
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 |
| Ast | partial | syntax.json |
| Composition | partial | Composition |
| Cost | partial | Cost |
| Descriptant | present | Descriptant |
| Invariant | partial | Invariant |
| Tests | executed bounded checks | 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 |
| Reverse reconstruction | reverse reconstruction | partial source derived model | Reverse reconstruction |
Model text
Descriptant
Anchor nodes: for each noun/proper-noun lemma t used by 5 papers up to 40 %, the profile Π(t) of shingles said in
T(t) by ≥ max(3, 5 %) of its papers with lift ≥ 10 over all statements; members have typicality ≥ 0.5, ≥ 3 shared
pairs and pass the order test; each statement goes to its best anchor (typicality × salience, salience from the word
graph's frequency); anchors with ≥ 3 papers stay. Per-anchor diagnostics (Diag).
Approximant
τ_t(s) = |sh(s) ∩ Π(t)| / |sh(s)|; member_t(s) ⇔ τ ≥ θ ∧ shared ≥ 3 ∧ τ − max_k τ(shuffle_k s) ≥ 0.2; assign(s) = argmax_t τ_t(s)·sal(t), ties by t; sal(t) = ln(share_corpus / share_wiki).
Invariant
A statement belongs to at most one anchor node; a member mentions its anchor; an anchor without profile has no members; all orders are sorted.
Cost
Σ_t |T(t)|·|sh| for profiles plus a binary search per shingle into the corpus frequency table; ≈ 20 s.
Composition
Called by build::cluster_with; uses norm, wordgraph::Graph.
Tests
Real controls (build::controls): foreign statements 0 / 1,348 pass; shuffled-only corpus 4 anchor nodes
(2026-11-06). No unit test of its own yet.
Behavior complement
No multiword anchors (pairs only name nodes), no word senses, does not reconsider statements whose best anchor was dropped below 3 papers.
Reverse reconstruction
anchors.json keeps every anchor's mentions, profile size, typicality quantiles, typical and order-refused counts
and its node's papers; the profile shingles are not written.
Provenance
This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/wordgraph/tamp/src/anchor.rs.groupant/