OAI/Combinatorics/ParityLifts/StackRoutines.lean
31 declarations, 0 contain sorry, 0 declared as axioms
- abbrev
OAI.ParityWL.Complexity.Wordsline 7 - def
OAI.ParityWL.Complexity.applyOpsline 9 - inductive
OAI.ParityWL.Complexity.StackExecline 12 - lemma
OAI.ParityWL.Complexity.StackExec.outputline 20 - lemma
OAI.ParityWL.Complexity.StackExec.iterateline 27 - lemma
OAI.ParityWL.Complexity.StackExec.mapline 34 - def
OAI.ParityWL.Complexity.StackMachine.andThenline 49Source documentation
Structured sequential composition; one finite-control step starts the second routine once the first has returned. No external simulator is presumed.
def StackMachine.andThen {Q R : Type} {t a : ℕ} (P : StackMachine Q t a) (T : StackMachine R t a) : StackMachine (Q ⊕ R) t a where …Mentions: OAI.ParityWL.Complexity.StackMachine
- def
OAI.ParityWL.Complexity.StackConfiguration.inlline 59 - def
OAI.ParityWL.Complexity.StackConfiguration.inrline 62 - lemma
OAI.ParityWL.Complexity.StackExec.andThen_rightline 65 - lemma
OAI.ParityWL.Complexity.StackExec.andThenline 73 - def
OAI.ParityWL.Complexity.StackMachine.repeatline 98Source documentation
Repeat a returning routine until it returns true, removing the halt marker on false. Restarting takes one local stack step and does not touch data.
def StackMachine.repeat {Q : Type} {t a : ℕ} (P : StackMachine Q t a) : StackMachine Q t a where …Mentions: OAI.ParityWL.Complexity.StackMachine
- lemma
OAI.ParityWL.Complexity.StackExec.repeat_trueline 105 - lemma
OAI.ParityWL.Complexity.StackExec.repeat_falseline 117 - def
OAI.ParityWL.Complexity.primitiveline 138Source documentation
One finite-table operation, including a return bit chosen from scanned tops. All alphabets and control sets of this routine are visibly finite.
def primitive {t a : ℕ} (ops : (Fin (t + 1) → Option (StackSymbol a)) → Fin (t + 1) → StackOp a) (test : (Fin (t + 1) → Option (StackSymbol a)) → Bool) : StackMachine (Option Bool) t a where …Mentions: OAI.ParityWL.Complexity.StackSymbol, OAI.ParityWL.Complexity.StackOp, OAI.ParityWL.Complexity.StackMachine
- lemma
OAI.ParityWL.Complexity.primitive_execline 146 - def
OAI.ParityWL.Complexity.Runsline 156 - lemma
OAI.ParityWL.Complexity.Runs.andThenline 160 - lemma
OAI.ParityWL.Complexity.Runs.compiledline 169 - structure
OAI.ParityWL.Complexity.MacroMachineline 182Source documentation
A finite control-flow chart whose nodes are verified stack routines.
structure MacroMachine (Q : Type) (t a : ℕ) where …
- def
OAI.ParityWL.Complexity.MacroMachine.lowerline 189 - def
OAI.ParityWL.Complexity.MacroMachine.liftline 197 - lemma
OAI.ParityWL.Complexity.MacroMachine.exec_routineline 201 - inductive
OAI.ParityWL.Complexity.MacroExecline 223 - lemma
OAI.ParityWL.Complexity.MacroExec.lowerline 232 - lemma
OAI.ParityWL.Complexity.MacroExec.compiledline 242 - def
OAI.ParityWL.Complexity.transferStepline 252Source documentation
A finite-table transfer step. The source is popped; a prescribed subset of other stacks receives its top symbol. An empty source returns true.
def transferStep {t a : ℕ} (src : Fin (t + 1)) (dst : Finset (Fin (t + 1))) : StackMachine (Option Bool) t a := …Mentions: OAI.ParityWL.Complexity.StackMachine
- def
OAI.ParityWL.Complexity.transferline 259 - def
OAI.ParityWL.Complexity.transferredline 262 - lemma
OAI.ParityWL.Complexity.transfer_runline 266 - lemma
OAI.ParityWL.Complexity.clear_runline 314Source documentation
Emptying a stack never modifies another stack.
lemma clear_run {t a : ℕ} (src : Fin (t + 1)) (w : Words t a) : Runs (transfer src ∅) w (2 * (w src).length + 1) (Function.update w src []) true := by …Mentions: OAI.ParityWL.Complexity.Words, OAI.ParityWL.Complexity.Runs, OAI.ParityWL.Complexity.transfer