Model-internal register-machine reachability and instruction semantics for the 207-state TM
Definitionpalomar_zf207_internal_rmcomputabilitylogicset-theoryturing-machines
Defines the model-internal register-machine abstraction layer for the 207-state Turing machine inside an arbitrary model of . Given a -tuple of registers and -bit program-counter prefixes , we define:
- Register lookup and update for .
- Model-internal register reachability , asserting that from every valid encoded register frame with positive gap and positive trailing garbage , the Turing machine internally reaches a valid encoded register frame at with positive .
- Model-internal register halting , asserting that every valid encoded register frame at with internally reaches a terminal (halting) configuration.
- The instruction-level soundness interface , stating that
decodeLBitsaccurately reflects goto, increment, decrement (nonzero and zero branches), and halt instructions inside .
Definition code
import Definitions.Def_palomar_zf207_tm_check
import Definitions.Def_palomar_zf207_internal_tm
namespace PalomarZF207InternalRM
open PalomarZF207History
open PalomarZF207Internal
open PalomarZF207InternalTM
open PalomarZF207TMCheck
/-- Read register `k` (`0 ≤ k < 9`) from a 9-register tuple in a model. -/
def regGetV {V : Type} (k : Nat) (rs : Regs9 V) : V :=
match k with
| 0 => rs.r0
| 1 => rs.r1
| 2 => rs.r2
| 3 => rs.r3
| 4 => rs.r4
| 5 => rs.r5
| 6 => rs.r6
| 7 => rs.r7
| _ => rs.r8
/-- Update register `k` (`0 ≤ k < 9`) in a 9-register tuple in a model. -/
def regSetV {V : Type} (k : Nat) (val : V) (rs : Regs9 V) : Regs9 V :=
match k with
| 0 => { rs with r0 := val }
| 1 => { rs with r1 := val }
| 2 => { rs with r2 := val }
| 3 => { rs with r3 := val }
| 4 => { rs with r4 := val }
| 5 => { rs with r5 := val }
| 6 => { rs with r6 := val }
| 7 => { rs with r7 := val }
| _ => { rs with r8 := val }
/-- Internal reachability between register-machine configurations over any valid margin `m ≥ 1` and tail `t ≥ 1`. -/
def RegReachV {V : Type} (E : V → V → Prop)
(p1 : List Bool) (rs1 : Regs9 V) (p2 : List Bool) (rs2 : Regs9 V) : Prop :=
∀ m t code, ¬ Empty E m → ¬ Empty E t →
FrameCodeV E (bitsToNat p1) m rs1 t code →
∃ m' t' code', ¬ Empty E m' ∧ ¬ Empty E t' ∧
FrameCodeV E (bitsToNat p2) m' rs2 t' code' ∧
InternalReach E code code'
/-- Internal halting from a register-machine configuration over any valid margin `m ≥ 1` and tail `t ≥ 1`. -/
def RegHaltsV {V : Type} (E : V → V → Prop)
(p : List Bool) (rs : Regs9 V) : Prop :=
∀ m t code, ¬ Empty E m → ¬ Empty E t →
FrameCodeV E (bitsToNat p) m rs t code →
InternalHaltsFrom E code
/-- Internal register-machine instruction semantics for the 207-state TM's `decodeLBits` decoder. -/
def InternalRegMachine {V : Type} (E : V → V → Prop) : Prop :=
∀ (pref : List Bool) (rs : Regs9 V),
pref.length = 42 → Regs9Nat E rs →
(∀ pn, decodeLBits pref = .goto pn →
pn.length = 42 ∧ RegReachV E pref rs pn rs) ∧
(∀ k pn, decodeLBits pref = .inc k pn →
k < 9 ∧ pn.length = 42 ∧
∀ v', Succ E (regGetV k rs) v' → RegReachV E pref rs pn (regSetV k v' rs)) ∧
(∀ k pnz pz, decodeLBits pref = .dec k pnz pz →
k < 9 ∧ pnz.length = 42 ∧ pz.length = 42 ∧
(∀ v', Succ E v' (regGetV k rs) → RegReachV E pref rs pnz (regSetV k v' rs)) ∧
(Empty E (regGetV k rs) → RegReachV E pref rs pz rs)) ∧
(decodeLBits pref = .halt → RegHaltsV E pref rs)
end PalomarZF207InternalRM
Source
James Chang, Nonhalting and ZF-independence for a 207-state Turing machine, Sections 2 and 6 (register-machine compilation and simulation inside models of ZF)