Windowed simulation #
In n steps, a head reads only cells within distance n of where it started. The windowed
simulation exploits this to simulate n steps on windows: for every tape, the zipper of the
cells within distance n of its head. It cuts the windows of radius ⌈n / 2⌉ around the heads,
simulates the first ⌈n / 2⌉ steps on them recursively, pastes the result back, and does the same
for the remaining ⌊n / 2⌋ steps. A single step is Turing.MultiTapeTM.Universal.stepWith.
Cutting and pasting take time linear in the enclosing window, so n steps take time
O(n log n) for a fixed machine; that cost analysis is
Turing.MultiTapeTM.Universal.computableInO_universal_nlogn, in a separate module. This module
defines the simulation and proves that it computes the universal function.
A windowed configuration (Turing.MultiTapeTM.Universal.Windowed.Win) holds the state, then the
input window followed by the work windows. The head fields of the window zippers are not used.
Input cells are coded so that a step can be taken without the position of the input head:
some 0 is the left end at position 0, some (a + 1) the input symbol a, and none a blank
after the input.
The correctness proof follows each window against its tape cell by cell: if every window agrees
with its tape within distance n of the head, then n windowed steps take the same steps, the
windows keep agreeing with the tapes there, and the cells beyond are untouched. Pasting a window
back is exact because a list of a cut window either has exactly the cut length, in which case the
run keeps it aligned with the rest of the outer list, or ends early, in which case the outer list
has no cells beyond it either.
Main definitions #
Turing.MultiTapeTM.Universal.Windowed.extract,.restore: cutting windows and pasting them back.Turing.MultiTapeTM.Universal.Windowed.wstep: one step on windows.Turing.MultiTapeTM.Universal.Windowed.sim: the recursive simulation ofnsteps.Turing.MultiTapeTM.Universal.Windowed.initWin: the windows of the initial configuration.
Main results #
Turing.MultiTapeTM.Universal.Windowed.universal_eq_sim: the windowed simulation oftsteps from the radius-twindows of the initial configuration computes the universal function.Turing.MultiTapeTM.Universal.Windowed.length_sim,.length_sim_le,.sim_cells,.sim_state,.sim_output: the number and lengths of the windows, their cells, the state and the emitted symbols, for the cost analysis.
A windowed configuration: the state, then the input window followed by the work windows.
Instances For
The cells of t within distance r of its head, as a zipper with head field 0.
Instances For
The window inner, cut from outer with radius r and then run, with the cells of outer
beyond distance r of its head put back around it.
Instances For
The windows of radius r.
Instances For
The windows inner, extracted from outer with radius r and then run, pasted back.
Instances For
A stand-in for the position of the input head on a coded input cell: 0 at the left end and
1 elsewhere. Turing.MultiTapeTM.Universal.moveInput distinguishes only these cases.
Instances For
The input window, moved as the input head moved from p to p'.
Instances For
The number of steps of the first half of a block of n steps.
Instances For
Cells of zippers #
Steps on windows #
Windows agreeing with tapes #
Correctness of the windowed simulation #
The windowed simulation of n + 2 steps: the first half on cut windows, pasted back, then the
second half.
The windowed simulation computes the universal function: started from the radius-t
windows of the initial configuration, t windowed steps give the output and the halting status
after t steps.
Sizes of the windows #
Facts about the shapes of the windows, the cells they hold, the state and the emitted symbols, for the cost analysis of the windowed simulation.
In n windowed steps, each window grows by at most n cells on each side, where the right
list, which holds the cell under the head, counts as at least one cell.
The cells of the windows after the windowed simulation come from the windows before it or are written by a transition: a property of cells that holds for the blank, for every symbol written by a transition and for all cells of the windows before, holds for all cells after.
The state after the windowed simulation is the state before it, the halting state, or the next state of a transition.