OAI/Computability/WLIdentification/WordCommands.lean
24 declarations, 0 contain sorry, 0 declared as axioms
- abbrev
OAI.WLIdentification.StackModel.Command.readline 11 - abbrev
OAI.WLIdentification.StackModel.Command.emitline 12 - def
OAI.WLIdentification.StackModel.Command.drainline 14 - def
OAI.WLIdentification.StackModel.Command.clearline 17 - def
OAI.WLIdentification.StackModel.Command.moveline 19 - theorem
OAI.WLIdentification.StackModel.Command.drain_execline 22Source documentation
Tail traversal is an actual structured loop, not a host-language iteration.
theorem drain_exec (k : K) (body : Command K (Option Bool)) (S : K → Word) (s : Option Bool) (f : Bool → (K → Word) → (K → Word)) (c : ℕ) (hbody : ∀ b T, ∃ t, Exec body (some b) T t (f b T) c) (hpres : ∀ b T, f b T k = T k) : ∃ n ≤ (c + 2) * (S k).length + 2, Exec (drain k body) s S none ((S k).reverse.foldl (fun T b => f b (Function.update T k (T k).dropLast)) S) n := by …Mentions: OAI.WLIdentification.StackModel.Command, OAI.WLIdentification.Word, OAI.WLIdentification.StackModel.Command.Exec, OAI.WLIdentification.StackModel.Command.drain
- def
OAI.WLIdentification.StackModel.Command.pushManyline 67 - def
OAI.WLIdentification.StackModel.Command.appendManyline 70 - theorem
OAI.WLIdentification.StackModel.Command.pushMany_execline 73 - def
OAI.WLIdentification.StackModel.Command.fanEffectline 91 - theorem
OAI.WLIdentification.StackModel.Command.fan_foldline 94 - theorem
OAI.WLIdentification.StackModel.Command.fan_execline 116 - theorem
OAI.WLIdentification.StackModel.Command.clear_execline 126 - theorem
OAI.WLIdentification.StackModel.Command.move_execline 134 - def
OAI.WLIdentification.StackModel.Command.copyline 147Source documentation
Copy a complete word, preserving its order and the source, using one private work stack.
def copy (a b tmp : K) : Command K (Option Bool) := …
Mentions: OAI.WLIdentification.StackModel.Command
- theorem
OAI.WLIdentification.StackModel.Command.copy_execline 151 - def
OAI.WLIdentification.StackModel.Command.renameline 185 - theorem
OAI.WLIdentification.StackModel.Command.rename_renameline 194 - theorem
OAI.WLIdentification.StackModel.Command.Exec.renameline 201Source documentation
Renaming uses only the named stacks; arbitrary ambient data are framed.
theorem Exec.rename {c : Command K R} {s S t T n} (h : Exec c s S t T n) (e : K ↪ L) (W : L → Word) (hW : W ∘ e = S) : ∃ U, Exec (c.rename e) s W t U n ∧ U ∘ e = T ∧ ∀ l, (∀ k, e k ≠ l) → U l = W l := by …Mentions: OAI.WLIdentification.StackModel.Command, OAI.WLIdentification.StackModel.Command.Exec, OAI.WLIdentification.Word
- def
OAI.WLIdentification.StackModel.Command.embedLeftline 241 - def
OAI.WLIdentification.StackModel.Command.embedRightline 251 - theorem
OAI.WLIdentification.StackModel.Command.Exec.leftline 261 - theorem
OAI.WLIdentification.StackModel.Command.Exec.rightline 276 - theorem
OAI.WLIdentification.StackModel.Command.while_stepsline 292Source documentation
A finite chain of loop states has the counted actual execution.
theorem while_steps (test : R → Bool) (c : Command K R) (n cost : ℕ) (s : ℕ → R) (S : ℕ → K → Word) (hs : ∀ i < n, test (s i) = true) (hn : test (s n) = false) (hstep : ∀ i < n, ∃ t ≤ cost, Exec c (s i) (S i) (s (i+1)) (S (i+1)) t) : ∃ t ≤ (cost + 1) * n + 1, Exec (.while test c) (s 0) (S 0) (s n) (S n) t := by …Mentions: OAI.WLIdentification.StackModel.Command, OAI.WLIdentification.Word, OAI.WLIdentification.StackModel.Command.Exec