Counted transfer of a local tape block #
Turing.MultiTapeTM.copyBlock copies a block from work tape 0 to work tape 1, using a
unary counter on work tape 2. Each nonblank counter cell authorizes one transfer, including
a blank source cell, and is erased. All three heads advance together. The first blank counter
cell halts the machine without moving a head. The optional erasure mode also clears the source.
The machine has one control state. Its contract allows arbitrary initial head positions and
preserves all cells outside the three transferred segments. The counter cell immediately after
its segment must be blank; all other exterior contents are arbitrary. Each head visits only its
segment and its right boundary. A block of length n takes exactly n + 1 transitions and visits
at most 3 * (n + 1) work-tape cells. These are native machine resources, independent of the total
stored data.
This is a local block primitive for buffered simulations. It does not by itself implement a buffer layout, its refill schedule, or a logarithmic-overhead universal simulator.
Main definitions #
Turing.MultiTapeTM.copyBlock: the counted copy or move machine.Turing.MultiTapeTM.CopyBlock.writeBlock: replacement of a finite interval of a tape.Turing.MultiTapeTM.CopyBlock.finish: the exact final configuration.
Main results #
Turing.MultiTapeTM.CopyBlock.runFrom_copyBlock: the exact resulting configuration.Turing.MultiTapeTM.CopyBlock.haltsAt_copyBlock: the exact number of transitions.Turing.MultiTapeTM.CopyBlock.space_copyBlock_le: the visited-cell bound.
Copy from tape 0 to tape 1 while erasing a unary counter on tape 2.
If erase is true, also erase each copied source cell. Physical blanks in the source are copied
as blanks; only the counter determines where the block ends.
Each nonblank counter cell permits one native transfer.
The exact result of transferring a counted block. Only the counter must be nonblank: the copied block may contain any mixture of symbols and physical blanks.
The first blank counter cell is the halting step, so the running time is exactly
count + 1, including when the counter is initially blank.
Every visited head position lies in the transferred interval together with its right boundary. The final halting transition visits no additional cell.
A native run path for a length-count block visits at most 3 * (count + 1) work-tape
cells, independent of the initial heads and of data outside the three touched intervals.