Documentation

MIPRE.TM.Code.Encoding.Total

Total decoding, description size, and the Milestone C test battery #

Turing.decodeCode interprets every bit string as a machine: malformed descriptions (and non-canonical ones — anything decodeCodeExact rejects) decode to the default reject machine Code.defaultRejectCode i, giving the paper's total notation [α]_i.

Turing.codeSize is the description length |α|; codeSize_le bounds it explicitly in the header data — the arithmetic later consumed by λ-boundedness bookkeeping.

The examples at the end are the Milestone C acceptance battery (planning/tm-infrastructure.md, WP9), all kernel-evaluated by decide: encode/decode round trips for the Milestone B machines, and one malformed description per failure mode — zero states, alphabet of size one, wrong table length, out-of-range successor state, out-of-range work symbol, trailing garbage, and the empty string — each pinned to decodeCodeExact = none and decodeCode = defaultRejectCode.

Total decoding #

def Turing.decodeCode (i : ) (s : List Bool) :

Total decoding: the machine described by an arbitrary bit string — the paper's [α]_i. Strings rejected by decodeCodeExact denote the default reject machine.

Equations
Instances For
    @[simp]

    Description size #

    def Turing.codeSize {i : } (c : Code i) :

    The description size |α| of a machine code.

    Equations
    Instances For
      theorem Turing.encodeListWith_length_le {α : Type u_1} {enc : αList Bool} {B : } {l : List α} :
      (∀ al, (enc a).length B)(encodeListWith enc l).length l.length * B

      Elementwise length bound for concatenated encodings.

      Length bound for one well-formed table entry.

      Explicit size bound: header plus table-count times the per-entry bound. This is the |α| arithmetic that λ-boundedness bookkeeping consumes.

      Round trips (Milestone B machines) #

      The malformed battery #

      One raw description per failure mode; each must be rejected by decodeCodeExact and decode totally to the default reject machine.

      Display demos #