Partial recursiveness of StateTransition, SingleTapeTM, TM0, and TM1 #
This file establishes Primcodable, Primrec, and Partrec instances and theorems for CSLib's
and Mathlib's single-tape Turing machine stack.
Main definitions #
Cslib.Turing.BiTape.extractWord: extracts a wordl : List Symbolwhen aBiTape Symbolis in standard output formBiTape.mk₁ l.Cslib.Turing.SingleTapeTM.stepOrStay: total one-step transition function fixing halted configurations (state = none).Cslib.Turing.SingleTapeTM.runFor: clocked execution returningsome l'whentmreacheshaltCfg l'intsteps.Cslib.Turing.SingleTapeTM.eval: partial evaluation functionList Symbol →. List Symbolof aSingleTapeTM Symbol.
Main results #
Computable.stateTransition_eval: for anyPrimcodablestate typeσand computable step functionf : σ → Option σ,StateTransition.eval f : σ →. σisPartrec(proved directly viaPartrec.fix).Primrec.list_isEmpty:List.isEmptyis primitive recursive on anyPrimcodableelement type.PrimcodableandPrimrecforStackTape Symbol,BiTape Symbol,_root_.Turing.ListBlank (Option Symbol), and_root_.Turing.Tape (Option Symbol).Cslib.Turing.SingleTapeTM.primrec_step,primrec_runFor,partrec_evalInit,partrec_eval, andpartrec_eval_right₀: everySingleTapeTM Symbolhas primitive recursive step and clocked-run functions and partial recursive evaluation functions.Cslib.Turing.SingleTapeTM.partrec_tm0_evalandpartrec_tm1_eval: every finitely supported MathlibTM0orTM1machine has a partial recursive evaluation function.
References #
If f : σ → Option σ is computable on a Primcodable state space σ, then
StateTransition.eval f : σ →. σ is partial recursive.
Primcodable and Primrec for StackTape and ListBlank #
List.isEmpty is primitive recursive on any Primcodable element type.
Primcodable and Primrec for BiTape and Turing.Tape #
Equivalence between _root_.Turing.Dir and Bool.
Instances For
The single-step transition function of any SingleTapeTM is primitive recursive.
StateTransition.eval tm.step is partial recursive for every SingleTapeTM Symbol.
Evaluating tm from tm.initCfg l to its final configuration is partial recursive.
Self-looping step function on tm.Cfg: halted configurations remain fixed.
Instances For
tm.OutputsWithinTime l l' t holds if and only if t iterations of tm.stepOrStay from
tm.initCfg l equal tm.haltCfg l'.
Clocked run of tm: after t steps on input l, returns some l' if tm has halted in
tm.haltCfg l', and none otherwise.
Instances For
l' ∈ tm.runFor l t holds if and only if tm.OutputsWithinTime l l' t.
Partial evaluation of tm on input words: tm.eval l evaluates to l' iff tm.Outputs l l'.
Instances For
The partial word evaluation tm.eval of any SingleTapeTM Symbol is partial recursive.
Evaluating tm from tm.initCfg l and reading the right half-tape right₀ of its final
configuration is partial recursive.
For any finitely supported Mathlib _root_.Turing.TM0.Machine, its partial evaluation
fun l => _root_.Turing.TM0.eval M (l.map some) is Partrec.
For any finitely supported Mathlib _root_.Turing.TM1 statement family, its partial evaluation
fun l => _root_.Turing.TM1.eval M (l.map some) is Partrec.