Documentation

Complexitylib.Models.TuringMachine.Combinators.ForInput

Read-only-input loop combinator #

TM.forInputTM body advances over a Boolean input symbol and invokes body without copying the input into auxiliary space. For input-preserving bodies, this iterates exactly once per original symbol. It is the input-fueled counterpart of the unary-work-register loop TM.forRegTM.

Main results #

theorem Complexity.TM.ForInputLoopSpec.reachesIn {n : } {body : TM n} {bodyTime : } {total count value : } (spec : body.ForInputLoopSpec bodyTime total) (htotal : value + count = total) :
body.forInputTM.reachesIn (forInputLoopTime bodyTime value count) (spec.scanCfg value) spec.doneCfg

Exact remaining execution of a certified input-driven loop.

theorem Complexity.TM.ForInputLoopSpaceSpec.prefix_withinAuxSpace {n : } {body : TM n} {bodyTime : } {total inputLength spaceBound count value t : } {spec : body.ForInputLoopSpec bodyTime total} (spaceSpec : ForInputLoopSpaceSpec spec inputLength spaceBound) {c : Cfg n body.forInputTM.Q} (htotal : value + count = total) (hreach : body.forInputTM.reachesIn t (spec.scanCfg value) c) (htime : t forInputLoopTime bodyTime value count) :
c.WithinAuxSpace inputLength spaceBound

Every prefix up to the exact remaining runtime of a certified input-driven loop respects its all-reachable auxiliary-space budget.

theorem Complexity.TM.IsTransducer.forInputTM {n : } {body : TM n} (hbody : body.IsTransducer) :

Iterating a one-way-output body over the read-only input remains a one-way-output transducer.