The cost of a step of the simulation #
States, symbols and moves are encoded in unary (Turing.MultiTapeTM.encUnary), head positions on
the work tapes as integers (Turing.MultiTapeTM.encInt), the position of the input head in binary
(Turing.MultiTapeTM.encNat), and a structure as the framed tuple of its fields.
Reading, writing and moving on a zipper are tidily computable in linear time and space. A step of
the simulation (Turing.MultiTapeTM.Universal.step_inO) takes space linear in the length L of
the encoded context (the description, the input and the configuration). Its time bound separates
the configuration length from description lookup and input scanning: for K work tapes, E
transitions, description length D, encoded input length N, input position p and binary
position length P, the bound is
(K + E + 1) * (D + 1) * (L + 1) + (N + 1) * (P + 1) ^ 2.
The first word in a transition comparison comes from the description, so its length is bounded
by D, even when the simulated configuration is large. The input scanner streams the encoded
list with a binary countdown, whose arithmetic is charged to P. The configuration is still
copied each round; this bound does not implement the buffered Hennie–Stearns simulation.
Main definitions #
Turing.MultiTapeTM.Universal.eDesc,.eCfg: the encodings of descriptions and configurations.Turing.MultiTapeTM.Universal.stepTime: the time bound of a step.
Main results #
Turing.MultiTapeTM.Universal.step_inO: a step is tidily computable within the timestepTimeand linear space.
Encodings #
An action on a work tape.
Instances For
The state of a configuration, in linear time.
Reading, writing and moving on a work tape, in linear time #
Applying actions to all work tapes #
Sizes #
All work tapes #
Applying actions to the work tapes, within time the number of work tapes times the length of the arguments, and linear space.
The symbols under the heads of the work tapes, within time the number of work tapes times their length, and linear space.
The input head #
Moving the input head, charging binary arithmetic only to the encoded position length.
A step without the input #
The context of a step without the input: the description, the configuration and the symbol under the input head.
Instances For
The key of the transition to take.
Instances For
The default transition, never taken.
Instances For
The action of the transition to take.
Instances For
A step without input lookup: tape passes and description comparisons are linear in context length; only binary input-head arithmetic is quadratic in its own encoded length.
Instances For
A step #
The context of a step: the description, the input and the configuration.
Instances For
The step bound separates linear configuration passes from a streaming input lookup with binary countdown arithmetic. In particular, the whole configuration length is never squared.
Instances For
One step of the simulation, on contexts, within the time stepTime and linear space: the
symbol under the input head, and the step without the input.