OAI/Computability/FiniteCompiler/Simulator.lean
132 declarations, 0 contain sorry, 0 declared as axioms
Literal finite-quota machine simulation and readout correctness.
- structure
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Alphabetline 13Source documentation
Finite work alphabet, including a literal code for every input letter and a distinct blank. The remaining symbols are rejected by output reading.
structure Alphabet (S Γ : Type*) where …
- inductive
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Moveline 20 - instance
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.(instance at line 24)line 24 - structure
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Commandline 26 - structure
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Machineline 34Source documentation
A deterministic left-ended one-tape machine.
noneis halt, recognized only while the head is at a workspace cell.structure Machine (Q Γ : Type*) where …
- inductive
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Resumeline 38 - inductive
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Headline 44Source documentation
Distinct phases make every scan's designated reading side unambiguous.
inductive Head (S Q : Type*) | start | rewind : Resume S → Head S Q | scan : Resume S → Head S Q | run : Q → Head S Q | left : Q → Head S Q | finish | ok deriving DecidableEq, Fintype variable {S Γ Q : Type*} /-- The cell table is finite when the alphabets and state set are finite. AllMentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.rewind, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Resume, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.finish, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.cell, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.cellline 57Source documentation
The cell table is finite when the alphabets and state set are finite. All tests and assignments are precisely the source's scan expansion.
def cell (A : Alphabet S Γ) (M : Machine Q Γ) [DecidableEq Γ] (q : Head S Q) (b : Base S) (t : Tag S Γ) : Option (Instruction (Head S Q) (Tag S Γ)) := …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Alphabet, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Machine, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Head, OAI.FiniteAlgebraicEnvelopes.Compiler.Base, OAI.FiniteAlgebraicEnvelopes.Compiler.Tag, OAI.FiniteAlgebraicEnvelopes.Compiler.Instruction
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.tableline 100 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.run_outsideline 114Source documentation
No false acceptance results from an attempted simulation past a quota edge.
theorem run_outside (A : Alphabet S Γ) (M : Machine Q Γ) [DecidableEq Γ] (q : Q) (b : Base S) (t : Tag S Γ) (hb : b ≠ .workspace) : (table A M).cell (.run q) b t = none := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Alphabet, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Machine, OAI.FiniteAlgebraicEnvelopes.Compiler.Base, OAI.FiniteAlgebraicEnvelopes.Compiler.Tag, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.cell
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.ok_terminalline 119 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.rewindline 129Source documentation
Rewinding crosses all left cells unchanged and then changes phase at alpha. This lemma holds on dirty data as well as the intended clean simulation.
theorem rewind (A : Alphabet S Γ) (M : Machine Q Γ) [DecidableEq Γ] (s : Resume S) (l r : List (Base S × Tag S Γ)) (rb : Bool) : Relation.ReflTransGen (Scan.Step (table A M)) ⟨l,.rewind s,r,true,rb⟩ ⟨[],.scan s,l.reverse ++ r,true,rb⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Alphabet, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Machine, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Resume, OAI.FiniteAlgebraicEnvelopes.Compiler.Base, OAI.FiniteAlgebraicEnvelopes.Compiler.Tag, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.finishline 142Source documentation
Going to the right boundary also preserves every cell.
theorem finish (A : Alphabet S Γ) (M : Machine Q Γ) [DecidableEq Γ] (l r : List (Base S × Tag S Γ)) (lb : Bool) : Relation.ReflTransGen (Scan.Step (table A M)) ⟨l,.finish,r,lb,true⟩ ⟨r.reverse ++ l,.ok,[],lb,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Alphabet, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Machine, OAI.FiniteAlgebraicEnvelopes.Compiler.Base, OAI.FiniteAlgebraicEnvelopes.Compiler.Tag, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.cross_rightline 160 - abbrev
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cellsline 183 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.scan_updateline 187Source documentation
One complete find/update/rewind invocation acts on the first matching cell. No higher-level operation is used in the actual finite table.
theorem scan_update (s s' : Resume S) (p r : Cells S Γ) (b : Base S) (t t' : Tag S Γ) (hp : ∀ c ∈ p, cell A M (.scan s) c.1 c.2 = some ⟨.scan s,c.2,true⟩) (hc : cell A M (.scan s) b t = some ⟨.rewind s',t',false⟩) : ReflTransGen (Scan.Step (table A M)) ⟨[],.scan s,p ++ (b,t)::r,true,true⟩ ⟨[],.scan s',p ++ (b,t')::r,true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Resume, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Base, OAI.FiniteAlgebraicEnvelopes.Compiler.Tag, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.cell, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.rewind, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.readAnchorline 204Source documentation
Tags following the copy phase; unused full-tag fields remain literally clean, as required by the validator/simulator convention.
def readAnchor (a : S) (read : Bool) : Base S × Tag S Γ := …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Base, OAI.FiniteAlgebraicEnvelopes.Compiler.Tag
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.filledWorkline 207 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.bareline 210 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.bodyline 214Source documentation
The whole tape during copying: read and unread anchor prefixes on either side of the reserved workspace, with a filled prefix followed by blanks.
def body (xp xs yp ys w : List S) (n : ℕ) : Cells S Γ := …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Passline 219 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_readline 222 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_input_bareCline 224 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_input_bareDline 225 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_input_bareWline 226 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_input_filledline 227 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_fill_anchorline 228 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_fill_bareCline 230 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_fill_filledline 231 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.copy_left_oneline 235Source documentation
A loaded input letter is transferred to the next free workspace cell, expanding the prefix and shrinking the finite quota by one.
theorem copy_left_one (xp xs yp ys w : List S) (a : S) (n : ℕ) : ReflTransGen (Scan.Step (table A M)) ⟨[],.scan .input,body A xp (a::xs) yp ys w (n+1),true,true⟩ ⟨[],.scan .input,body A (xp++[a]) xs yp ys (w++[a]) n,true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.body
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.copy_right_oneline 265 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.copy_leftline 300 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.copy_rightline 311 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.copy_allline 323Source documentation
Both anchor blocks are copied in their order, not in zipper order.
theorem copy_all (x y : List S) (n : ℕ) : ReflTransGen (Scan.Step (table A M)) ⟨[],.scan .input,body A [] x [] y [] (x.length+y.length+n),true,true⟩ ⟨[],.scan .input,body A x [] y [] (x++y) n,true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.body
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_spare_anchorline 332 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_spare_Cline 334 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_spare_filledline 335 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_first_anchorline 336 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_first_Cline 338 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.copy_enter_runline 343Source documentation
The two final copy scans check a spare blank and position the machine at the first workspace cell. In particular the quota is not treated as tape that may silently grow during internal transitions.
theorem copy_enter_run (x y w : List S) (n : ℕ) : ReflTransGen (Scan.Step (table A M)) ⟨[],.scan .input,body A x [] y [] w (n+1),true,true⟩ ⟨(x.map (readAnchor A · true) ++ [bare A .cutC]).reverse,.run M.initial, w.map (filledWork A) ++ List.replicate (n+1) (bare A .workspace) ++ [bare A .cutD] ++ y.map (readAnchor A · true),true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.body, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.readAnchor, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.bare, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.filledWork
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.start_copyline 397Source documentation
The fresh post-validator handoff starts copying from the left boundary.
theorem start_copy (cells : Cells S Γ) : ReflTransGen (Scan.Step (table A M)) ⟨cells.reverse,.start,[],true,true⟩ ⟨[],.scan .input,cells,true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.copy_correctline 407Source documentation
Literal correctness of the complete copy/init program with any sufficient finite quota. Every table operation is one of the listed compiled equations.
theorem copy_correct (x y : List S) (n : ℕ) : ReflTransGen (Scan.Step (table A M)) ⟨(body A [] x [] y [] (x.length+y.length+n+1)).reverse,.start,[],true,true⟩ ⟨(x.map (readAnchor A · true) ++ [bare A .cutC]).reverse,.run M.initial, (x++y).map (filledWork A) ++ List.replicate (n+1) (bare A .workspace) ++ [bare A .cutD] ++ y.map (readAnchor A · true),true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.body, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.readAnchor, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.bare, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.filledWork
- structure
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tapeline 426Source documentation
A literal bounded workspace. The left list is in reverse tape order, and an empty right list is outside the supplied quota, not a fresh blank cell.
structure Tape where …
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.writeWorkline 432Source documentation
Update only the simulated work track; all auxiliary tag fields are retained.
def writeWork (t : Tag S Γ) (a : Γ) : Tag S Γ := { t with work := a } - inductive
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.TapeStepline 436Source documentation
The intended finite-quota operations of the finite compiler. These are defined from the given machine table, not postulated accepting transitions.
inductive TapeStep (M : Machine Q Γ) : Tape (S := S) (Γ := Γ) (Q := Q) → Tape → Prop …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Machine, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workCellsline 446 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.runSectorline 450Source documentation
Workspace in its fixed surrounding anchor/cut sector.
xis the cells before C in their ordinary order,ythe cells following D.def runSector (A : Alphabet S Γ) (x y : Cells S Γ) (c : Tape (S := S) (Γ := Γ) (Q := Q)) : …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Alphabet, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.tapeStep_simulatesline 460Source documentation
Every bounded machine transition is implemented by one or two actual finite scan instructions. Both the stationary left edge and true left movement are proved, and no quota insertion occurs during simulation.
theorem tapeStep_simulates (x y : Cells S Γ) {c d : Tape (S := S) (Γ := Γ) (Q := Q)} …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.tapeRun_simulatesline 488Source documentation
Simulation respects literal finite traces, without a running-time bound.
theorem tapeRun_simulates (x y : Cells S Γ) {c d : Tape (S := S) (Γ := Γ) (Q := Q)} …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.quota_exhaustedline 497Source documentation
Exhaustion is stuck even if the machine's current state would be halting: a halt must be observed at an actual workspace cell.
theorem quota_exhausted (x y : Cells S Γ) (q : Q) (l : List (Tag S Γ)) : Scan.step (table A M) (runSector A x y ⟨q,l,[]⟩) = none := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Tag, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.runSector
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.halt_readoutline 502Source documentation
A genuine in-bounds halt triggers precisely the readout rewind.
theorem halt_readout (x y : Cells S Γ) (q : Q) (l : List (Tag S Γ)) (t : Tag S Γ) (r : List (Tag S Γ)) (h : M.transition q t.work = none) : ReflTransGen (Scan.Step (table A M)) (runSector A x y ⟨q,l,t::r⟩) ⟨[],.scan .readout, x ++ [bare A .cutC] ++ workCells (l.reverse ++ t::r) ++ bare A .cutD :: y, true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Tag, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.runSector, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.bare, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workCells
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.split_filterMapline 526Source documentation
Locate a specified item of a projected list without discarding the cells skipped by the projection. This handles interleaved anchors and workspace.
theorem split_filterMap {α β : Type*} (f : α → Option β) (l : List α) (p : List β) (b : β) (r : List β) (h : l.filterMap f = p ++ b::r) : ∃ l₁ a l₂, l = l₁ ++ a::l₂ ∧ l₁.filterMap f = p ∧ f a = some b ∧ l₂.filterMap f = r := by … - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workViewline 549 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.anchorViewline 554 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workView_appendline 559 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.anchorView_appendline 561 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.readout_passline 566 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.put_passline 578 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.readout_oneline 591Source documentation
One output letter is read from the first unread workspace cell and written to the first unmarked anchor. The projected views certify both orders.
theorem readout_one (cells : Cells S Γ) (done remaining : List Γ) (out : List S) (a : S) (g : Γ) (n : ℕ) (hw : workView cells = done.map (true,·) ++ (false,g)::remaining.map (false,·)) (ha : anchorView cells = out.map some ++ none :: List.replicate n none) (hg : g ≠ A.blank) (hg' : A.output g = some a) : ∃ cells', ReflTransGen (Scan.Step (table A M)) ⟨[],.scan .readout,cells,true,true⟩ ⟨[],.scan .readout,cells',true,true⟩ ∧ workView cells' = (done ++ [g]).map (true,·) ++ remaining.map (false,·) ∧ anchorView cells' = (out ++ [a]).map some ++ List.replicate n none := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workView, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.anchorView, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.readout_blankline 646Source documentation
The first unread blank ends output. No cell is changed by the final sweep.
theorem readout_blank (cells : Cells S Γ) (done : List Γ) (rest : List (Bool × Γ)) (hw : workView cells = done.map (true,·) ++ (false,A.blank)::rest) : ReflTransGen (Scan.Step (table A M)) ⟨[],.scan .readout,cells,true,true⟩ ⟨cells.reverse,.ok,[],true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workView, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.input_ne_blankline 673 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.readout_completeline 682Source documentation
Complete readout of a finite, blank-delimited returned string. The spare anchor count drops by exactly one for each letter, including when that letter's anchor is on the other side of the workspace.
theorem readout_complete (out : List S) (cells : Cells S Γ) (done tail : List Γ) (old : List S) (n : ℕ) (hw : workView cells = done.map (true,·) ++ (out.map A.input ++ A.blank::tail).map (false,·)) (ha : anchorView cells = old.map some ++ List.replicate (out.length+n) none) : ∃ cells', ReflTransGen (Scan.Step (table A M)) ⟨[],.scan .readout,cells,true,true⟩ ⟨cells'.reverse,.ok,[],true,true⟩ ∧ anchorView cells' = (old ++ out).map some ++ List.replicate n none := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workView, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.anchorView, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Rejectsline 718Source documentation
Rejection here means the actual finite table has no forward accepting trace; it is stronger than merely failing a chosen simulation trace.
def Rejects (v : Scan.Sector (Head S Q) (Base S) (Tag S Γ)) : Prop := …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Sector, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Head, OAI.FiniteAlgebraicEnvelopes.Compiler.Base, OAI.FiniteAlgebraicEnvelopes.Compiler.Tag
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.terminal_of_noneline 721 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.rejects_of_stuckline 727 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.rejects_beforeline 736 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.readout_no_unreadline 746Source documentation
No unread cell, in particular no blank delimiter, means that readout stops at omega without entering the finish phase.
theorem readout_no_unread (cells : Cells S Γ) (done : List Γ) (h : workView cells = done.map (true,·)) : Rejects A M ⟨[],.scan .readout,cells,true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workView, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Rejects
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.put_no_anchorline 756Source documentation
Filled anchors cannot be overwritten. Exhausting them rejects even if a workspace character was successfully decoded.
theorem put_no_anchor (cells : Cells S Γ) (old : List S) (a : S) (h : anchorView cells = old.map some) : Rejects A M ⟨[],.scan (.put a),cells,true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.anchorView, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Rejects
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.readout_invalidline 765Source documentation
Metasymbols that are neither blank nor returned letters block output.
theorem readout_invalid (cells : Cells S Γ) (done : List Γ) (g : Γ) (rest : List (Bool × Γ)) (h : workView cells = done.map (true,·) ++ (false,g)::rest) (hg : g ≠ A.blank) (hdecode : A.output g = none) : Rejects A M ⟨[],.scan .readout,cells,true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workView, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Rejects
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.readout_no_anchorline 785Source documentation
The first nonblank output symbol cannot succeed when all anchors are full.
theorem readout_no_anchor (cells : Cells S Γ) (done : List Γ) (rest : List (Bool × Γ)) (old : List S) (a : S) (g : Γ) (hw : workView cells = done.map (true,·) ++ (false,g)::rest) (ha : anchorView cells = old.map some) (hg : g ≠ A.blank) (hdecode : A.output g = some a) : Rejects A M ⟨[],.scan .readout,cells,true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workView, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.anchorView, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Rejects
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.readout_too_longline 809Source documentation
Insufficient anchor quota is rejected without truncating the returned string or replacing it by an arbitrary shorter result.
theorem readout_too_long (out : List S) (cells : Cells S Γ) (done tail : List Γ) (old : List S) (n : ℕ) (hw : workView cells = done.map (true,·) ++ (out.map A.input ++ A.blank::tail).map (false,·)) (ha : anchorView cells = old.map some ++ List.replicate n none) (hn : n < out.length) : Rejects A M ⟨[],.scan .readout,cells,true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workView, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.anchorView, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Rejects
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.padline 841Source documentation
Appending untouched blank cells reserves quota without altering any already represented tape position.
def pad (A : Alphabet S Γ) (c : Tape (S := S) (Γ := Γ) (Q := Q)) (n : ℕ) : Tape (S := S) (Γ := Γ) (Q := Q) := …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Alphabet, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- inductive
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.UnboundedStepline 847Source documentation
Unbounded left-ended tape semantics. A cell beyond the finite represented region is blank; it is materialized only when reached. No output fact or acceptance relation is built into these transition constructors.
inductive UnboundedStep (A : Alphabet S Γ) (M : Machine Q Γ) : Tape (S := S) (Γ := Γ) (Q := Q) → Tape (S := S) (Γ := Γ) (Q := Q) → Prop …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Alphabet, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Machine, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.tapeStep_padline 857Source documentation
A bounded operation never inspects cells beyond its current head and is therefore preserved by appending arbitrary extra blank quota.
theorem tapeStep_pad {c d : Tape (S := S) (Γ := Γ) (Q := Q)} …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.tapeRun_padline 865 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.finite_quotaline 874Source documentation
Every finite unbounded trace uses a finite quota. The terminal padding can be prescribed in advance, in particular ensuring an explicit spare blank.
theorem finite_quota {c d : Tape (S := S) (Γ := Γ) (Q := Q)} …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.tapeStep_tagsline 892Source documentation
A predicate on full tags insensitive to changes of the work symbol is an invariant of every bounded run, not just of a chosen clean execution.
theorem tapeStep_tags (P : Tag S Γ → Prop) (hwrite : ∀ t a, P t → P (writeWork t a)) {c d : Tape (S := S) (Γ := Γ) (Q := Q)} (h : TapeStep M c d) …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Tag, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.writeWork, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.TapeStep
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.unboundedStep_tagsline 920 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.unboundedRun_tagsline 931 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.initialTapeline 940Source documentation
Initial finite representation after copying, before adding blank quota.
def initialTape (w : List S) : Tape (S := S) (Γ := Γ) (Q := Q) := …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Haltedline 944Source documentation
The halt test includes the implicit blank at the first unrepresented cell.
def Halted (c : Tape (S := S) (Γ := Γ) (Q := Q)) : Prop := …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Returnsline 949Source documentation
The returned string begins at position zero and is delimited by its first blank. Extra blanks may lie outside the finite represented portion.
def Returns (c : Tape (S := S) (Γ := Γ) (Q := Q)) (out : List S) : Prop := …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pad_leftline 953 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pad_rightline 956 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.halt_padline 959 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workView_workCellsline 966 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.anchorView_workCellsline 970 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.finalCellsline 974Source documentation
Full cell list at readout, with the copied anchors on either side.
def finalCells (x y : List S) (c : Tape (S := S) (Γ := Γ) (Q := Q)) : Cells S Γ := …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.anchorView_readAnchorsline 978 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workView_readAnchorsline 987 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.finalCells_anchorsline 991 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.finalCells_workline 999 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.copy_correct_padline 1017 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.halt_readout_padline 1027 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.unread_padline 1041 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.simulation_completeline 1054Source documentation
Adequate quota for every genuinely halting, length-bounded output. This connects the actual copy/run/readout table, including empty inputs, without assuming a bound on the machine's running time or workspace beforehand.
theorem simulation_complete (x y out : List S) (c : Tape (S := S) (Γ := Γ) (Q := Q)) …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.haltSectorline 1100Source documentation
The first readout-rewind configuration, before any tape cell is moved.
def haltSector (x y : Cells S Γ) (c : Tape (S := S) (Γ := Γ) (Q := Q)) : …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.run_step_casesline 1107Source documentation
Exact classification of a simulator step made in a workspace run phase. The only intermediate phase is the deterministic half of a left move.
theorem run_step_cases (x y : Cells S Γ) (c : Tape (S := S) (Γ := Γ) (Q := Q)) …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.simulation_halt_soundline 1152Source documentation
Arbitrary accepting paths, not just chosen forward simulations, must have exited the run phases through a genuine in-bounds machine halt.
theorem simulation_halt_sound (x y : Cells S Γ) {c : Tape (S := S) (Γ := Γ) (Q := Q)} …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- structure
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.SemanticTapeline 1189Source documentation
Semantic one-sided tape: its right end is an infinite blank tail, not an extra halting edge. Auxiliary simulator tags do not enter this semantics.
structure SemanticTape (Γ Q : Type*) where …
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.semanticStepline 1195Source documentation
The literal machine command interpreted on an infinite right-hand tape.
def semanticStep (M : Machine Q Γ) (c : SemanticTape Γ Q) : Option (SemanticTape Γ Q) := …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Machine, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.SemanticTape
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.SemanticStepline 1204 - def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.interpretline 1207 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.replicate_append_constline 1211 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.interpret_padline 1219 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.tapeStep_interpretline 1226Source documentation
Each bounded transition is exactly one transition of the semantic machine.
theorem tapeStep_interpret (A : Alphabet S Γ) (M : Machine Q Γ) {c d : Tape (S := S) (Γ := Γ) (Q := Q)} (h : TapeStep M c d) : …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Alphabet, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Machine, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.TapeStep
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.unboundedStep_interpretline 1233Source documentation
Materializing an implicit blank never changes the semantic tape.
theorem unboundedStep_interpret (A : Alphabet S Γ) (M : Machine Q Γ) {c d : Tape (S := S) (Γ := Γ) (Q := Q)} (h : UnboundedStep A M c d) : …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Alphabet, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Machine, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.UnboundedStep
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.tapeRun_interpretline 1245 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.unboundedRun_interpretline 1250 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.semantic_deterministicline 1255 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.halted_interpretline 1259 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.halted_quota_uniqueline 1269Source documentation
Halts with different finite quotas represent the same semantic output. In particular a workspace edge can neither invent a halt nor alter one.
theorem halted_quota_unique (A : Alphabet S Γ) (M : Machine Q Γ) {start c d : Tape (S := S) (Γ := Γ) (Q := Q)} (n : ℕ) …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Alphabet, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Machine, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.accepting_afterline 1288Source documentation
An accepting terminal cannot be bypassed by any other finite forward path.
theorem accepting_after {v s w : Scan.Sector (Head S Q) (Base S) (Tag S Γ)} (hs : ReflTransGen (Scan.Step (table A M)) v s) (hw : ReflTransGen (Scan.Step (table A M)) v w) (hq : w.head = .ok) : ReflTransGen (Scan.Step (table A M)) s w := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Sector, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Head, OAI.FiniteAlgebraicEnvelopes.Compiler.Base, OAI.FiniteAlgebraicEnvelopes.Compiler.Tag, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.readout_soundline 1301Source documentation
Soundness of the output scans, under the literal decoding convention of the compiled alphabet. Both the first blank and the anchor quota are forced; the result is not an arbitrary truncation of a workspace string.
theorem readout_sound (hdecode : ∀ g a, A.output g = some a → g = A.input a) (remaining : List Γ) (cells : Cells S Γ) (done : List Γ) (old : List S) (n : ℕ) (hw : workView cells = done.map (true,·) ++ remaining.map (false,·)) (ha : anchorView cells = old.map some ++ List.replicate n none) {v : Scan.Sector (Head S Q) (Base S) (Tag S Γ)} (hv : ReflTransGen (Scan.Step (table A M)) ⟨[],.scan .readout,cells,true,true⟩ v) (hq : v.head = .ok) : ∃ out tail result, remaining = out.map A.input ++ A.blank::tail ∧ out.length ≤ n ∧ v = ⟨result.reverse,.ok,[],true,true⟩ ∧ anchorView result = (old ++ out).map some ++ List.replicate (n-out.length) none := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Cells, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.workView, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.anchorView, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Sector, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Head, OAI.FiniteAlgebraicEnvelopes.Compiler.Base, OAI.FiniteAlgebraicEnvelopes.Compiler.Tag, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.semanticContentline 1349Source documentation
The whole semantic tape, read in physical order starting at cell zero.
def semanticContent (c : SemanticTape Γ Q) : Stream' Γ := …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.SemanticTape
- def
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.SemanticReturnsline 1353Source documentation
Standard literal, first-blank-delimited machine output.
def SemanticReturns (c : SemanticTape Γ Q) (w : List S) : Prop := …
Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.SemanticTape
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.returns_interpretline 1356 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.input_injectiveline 1364 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.delimited_prefix_uniqueline 1371Source documentation
The input alphabet excludes the delimiter, so two literal returned prefixes of the same infinite tape must be the same list, including empty output.
theorem delimited_prefix_unique (x y : List S) (r s : Stream' Γ) (h : Stream'.appendStream' (x.map A.input) (Stream'.cons A.blank r) = Stream'.appendStream' (y.map A.input) (Stream'.cons A.blank s)) : x = y := by … - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.semanticReturns_uniqueline 1395 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.returned_quota_uniqueline 1404Source documentation
The output of any bounded accepting computation agrees with the output of a genuine unbounded halt, whenever both are expressed in the literal input alphabet. This compares different quotas without comparing their padding.
theorem returned_quota_unique (M : Machine Q Γ) {start c d : Tape (S := S) (Γ := Γ) (Q := Q)} (n : ℕ) …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Machine, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Tape
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.haltSector_readoutline 1421 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.tapeRun_tagsline 1432 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.simulation_sound_sufficientline 1443Source documentation
Exact soundness from the fresh validated handoff, with a positive spare workspace quota. Arbitrary successes are actual halts returning exactly the output marks that cleanup will retain.
theorem simulation_sound_sufficient (hdecode : ∀ g a, A.output g = some a → g = A.input a) (x y : List S) (n : ℕ) {v : Scan.Sector (Head S Q) (Base S) (Tag S Γ)} (hv : ReflTransGen (Scan.Step (table A M)) ⟨(body A [] x [] y [] (x.length+y.length+n+1)).reverse,.start,[],true,true⟩ v) (hq : v.head = .ok) : ∃ c out result, ReflTransGen (TapeStep M) (pad A (initialTape A M (x++y)) (n+1)) c ∧ Halted A M c ∧ Returns A c out ∧ out.length ≤ x.length+y.length ∧ v = ⟨result.reverse,.ok,[],true,true⟩ ∧ anchorView result = out.map some ++ List.replicate (x.length+y.length-out.length) none := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Sector, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Head, OAI.FiniteAlgebraicEnvelopes.Compiler.Base, OAI.FiniteAlgebraicEnvelopes.Compiler.Tag, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.body, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.TapeStep, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pad, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.initialTape, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Halted, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Returns, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.anchorView
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_fill_bareDline 1477 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pass_spare_Dline 1478 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.scan_exhaustedline 1480 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.fill_no_spaceline 1489 - theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.copy_no_spaceline 1497Source documentation
Zero spare workspace is a genuine rejection even for empty input.
theorem copy_no_space (xp xs yp ys w : List S) : Rejects A M ⟨[],.scan .input,body A xp xs yp ys w 0,true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Rejects, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.body
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.copy_insufficientline 1549Source documentation
A quota no larger than the unread input rejects: there must be space for every copied letter and also the spare blank tested before running.
theorem copy_insufficient (xp xs yp ys w : List S) (n : ℕ) (hn : n ≤ xs.length+ys.length) : Rejects A M ⟨[],.scan .input,body A xp xs yp ys w n,true,true⟩ := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Rejects, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.body
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.simulation_insufficientline 1568Source documentation
Insufficient quota cannot give an accepting computation from a clean post-validator handoff, including the zero-workspace and empty-input cases.
theorem simulation_insufficient (x y : List S) (s : ℕ) (hs : s ≤ x.length+y.length) : Rejects A M ⟨(body A [] x [] y [] s).reverse,.start,[],true,true⟩ := …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Rejects, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.body
- theorem
OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.simulation_soundline 1575Source documentation
Soundness for every clean quota, without a promise that enough was inserted. All accepting paths return the genuine first-blank-delimited machine output, in input order and within the anchor length bound.
theorem simulation_sound (hdecode : ∀ g a, A.output g = some a → g = A.input a) (x y : List S) (s : ℕ) {v : Scan.Sector (Head S Q) (Base S) (Tag S Γ)} (hv : ReflTransGen (Scan.Step (table A M)) ⟨(body A [] x [] y [] s).reverse,.start,[],true,true⟩ v) (hq : v.head = .ok) : ∃ n c out result, s = x.length+y.length+n+1 ∧ ReflTransGen (TapeStep M) (pad A (initialTape A M (x++y)) (n+1)) c ∧ Halted A M c ∧ Returns A c out ∧ out.length ≤ x.length+y.length ∧ v = ⟨result.reverse,.ok,[],true,true⟩ ∧ anchorView result = out.map some ++ List.replicate (x.length+y.length-out.length) none := by …Mentions: OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Sector, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Head, OAI.FiniteAlgebraicEnvelopes.Compiler.Base, OAI.FiniteAlgebraicEnvelopes.Compiler.Tag, OAI.FiniteAlgebraicEnvelopes.Compiler.Scan.Step, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.table, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.body, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.TapeStep, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.pad, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.initialTape, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Halted, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.Returns, OAI.FiniteAlgebraicEnvelopes.Compiler.Simulator.anchorView