Documentation

Complexitylib.Models.TuringMachine.Combinators.ForWorkOnes.Defs

One-prefix work-tape loop combinator — definitions #

TM.forWorkOnesTM driverIdx body scans a work tape from left to right and invokes body once for each consecutive 1 symbol. The driver advances before each invocation and halts with its head on the first non-1 symbol. This is the machine-level control needed to consume the unary-width prefix of a self-delimiting binary word without materializing the prefix elsewhere.

Exact iteration semantics require body to preserve the already-advanced driver tape and head. The combinator itself is a concrete TM; loop certificates and proofs live in the adjacent internal and surface modules.

Driver states for a consecutive-one work-tape loop.

Instances For
    def Complexity.TM.forWorkOnesTM {n : } (driverIdx : Fin n) (body : TM n) :
    TM n

    Advance over one 1 on work tape driverIdx and invoke body; halt on the first non-1 symbol. An initial left marker is skipped safely.

    Equations
    • One or more equations did not get rendered due to their size.
    Instances For
      def Complexity.TM.forWorkOnesLoopTime (bodyTime : ) (value : ) :

      Exact remaining time for a one-prefix loop whose body takes bodyTime value steps on iteration value. The terminal non-one exit takes one step.

      Equations
      Instances For
        structure Complexity.TM.ForWorkOnesLoopSpec {n : } (driverIdx : Fin n) (body : TM n) (bodyTime : ) (total : ) :

        Wrapper-free exact-control certificate for a consecutive-one work loop.

        Instances For