The wipe loop #
TM.forRegTM drives a body an exact number of times off a dedicated unary fuel
register. Running TM.wipeStepTM through it, fueled by a register holding v
marks unrelated to any targeted tape's content, blanks the v cells starting at
each target's head, whatever was there (cells 1 … v when the head is parked at
cell 1; see TM.wipedTape_cells_of_head_one).
Main results #
TM.wipedTape— the closed form ofvwipe steps applied to a tapeTM.wipeLoop_hoareTime— the loop's contract
Wipe-step applied i times to t, in closed form.
Equations
- Complexity.TM.wipedTape t i = (fun (s : Complexity.Tape) => s.writeAndMove Complexity.Γw.blank.toΓ Complexity.Dir3.right)^[i] t
Instances For
Wiping really blanks the tape. A tape parked at cell 1 whose content
is confined to cells 1 … H becomes literally the blank tape (head at H + 1)
after H wipe steps — this is where the content-agnostic wipe pays off: no
assumption is made about where inside 1 … H the nonblank cells sit.
A fresh output tape ((Tape.init []).move Dir3.right) is Parked.
A fresh output tape satisfies the empty output accumulator.
The wipe loop. Fueled by a register at r holding v marks (r
disjoint from targets), forRegTM (wipeStepTM targets) r turns every tape in
targets into wipedTape of it: the v cells starting at its head are blanked
and the head ends v cells further right. Every other tape — including the fuel
register itself — is left exactly as it was.