The worklist search over encoded configurations #
⚠️ Unreviewed by Bolton
The configuration graph of a space-bounded machine is searched by a worklist: a visited string holds the codes found so far, one fixed-width record each, and a counter says which record is expanded next. One step expands one record — it appends each of its two successors that is not already there — and advances the counter. Running the loop for as many steps as there are configurations expands everything, since the counter passes every record the search will ever hold.
The encoding is the one Cobham's theorem already uses: Cobham.cfgCode packs a
configuration into 2(k+2)+1 fixed-width blocks and Cobham.stepFn is the
encoded step of a deterministic machine, so NTM.branchTM supplies the two
successors.
Main definitions #
Complexity.nstepFn— the encoded successor along one branchComplexity.addBlock— append a record unless it is already thereComplexity.searchStepPair— one worklist step, on the unpacked stateComplexity.searchStep— the same on the packed state
Main results #
Complexity.searchStep_pack— the packed step is the unpacked stepComplexity.searchStep_mem_FP— one step is polynomial-time
Rulers for a whole code #
A code's width, as a ruler: m copies of the block ruler.
Equations
- Complexity.wideRuler m R = (List.replicate m R).flatten
Instances For
Normalise a would-be code to exactly the code width.
Equations
- Complexity.fitCode m R b = Complexity.padTo (Complexity.wideRuler m R) b
Instances For
The encoded successors #
The encoded successor of a configuration along branch b.
Equations
- Complexity.nstepFn tm b R z = Complexity.Cobham.stepFn (tm.branchTM b) R z
Instances For
One step of the search #
Append a record to the visited string unless it is already there.
Equations
- Complexity.addBlock R b V = Complexity.Cobham.selectHead (Complexity.memFlag R b V) V (V ++ b)
Instances For
The record the counter points at.
Equations
- Complexity.curBlock m R r V = Complexity.blockAt (Complexity.wideRuler m R) V r.length
Instances For
The visited string must be at least this long for the record to exist.
Equations
- Complexity.guardRuler m R r = List.replicate ((false :: r).length * (Complexity.wideRuler m R).length) false
Instances For
The packed search state: the ruler, the counter and the visited string.
Equations
- Complexity.searchPack R r V = Complexity.pair R (Complexity.pair r V)
Instances For
The packed step is the unpacked step.
The packed iteration is the unpacked one.
One search step is polynomial-time.