algorithm-wave5-compositions
The groupant beside algorithms/tests/composition_wave5.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 | bounded checked | Forward |
| ast | partial | syntax.json |
| composition | partial | Composition |
| cost | symbolic unmeasured | Cost |
| descriptant | present | descriptant |
| invariant | partial | Invariant |
| tests | bounded executed | evidence |
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 |
|---|---|---|---|
behavior_complement | behavior_complement | bounded source correspondence | behavior_complement |
reverse_reconstruction | reverse_reconstruction | bounded source correspondence | reverse_reconstruction |
matching_flow | unit_capacity_embedding | bounded source correspondence | matching_flow |
graph_identity | deletion_and_traversal_certificate | bounded source correspondence | graph_identity |
forest_distance | rooted_unrooted_projection | bounded source correspondence | forest_distance |
substring_join | lexical_membership_and_cardinality | bounded source correspondence | substring_join |
prefix_tree | weighted_tree_reconstruction | bounded source correspondence | prefix_tree |
palindrome_sandwich | subsequence_contiguity_bound | bounded source correspondence | palindrome_sandwich |
unit_work | restricted_cost_embedding | bounded source correspondence | unit_work |
Model text
descriptant
Wave-five composition groupant
2026-10-30: seven client joins cover ten new algorithm modules through their public APIs, with established BFS, matching, suffix-array, KMP, LCS and Manacher observations. The same adapter objects connect each leaf pair. Models describe both absent behavior and compatible antecedents before seven typed specialized relations.
The graph fixtures retain original multiedge IDs; substring fixtures retain byte indices; prefix-code fixtures retain original symbol indices. Huffman is joined to an independently reconstructed prefix trie and a subset-partition tree optimum, rather than an unrelated algorithm. Coin and equal-square matrix chains share only a restricted unit-work interpretation; no general reduction is claimed.
The source compiles as a Cargo integration test after the wave-five exports are integrated. During isolated development, rustc --test links the parent's compiled mova_algorithms rlibs; implementation files are neither copied into this test nor replaced. Dependencies and executable-library hashes are recorded in evidence.json. Parent registry and subsystem bindings are integrated separately.
Epoch observation: all seven tests passed in both profiles twice. A compiled wrong right-vertex offset in the flow adapter failed while public algorithm libraries remained unchanged. Thus the checks exercise a wiring failure, not merely leaf agreement or a deliberately changed expected value.
The syntax projection is partial and source-bound. Macro expansion, type resolution, semantic proof, exhaustive arbitrary inputs and global composition guarantees remain absent. CPU fixture correctness does not imply parser, school, teacher or training quality.
model
Wave-five compositions
Forward
Seven tagged joins evaluate public algorithms on identical finite fixtures with identity-preserving adapters. Conditional equations below; this test artifact is not a production approximant.
Invariant
Vertex, edge, symbol and byte identities are preserved. Valid indices, representable arithmetic and ordinary allocation are assumed. Leaf agreement alone does not prove adapters.
Cost
Enumerate bipartite masks sum(2^(lr)) for l,r<=3; 1555 edge lists; 874 earlier-parent forests; 255 texts with 15 queries; 364 weight vectors; 511 palindrome texts; 800 coin instances and 50 square chains. Reached leaf work plus checks: deletion BFS O(V+E) per removed edge/vertex, all-pairs forest BFS, substring byte volume O(n^3), subset-tree oracle O(3^n+n2^n) time/O(2^n) memory. No speed claim.
Composition
Tags are separate domains, not a fictitious pipeline. Preserve original edge IDs for flow/trails, roots for depth/LCA, bytes for suffix/LCP and weights for trie paths. Correlated bugs remain possible despite independent literal, deletion, partition and certificate checks.
behavior_complement
In tagged observation space U for seven finite domains, exclude outputs violating flow=matching size, deletion component predicates, LCA distance identity, substring membership/count agreement, prefix-free optimal weighted paths, palindrome length sandwich, or unit-work costs. Conditional absent-behavior model, not merely rejected fixtures.
reverse_reconstruction
For tagged output y define R^-1(y)={x in fixture domain: all joined public observations and adapters equal y}. Retain shared graph/text/trie identities. Cardinality, cost or length leaves many compatible inputs; uniqueness is not claimed. Sequential inverse is an existential join on the SAME intermediate, not independent choices from leaf fibers.
matching_flow
Adapter makes s->L, L->R, R->t capacities one with disjoint offsets. Flow value equals matching size; positive middle-edge flow is itself a matching; final source-side cut capacity equals value. Reverse cardinality-k fiber retains all graphs of maximum matching size k, not one matching or edge order.
graph_identity
For indexed undirected multigraph G, bridge iff c(G-e)>c(G), articulation iff c(G-v)>c(G), removed vertex excluded. Euler existence requires connected nonisolates and zero/two odd degrees; returned IDs permute original edges and each consecutive pair matches its named edge. Loops count twice and parallel IDs stay distinct. Reverse trail plus indexed endpoints constrains edges; connectivity counts alone cannot recover them.
forest_distance
Parent forest -> symmetric adjacency preserves vertices. If a=LCA(u,v), dist(u,v)=depth(u)+depth(v)-2depth(a); cross-tree pairs return None. Ancestor lies on both parent chains. BFS distances forget root choice; inverse retains all rootings compatible with LCA observations, not a unique forest.
substring_join
SAM.contains(q) iff KMP positions nonempty, including empty query. Distinct nonempty substrings equals n(n+1)/2 minus adjacent suffix-array LCP sum and literal substring-set size. Count inverse is nonunique; bounded query membership constrains only the observed language. LCP and suffix indices use the same text.
prefix_tree
Codes are prefix-free original-symbol leaves. Sum w_i*length_i equals sum of descendant weights across trie edges. Independent subset recurrence C(S)=sum(S)+min[C(A)+C(S-A)] gives optimum full binary tree cost for >=2 symbols; empty zero, singleton stipulated one-bit code. Prefix codes reconstruct their trie, but scalar cost loses topology and weights; zero weights and ties remain admissible.
palindrome_sandwich
LPS length(t)=LCS length(t,reverse(t)); longest contiguous Manacher palindrome <= LPS <= n. This relates lengths; arbitrary LCS witness need not be palindromic. Reverse fiber retains every string meeting observed lengths, not recovered symbols or positions.
unit_work
Amount graph 0..a with x->x+c for positive coins embeds unlimited minimum count as BFS distance. Separately m>=1 square matrices side d>=1 cost (m-1)*d^3=minimum_coins([1],m-1)*d^3, since every parenthesization has m-1 merges. Restricted unit-work embeddings, not a general coin/matrix reduction. Reverse costs leave denominations, dimensions and parenthesizations ambiguous.
evidence
Executed finite evidence
Date: 2026-10-30. Source SHA-256: 4a26224c9064ed02cbcaf3dc88760b790c6ae7ae4e0528cb6c243d1ce88803a2.
Seven public-API tests passed twice in debug and twice with optimized test code and release libraries. Normalized test-name/result rows match across all four runs. Two mova-modelcheck syntax outputs match byte-for-byte. Exact source, dependency, library and external artifact hashes are retained in evidence.json; syntax.json is the materialized partial projection.
| Join | Finite domain and observations |
|---|---|
| Flow/matching | 689 bipartite masks, left/right sizes 0..3; cardinality, cut capacity, extracted middle-edge matching identities |
| Graph deletion/Euler | 1555 edge sequences of length 0..4 from six unordered endpoint pairs on three vertices; loops/parallel IDs; deletion BFS components, trail existence and original edge certificates |
| LCA/BFS | 874 forests through six vertices, each parent absent or earlier; every pair checked for distance and returned ancestor-chain membership |
| Substring indices | 255 binary texts through length seven; literal distinct sets and suffix LCP counts; 15 binary queries including empty per text |
| Huffman/trie | 364 weight vectors through five symbols, weights 0..2; prefix freedom, independent subset-tree optimum and weighted trie-edge sum; stipulated one-bit singleton |
| Palindrome | 511 binary texts through length eight; LPS equals reverse-LCS length and contains the Manacher maximum-length lower bound |
| Unit work | 800 coin-set/amount combinations, all subsets of 1..5 and amounts 0..24; amount-graph BFS. Separately 50 equal-square chain restrictions, one to ten matrices and side 1..5 |
Negative control: compile a copy changing only the flow adapter's middle-edge destination from left+v to v. The flow/matching test fails with exit 101; production libraries and owned source remain unchanged. This tests actual adapter wiring. The same seven original tests had already passed against those libraries. No expected-value mutation is used.
Reproduction after integration: cargo test -p mova-algorithms --test composition_wave5 --locked, then the same command with --release; run each twice. Isolated reproduction uses rustc --edition=2024 --test SOURCE --extern mova_algorithms=RLIB and the corresponding dependency directory; add -O and the release rlib for optimized mode. Compare only test-name/result rows, excluding elapsed time.
Assumptions are valid indices, lawful equality, finite representable arithmetic and successful allocation. Earlier-parent forests are not every possible labeled rooted forest. Binary strings and small weights are finite restrictions. Invalid-input behavior, large-instance performance and universal proof remain outside this evidence. The square-chain equation is a restricted cost observation, not a general equivalence with coin change.
This page in Markdown โ https://md.groupants.elamur.ai/free/en/mova/algorithms/tests/composition_wave5.rs.groupant/