mova-serve-svg
The groupant beside tools/mova-serve/src/svg.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 |
| Cost | symbolic source derived | 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 presence | model presence | partial source derived model | Model presence |
Model text
Descriptant
A dependency tree as an inline SVG: words in a row with their UPOS, labelled arcs above stacked by span, the root dashed; the hub's tree classes.
Approximant
level(a) = 1 + max(level(b) | b inside or crossing a), shortest first; draw = check ∘ layout.
Invariant
Only a well-formed tree is drawn (heads in range, a root, no cycle); the picture is a function of the tokens.
Cost
O(arcs²) for the levels; the trees are sentence-sized.
Behavior complement
No right-to-left layout, no glosses, no non-projective arc rerouting beyond stacking.
Reverse reconstruction
Each arc's label and ends recover (dependent, head, relation).
Model presence
A tree with a token without a head is refused with the reason.
Tests
svg::tests: nested levels, a cycle, no root and a missing head refused (negative controls), escaping, two identical
drawings.
Provenance
This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/tools/mova-serve/src/svg.rs.groupant/