Exact five/six-command compilation, including cleanup of the old annotation. The transition table is fixed for all input tapes.
theorem
MindFormal.A595Paper.pending_run
{Q : Type u_1}
{A : Type u_2}
[DecidableEq Q]
[DecidableEq A]
(δ : Transition Q A)
(c : Configuration Q A)
(q : Q)
(s : A)
(right : Bool)
:
LocalRun (localTable δ) (pendingTape c s q s right) 4 (c.step q s right).pack
theorem
MindFormal.A595Paper.compile_transition
{Q : Type u_1}
{A : Type u_2}
[DecidableEq Q]
[DecidableEq A]
(δ : Transition Q A)
(c : Configuration Q A)
(q : Q)
(s : A)
(right : Bool)
(hδ : δ c.control (c.tape.cells c.tape.head) = some (q, s, right))
:
inductive
MindFormal.A595Paper.MachineRun
{Q : Type u_1}
{A : Type u_2}
(δ : Transition Q A)
:
Configuration Q A → ℕ → Configuration Q A → Prop
- nil {Q : Type u_1} {A : Type u_2} {δ : Transition Q A} (c : Configuration Q A) : MachineRun δ c 0 c
- cons {Q : Type u_1} {A : Type u_2} {δ : Transition Q A} {c d : Configuration Q A} {q : Q} {s : A} {right : Bool} {n : ℕ} (transition : δ c.control (c.tape.cells c.tape.head) = some (q, s, right)) (rest : MachineRun δ (c.step q s right) n d) : MachineRun δ c (n + 1) d
Instances For
theorem
MindFormal.A595Paper.compile_run
{Q : Type u_1}
{A : Type u_2}
[DecidableEq Q]
[DecidableEq A]
(δ : Transition Q A)
{c d : Configuration Q A}
{n : ℕ}
(h : MachineRun δ c n d)
:
Equations
Instances For
theorem
MindFormal.A595Paper.compile_halt
{Q : Type u_1}
{A : Type u_2}
[DecidableEq Q]
[DecidableEq A]
(δ : Transition Q A)
(c : Configuration Q A)
(hh : δ c.control (c.tape.cells c.tape.head) = none)
:
LocalRun (localTable δ) c.pack 1 (doneTape c)
theorem
MindFormal.A595Paper.compile_complete
{Q : Type u_1}
{A : Type u_2}
[DecidableEq Q]
[DecidableEq A]
(δ : Transition Q A)
{c d : Configuration Q A}
{n : ℕ}
(h : MachineRun δ c n d)
(hh : δ d.control (d.tape.cells d.tape.head) = none)
:
Completion is charged as a separate primitive. Prepared initialization
is charged by the caller, giving the printed 6 * transitions + 2 cap.