Documentation

Complexitylib.Models.TuringMachine.Branch

Fixing a nondeterministic branch #

An NTM's transition function is a Bool away from a TM's, so fixing the Bool turns it into a deterministic machine. Unlike NTM.choiceTM, which reads one choice bit per step off a tape and therefore runs a whole path, branchTM fixes the same choice for every step: it is the one-step successor operator of the configuration graph, not a path.

That is what a search of the configuration graph needs. Deterministic machinery — the encoded step Complexity.Cobham.stepFn of Cobham's algebra above all — applies to a TM and not to an NTM, so an edge of the graph is taken by one of the two branchTMs (Complexity.NTM.succ_iff, where the graph is defined).

Main definitions #

Main results #

def Complexity.NTM.branchTM {k : } (tm : NTM k) (b : Bool) :
TM k

The deterministic machine that always takes branch b.

Equations
Instances For
    @[simp]
    theorem Complexity.NTM.branchTM_Q {k : } (tm : NTM k) (b : Bool) :
    (tm.branchTM b).Q = tm.Q
    @[simp]
    theorem Complexity.NTM.branchTM_qstart {k : } (tm : NTM k) (b : Bool) :
    @[simp]
    theorem Complexity.NTM.branchTM_qhalt {k : } (tm : NTM k) (b : Bool) :
    (tm.branchTM b).qhalt = tm.qhalt
    @[simp]
    theorem Complexity.NTM.branchTM_δ {k : } (tm : NTM k) (b : Bool) :
    (tm.branchTM b).δ = tm.δ b
    @[simp]
    theorem Complexity.NTM.branchTM_stepCfg {k : } (tm : NTM k) (b : Bool) (c : Cfg k tm.Q) :
    (tm.branchTM b).stepCfg c = tm.stepCfg b c

    One step of the fixed branch is one step of the nondeterministic machine on that branch.

    theorem Complexity.NTM.branchTM_step {k : } (tm : NTM k) (b : Bool) {c : Cfg k tm.Q} (h : c.state tm.qhalt) :
    (tm.branchTM b).step c = some (tm.stepCfg b c)

    A non-halted configuration steps to the branch's successor.

    theorem Complexity.NTM.branchTM_step_of_halted {k : } (tm : NTM k) (b : Bool) {c : Cfg k tm.Q} (h : c.state = tm.qhalt) :
    (tm.branchTM b).step c = none

    A halted configuration has no successor on either branch.