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 unary integers (Turing.MultiTapeTM.encIntUnary), 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 computable in linear time and space
(Turing.MultiTapeTM.ComputableInDegree with degrees one). 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, declared withenc_structure, which also supplies theirfun_proprules.Turing.MultiTapeTM.Universal.Ctx,.WCtx: the contexts of a step, with and without the input, and their named parts (Ctx.desc,Ctx.input,Ctx.cfg,WCtx.desc,WCtx.cfg,WCtx.sym).Turing.MultiTapeTM.Universal.stepTime: the time bound of a step.
Main results #
Turing.MultiTapeTM.Universal.step_inO: a step is computable (Turing.MultiTapeTM.ComputableInO) within the timestepTimeand linear space.Turing.MultiTapeTM.Universal.stepWith_inO,.applyTapes_inO,.reads_inO,.moveInput_inO: its parts.
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 #
The symbol under the head.
A right move.
A left move.
Applying actions to all work tapes #
Applying no actions leaves the work tapes unchanged.
Sizes #
An integer's unary encoding is nonempty. Its natural home is the Primitives module, next to
length_encIntUnary; it is stated here, in that namespace, because Primitives has about 2,400
transitive importers against about 500 here.
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 description of a context without the input.
Instances For
The configuration of a context without the input.
Instances For
The symbol under the input head, in a context without the input.
Instances For
The context of a step: the description, the input and the configuration.
Instances For
The description of a context.
Instances For
The input of a context.
Instances For
The configuration of a context.
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
Rules for fun_prop #
One step of the simulation without the input, within the time wTime and linear space. The
machine is assembled from the definition of stepWith, and its bounds are checked once.
A step #
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.