OAI/Computability/Superstring/Programs.lean
30 declarations, 0 contain sorry, 0 declared as axioms
- def
OAI.Superstring.BitCode.Block.clearline 11Source documentation
Clearing and transfers are explicit bit programs. In particular, reversing or copying a variable-width label is never given unit cost.
def clear (k : K) : Block K := .loop k (.pop k)
Mentions: OAI.Superstring.BitCode.Block
- def
OAI.Superstring.BitCode.Block.transferline 13 - theorem
OAI.Superstring.BitCode.Block.clear_execline 16 - theorem
OAI.Superstring.BitCode.Block.transfer_execline 37 - def
OAI.Superstring.BitCode.Block.fanoutline 87 - theorem
OAI.Superstring.BitCode.Block.fanout_execline 91 - def
OAI.Superstring.BitCode.Block.copyline 145 - theorem
OAI.Superstring.BitCode.Block.copy_execline 148 - def
OAI.Superstring.BitCode.Block.renameline 184Source documentation
Change the names of registers; loops and instructions are unchanged.
def rename (f : K → L) : Block K → Block L | .push k b => .push (f k) b | .pop k => .pop (f k) | .skip => .skip | .branch k a b c => .branch (f k) (a.rename f) (b.rename f) (c.rename f) | .seq a b => .seq (a.rename f) (b.rename f) | .loop k a => .loop (f k) (a.rename f) /-- A syntax tree mentions only finitely many registers. -/
Mentions: OAI.Superstring.BitCode.Block
- def
OAI.Superstring.BitCode.Block.supportline 193Source documentation
A syntax tree mentions only finitely many registers.
def support [DecidableEq K] : Block K → Finset K | .push k _ | .pop k => {k} | .skip => ∅ | .branch k a b c => insert k (a.support ∪ b.support ∪ c.support) | .seq a b => a.support ∪ b.support | .loop k a => insert k a.supportMentions: OAI.Superstring.BitCode.Block
- theorem
OAI.Superstring.BitCode.Block.update_compline 200 - theorem
OAI.Superstring.BitCode.Block.Exec.pullbackline 211Source documentation
Restrict an execution to any injective family of registers containing all registers in its syntax. The rest of an infinite ambient store is irrelevant.
theorem Exec.pullback [DecidableEq K] [DecidableEq L] (f : K → L) (g : L → K) (hg : Function.Injective g) {b : Block K} {s t : Store K} {n : ℕ} (h : b.Exec s t n) (hf : ∀ k ∈ b.support, g (f k) = k) : (b.rename f).Exec (s ∘ g) (t ∘ g) n := by …Mentions: OAI.Superstring.BitCode.Block, OAI.Superstring.BitCode.Store, OAI.Superstring.BitCode.Block.Exec
- inductive
OAI.Superstring.BitCode.Programline 263Source documentation
A bounded-loop register language. Every
repeatuses the ORIGINAL input length, not a mutable register. Nesting is static in the finite program. Copy is assignment, not concatenation; the only operation increasing maximum word length is a one-bit push. This gives uniform polynomial bounds for every program.inductive Program (K : Type) | push (k : K) (b : Bool) | pop (k : K) | clear (k : K) | copy (source target : K) | skip | branch (k : K) (empty low high : Program K) | seq (first second : Program K) | repeat (body : Program K) namespace Program …
- def
OAI.Superstring.BitCode.Program.runline 277 - def
OAI.Superstring.BitCode.Program.workline 290 - def
OAI.Superstring.BitCode.Program.polynomialline 296 - theorem
OAI.Superstring.BitCode.Program.eval_polynomialline 303 - theorem
OAI.Superstring.BitCode.Program.work_posline 307 - def
OAI.Superstring.BitCode.Program.Boundedline 311Source documentation
All stack lengths are bounded by a common number.
def Bounded (s : Store K) (M : ℕ) : Prop := ∀ k, (s k).length ≤ M …
Mentions: OAI.Superstring.BitCode.Store
- theorem
OAI.Superstring.BitCode.Program.Bounded.monoline 314 - theorem
OAI.Superstring.BitCode.Program.Bounded.updateline 317 - theorem
OAI.Superstring.BitCode.Program.iterate_boundedline 325 - theorem
OAI.Superstring.BitCode.Program.run_boundedline 336 - def
OAI.Superstring.BitCode.Program.depthline 367Source documentation
Only the maximum loop-nesting depth determines the number of counters.
def depth : Program K → ℕ | .push _ _ | .pop _ | .clear _ | .copy _ _ | .skip => 0 | .branch _ a b c => max a.depth (max b.depth c.depth) | .seq a b => max a.depth b.depth | .repeat a => a.depth + 1
Mentions: OAI.Superstring.BitCode.Program
- def
OAI.Superstring.BitCode.Program.compileline 374 - def
OAI.Superstring.BitCode.Program.Cleanline 386Source documentation
Unused higher counters may contain arbitrary data, for compositional use.
def Clean (d : ℕ) (z : Store ℕ) : Prop := z 1 = [] ∧ ∀ j < d, z (j + 2) = []
Mentions: OAI.Superstring.BitCode.Store
- theorem
OAI.Superstring.BitCode.Program.Clean.monoline 388 - theorem
OAI.Superstring.BitCode.Program.Clean.update_aboveline 391 - theorem
OAI.Superstring.BitCode.Program.sum_update_leftline 399 - theorem
OAI.Superstring.BitCode.Program.sum_update_rightline 406