Kenton Labs / Computation

Algorithms

Separate a program’s behavior from its specification. Exhaustive finite domains expose ordering, multiplicity, empty-input, and duplicate-value errors.

The vocabulary.

These definitions state the objects and properties used by the dataset. The complete instance specification remains the authority for each result.

Input contract
A precise set of admissible inputs, including sizes and value ranges.
Postcondition
The relation between the original input and the returned output.
Oracle
A separately implemented reference property used to accept or reject a candidate.

How the dataset works.

Three deterministic instances define this family. Each includes its input model, a checked result, evidence, and an acceptance procedure. Download the complete dataset JSON ↘ or the area’s readable source ↘.

Acceptance procedure

  1. Enumerate every list in the declared alphabet and length bound.
  2. Run the candidate insertion-sort implementation without modifying the source input.
  3. Compare each result with the reference ordering, including repeated elements.
  4. Reject immediately with an input witness if ordering or multiplicity differs.

Cost and scope

For alphabet size k and maximum length n, this family checks Σ kⁱ inputs for i=0…n. Insertion sort performs O(n²) comparisons in its worst case.

A common failure

Sortedness alone does not prove that an output preserves the input multiset.

Explore the mechanics.

Change a local input or follow the steps. The stored result and its scope remain attached to the downloadable record.

Worked records.

Three instances expose concrete claims and the artifacts that establish or refute them. Expand a record for the problem, checker reasoning, formal payload, and verification metadata.

Insertion sort over a finite domainExhaustive bounded validation · 364 inputs

The problem

Sort every list of length 0–5 over {−1, 0, 1}, preserving every occurrence.

The checked result

Correct over the stated input domain: yes.

The candidate shifts larger values to the right before inserting the next value. A separate checker compares every declared input with Python’s reference ordering. Duplicates and the empty list are included.

Why the checker accepts it

  1. Enumerate every list in the declared alphabet and length bound.
  2. Run the candidate insertion-sort implementation without modifying the source input.
  3. Compare each result with the reference ordering, including repeated elements.
  4. Reject immediately with an input witness if ordering or multiplicity differs.

Formal specification

{
  "alphabet": [
    -1,
    0,
    1
  ],
  "max_length": 5
}

Claim and evidence

{
  "claim": {
    "correct_on_declared_domain": true
  },
  "witness": {
    "function": "insertion_sort"
  }
}

Dataset construction

Deterministic finite fixture; full enumeration or witness replay as stated. Structured JSON; field meanings are stated in the specification. Acceptance covers 364 checker units for this record; the unit type is stated in its verification scope.

Complexity and limits

For alphabet size k and maximum length n, this family checks Σ kⁱ inputs for i=0…n. Insertion sort performs O(n²) comparisons in its worst case.

This is not a general proof for arbitrary lists, a stability proof, or a complexity result.

A boundary to investigate

Sortedness alone does not prove that an output preserves the input multiset. Add stability certificates for tagged records or an unbounded inductive invariant.

Readable source ↘Record JSON ↘Full area ↗Related KL-FCS-012 ↘Related KL-FCS-013 ↘
Longer binary listsComplete bounded enumeration · 511 inputs

The problem

Sort every list of length at most 8 over [0, 1].

The checked result

Correct over the stated input domain: yes.

The alphabet and bound jointly define the dataset. Every list is compared with a reference result; the declared domain includes duplicates, reversed lists, and empty input.

Why the checker accepts it

  1. Enumerate every list in the declared alphabet and length bound.
  2. Run the candidate insertion-sort implementation without modifying the source input.
  3. Compare each result with the reference ordering, including repeated elements.
  4. Reject immediately with an input witness if ordering or multiplicity differs.

Formal specification

{
  "alphabet": [
    0,
    1
  ],
  "max_length": 8
}

Claim and evidence

{
  "claim": {
    "correct_on_declared_domain": true
  },
  "witness": {
    "function": "insertion_sort"
  }
}

Dataset construction

Deterministic finite fixture; full enumeration or witness replay as stated. Structured JSON; field meanings are stated in the specification. Acceptance covers 511 checker units for this record; the unit type is stated in its verification scope.

Complexity and limits

For alphabet size k and maximum length n, this family checks Σ kⁱ inputs for i=0…n. Insertion sort performs O(n²) comparisons in its worst case.

This finite acceptance result does not establish an unrestricted algorithm theorem.

A boundary to investigate

Sortedness alone does not prove that an output preserves the input multiset. Add stability certificates for tagged records or an unbounded inductive invariant.

Readable source ↘Record JSON ↘Full area ↗Related KL-FCS-001 ↘Related KL-FCS-013 ↘
Five-symbol sorting domainComplete bounded enumeration · 781 inputs

The problem

Sort every list of length at most 4 over [-2, -1, 0, 1, 2].

The checked result

Correct over the stated input domain: yes.

The alphabet and bound jointly define the dataset. Every list is compared with a reference result; the declared domain includes duplicates, reversed lists, and empty input.

Why the checker accepts it

  1. Enumerate every list in the declared alphabet and length bound.
  2. Run the candidate insertion-sort implementation without modifying the source input.
  3. Compare each result with the reference ordering, including repeated elements.
  4. Reject immediately with an input witness if ordering or multiplicity differs.

Formal specification

{
  "alphabet": [
    -2,
    -1,
    0,
    1,
    2
  ],
  "max_length": 4
}

Claim and evidence

{
  "claim": {
    "correct_on_declared_domain": true
  },
  "witness": {
    "function": "insertion_sort"
  }
}

Dataset construction

Deterministic finite fixture; full enumeration or witness replay as stated. Structured JSON; field meanings are stated in the specification. Acceptance covers 781 checker units for this record; the unit type is stated in its verification scope.

Complexity and limits

For alphabet size k and maximum length n, this family checks Σ kⁱ inputs for i=0…n. Insertion sort performs O(n²) comparisons in its worst case.

This finite acceptance result does not establish an unrestricted algorithm theorem.

A boundary to investigate

Sortedness alone does not prove that an output preserves the input multiset. Add stability certificates for tagged records or an unbounded inductive invariant.

Readable source ↘Record JSON ↘Full area ↗Related KL-FCS-001 ↘Related KL-FCS-012 ↘

Go further.

Add stability certificates for tagged records or an unbounded inductive invariant.

Questions to investigate

  1. Sortedness alone does not prove that an output preserves the input multiset.
  2. Which assumption in the specification can be changed to make the current evidence insufficient?
  3. Add stability certificates for tagged records or an unbounded inductive invariant.

Conceptual references

These sources explain the surrounding theory. The linked material was not imported as a dataset, and these records do not claim checking by the source’s software.

Related areas