---
title: "algorithm-coin-change-tests — Mova code model"
description: "Mova code model of algorithms/src/coin_change/tests.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/algorithms/src/coin_change/tests.rs.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/algorithms/src/coin_change/tests.rs.groupant/>

# algorithm-coin-change-tests

The groupant beside algorithms/src/coin_change/tests.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
- **status:** partial descriptive instance
- **source:** [`algorithms/src/coin_change/tests.rs`](https://github.com/ElamurAI/mova-free/blob/main/algorithms/src/coin_change/tests.rs)
- **source SHA-256:** `0e307faf21e9ca14…`
- **repository folder:** [`algorithms/src/coin_change/tests.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/algorithms/src/coin_change/tests.rs.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 | [approximant](#approximant) |
| **ast** | partial | `syntax.json` |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [approximant](#approximant) |
| **tests** | existing checks referenced | [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 |
|---|---|---|---|
| `behavior_complement` | behavior_complement | partial relational specification | [behavior_complement](#behavior-complement) |
| `reverse_reconstruction` | reverse_reconstruction | partial relational specification | [reverse_reconstruction](#reverse-reconstruction) |
| `oracle_relation` | oracle_relation | partial relational specification | [oracle_relation](#oracle-relation) |
| `metamorphic_relation` | metamorphic_relation | partial relational specification | [metamorphic_relation](#metamorphic-relation) |
| `mutation_separation` | mutation_separation | partial relational specification | [mutation_separation](#mutation-separation) |

## Model text


### descriptant

#### coin_change tests groupant

Original code; no external implementation was copied. The mathematical recurrence is standard dynamic programming. Raw Rust is authoritative outside this sidecar. Syntax is partial and omits expansion and semantic resolution.

Composition: source identity, forward recurrence, invariant and typed relations jointly constrain observations. behavior_complement excludes outcomes; reverse_reconstruction retains compatible antecedents. They do not supply a global inverse; leaf checks do not prove caller wiring.

Epoch 2026-10-30: 64 subsets of denominations 1..6 at amounts 0..30: 1,984 comparisons each against BFS and exhaustive multiplicity enumeration. Tests cover zero rejection, storage-size overflow, non-greedy optimum, unbounded reuse, permutation, duplicates, scaling, extension and singleton preimages. Four tests passed twice each in debug and optimized standalone builds, with equal normalized outcomes. Strict lint passed and compiled mutants failed real assertions. Source syntax was identical twice. Reviewer correction replaced a non-overflowing chain witness with [MAX,MAX,1,2], and expanded coin cost accounting to include initialization and validation. Initial smoke tests preceded this recorded evidence; no prospective speedup claim was made. Finite observations are not universal proof. Allocation refusal, huge actual slices and complete preimage execution remain gaps. Preserve these observations in later epochs.

### approximant

#### Forward, invariant and cost

Iterate the bounded deterministic corpus and compare independent oracle outcomes. Invariant: every visited case satisfies its assertion before advancing. Failures stop the corresponding test. Recursive exhaustive oracles are exponential and intentionally bounded.

### models

## Typed relations

Subject: tests.rs, source SHA-256 in manifest.json. Successful-result relations assume storage success.

### behavior_complement

Universe: implementation/test-outcome pairs. On the fixed corpus a pass excludes disagreement at any asserted observation, but excludes no unseen defect. 64 subsets of denominations 1..6 at amounts 0..30: 1,984 comparisons each against BFS and exhaustive multiplicity enumeration. Tests cover zero rejection, storage-size overflow, non-greedy optimum, unbounded reuse, permutation, duplicates, scaling, extension and singleton preimages.

### reverse_reconstruction

A passing run admits all implementations agreeing on tested observations, including potentially incorrect programs outside the corpus. A failing run admits defect hypotheses, not a uniquely recovered cause. The compiled mutant supplies one concrete failing antecedent.

### oracle_relation

BFS shortest depth and recursive multiplicity enumeration independently compute the optimum; neither calls the production solver. Feasible multiplicities are bounded by amount/coin.

### metamorphic_relation

Paired inputs must satisfy the equality or ordering laws stated in the implementation models. Restricted successful small inputs avoid resource ambiguity. These checks supplement the independent oracle.

### mutation_separation

Replacing previous+1 with previous in compiled production code must fail unchanged real assertions; it did. This separates missing-count-increment behavior.

### tests

#### Checks and limits

2026-10-30: 64 subsets of denominations 1..6 at amounts 0..30: 1,984 comparisons each against BFS and exhaustive multiplicity enumeration. Tests cover zero rejection, storage-size overflow, non-greedy optimum, unbounded reuse, permutation, duplicates, scaling, extension and singleton preimages.

Four tests passed in each of two debug and two optimized standalone rustc --edition 2024 --test runs. Single-thread outputs matched after removing timing from the footer. Strict clippy-driver --test -D warnings and rustfmt passed. Compiled copied production mutant (omit count increment) failed unchanged assertion checks. No mutation remains in repository source. Syntax extraction ran twice and matched bytes; source hashes are bound in manifest.json.

No allocator-refusal injection, benchmark, machine-domain proof or workspace integration is claimed. Parent integration owns exports and central registry wiring.
