Elamur Groupants⌕
☰

kg-textgen

The groupant beside kg/src/textgen.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

componentlabelwhere
approximantpartialapproximant
astpartialsyntax.json
compositionpartialcomposition
costpartialcost
descriptantpresentdescriptant
invariantpartialinvariant
testsexecuted bounded checkstests

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.

idtypelabelwhere
behavior_complementbehavior_complementpartial source derived modelbehavior_complement
reverse_reconstructionreverse_reconstructionpartial source derived modelreverse_reconstruction
variant_lexicographicvariant_lexicographicpartial source derived modelvariant_lexicographic
dp_tiesdp_tiespartial source derived modeldp_ties
chunk_depthchunk_depthpartial source derived modelchunk_depth
surface_projectionsurface_projectionpartial source derived modelsurface_projection

Parts

Model text

descriptant

kg-textgen

Morphological realization, recursive attribute chunks and subset-DP ordering of Fact heads.

Modeling epoch — 2026-10-31

Source read before tests and models; retained prospective notes accompany the parent. Current evidence uses bounded invented inputs only. This is partial modeling, not proof or corpus accuracy.

approximant

Forward relation

Observe explicit nonmodifier heads sorted by(word,class), accumulate transition/from counts. generate rejects0/>12 heads; form chooses lexicographic conditional/global counts with dictionary-first ties, restricts post-prep third-person pronouns to available н forms. Build chunks, maximize smoothed start/transitions/end log score, insert nominal dash, uppercase first char, end ! for imperative else period. For head classes c_i: D[{i},i]=logp(<s>,c_i); D[S∪{j},j]=max_{i∈S}(D[S,i]+logp(c_i,c_j)); select last maximizing D[All,i]+logp(c_i,</s>) then follow backpointers.

Executable approximant gap

Exact categorical structure, identifiers, parser decisions and effects have no useful percentage metric established here. No executable surrogate, automatic substitution or 1/2/5/10% guarantee is claimed.

invariant

Invariant and domain

Finite unoverflowed counts and fixed dictionary/member order produce deterministic text. DP is a head permutation; attributes used once but orphans not globally rejected. No original-text recovery guarantee.

Cost and resources

n<=12: DP O(n^22^n)/O(n2^n); member scanning and variant search, recursion depth<=4. u32 frequency overflow debug panics/release wraps; f64 counters/log have finite precision.

cost

Cost and resources

n<=12: DP O(n^22^n)/O(n2^n); member scanning and variant search, recursion depth<=4. u32 frequency overflow debug panics/release wraps; f64 counters/log have finite precision.

composition

Composition

Morphological realization, recursive attribute chunks and subset-DP ordering of Fact heads.

Observe explicit nonmodifier heads sorted by(word,class), accumulate transition/from counts. generate rejects0/>12 heads; form chooses lexicographic conditional/global counts with dictionary-first ties, restricts post-prep third-person pronouns to available н forms. Build chunks, maximize smoothed start/transitions/end log score, insert nominal dash, uppercase first char, end ! for imperative else period. For head classes c_i: D[{i},i]=logp(<s>,c_i); D[S∪{j},j]=max_{i∈S}(D[S,i]+logp(c_i,c_j)); select last maximizing D[All,i]+logp(c_i,</s>) then follow backpointers.

The parent invokes scoped transformations through the actual functions named in their source ranges. Children partition useful observations, not a complete semantic proof; boundaries can omit helpers, tests and effects.

models

behavior_complement

Missing synth, depth>4,0/>12 heads yield None. Post-prep third-person with н alternatives cannot select non-н. Arbitrary wrong Facts/orphan modifiers are not universally rejected.

reverse_reconstruction

Output sentence admits many Fact/Morph/Freq/OrderModel tuples; count histories sharing rankings collapse, observe retains only bigrams. Case/punctuation projection loses distinctions.

variant_lexicographic

Conditional dominates global, equal pair retains first dictionary form; norm keys frequencies; NEG/IMPLICIT stripped from synthesis key.

dp_ties

Strict > retains first predecessor; final max_by chooses last equal endpoint. Uniform two-class ordering gives[0,1].

chunk_depth

attribute:head.rel selects modifiers; pronominal adjectives first, nonadjectives recurse after head; depth5 returns None and used flags mutate during construction.

surface_projection

Implicit heads excluded; Gram0 permits subject/predicate noun dash only without PRON; imperative chooses !; class collapses prep/quantity details but preserves object case.

tests

Evidence

Parent source checks (a fragment inherits only the behavior they actually exercise):

Selected kg tests: 15 named outcomes, twice debug/twice release, equal sorted outcomes. Standalone actual global/build.rs: 3 named outcomes per run, twice debug/twice optimized; build_child is normally no-op, parent fixture invokes it against isolated synthetic seeds. Eight compiled source mutations (one per source) each compiled successfully and exited101 on the focused assertion; exact source restoration followed by positive rerun.

This fragment's untested branches remain source-derived. No live graph, DB, corpus, teacher, GPU or held-out evaluation was used. Command specs and numeric exits are retained in the external wave29 graphlang receipt. Strict kg Clippy reports existing source lints; see receipt.

prospective

Prospective graph-language encoding model — 2026-10-31

Read all eight sources before edits. No optimization proposed. All executable fixtures are tiny invented strings, compressed temp files, or isolated subprocess directories; no repository corpus, live store, teacher, GPU or held-out execution.

Composition hypothesis: Morph::load uses Gram then uk::parse produces Fact; render_check gives only multiset completeness; main encodes each member into registry-backed parallel columns with grammar and flags; textgen consumes Fact/Morph not encoded Edges directly. No read-edges-to-Fact reconstruction adapter exists here. global's lexical concept indices have no established Registry Id translation. Complement and preimage relations must preserve these separate tags. No meaningful percentage surrogate for categorical parse, identifiers, codec or effects is established; record executable approximant as unsupported.

This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/kg/src/textgen.rs.groupant/