The stack-loop machine: tape layout and phases #
The machine of Turing.MultiTapeTM.ComputableInO.stackLoop has the kk work tapes shared by the
machines it runs, followed by six named tapes: a flag tape for Turing.MultiTapeTM.onWords, the
current value C, the halting flag F, the round input or output R, the pushed frames P and
the stack S. The stack is kept as the framed words of its frames, top first, ending just before
cell 0 of S, so that pushing writes to the left and popping erases from the left.
This file describes the configurations of the machine (StackLoopKernel.cfgS), the runs of its
phases between them, one round, and the whole run.
Main definitions #
Turing.MultiTapeTM.StackLoopKernel.cfgS: the configurations of the machine.Turing.MultiTapeTM.StackLoopKernel.body: one round.Turing.MultiTapeTM.StackLoopKernel.stackLoopTM: the machine.Turing.MultiTapeTM.StackLoopKernel.roundTime,Turing.MultiTapeTM.StackLoopKernel.roundSpace: bounds on one round.
Main results #
Turing.MultiTapeTM.StackLoopKernel.transformsTapes_onWords_embed:onWordson embedded tapes, with every other tape arbitrary.Turing.MultiTapeTM.StackLoopKernel.runs_stackLoop: the run of the machine on a stack loop that halts with an empty stack.
Tape layout #
Embeddings of the phases #
The tapes of Turing.MultiTapeTM.onWords with kk work tapes: the shared tapes, the output
tape nm o, the input tape nm v and the flag tape nm 0.
Instances For
The tapes of Turing.MultiTapeTM.outputToWord with kk work tapes: the shared tapes and the
current value.
Instances For
The tapes of Turing.MultiTapeTM.copyWord: from the round word to the current value.
Instances For
The tapes of Turing.MultiTapeTM.emitWord: the current value.
Instances For
Specifications on embedded tapes #
onWords on embedded tapes, with every other tape arbitrary: the input on the tape
selected for the input of onWords, its other tapes blank.
Runs of the phases #
The machine clearing the named tape j.
Instances For
Copying the round word to the blank current-value tape.
Instances For
Emitting the current value.
Instances For
Running a machine with kk work tapes on words, from the named tape v to the named tape
o.
Instances For
The initialization: the machine reads the input and writes its output to the current-value tape.
Instances For
Native phases #
Popping the stack to the round word.
Instances For
Moving the round word to the front of the current value.
Instances For
Moving the pushed frames to the front of the stack.
Instances For
Erasing the popped frame at the front of the current value.
Instances For
Moving the head of the pushed frames to their end.
Instances For
One round #
The halting test, from the current value to the halting flag.
Instances For
The pushed frames of a round, from the current value.
Instances For
The next value of a round, from the current value to the round word.
Instances For
One round: clear the halting flag, pop the stack to the front of the current value, compute the pushed frames and the next value, drop the popped frame, make the next value current, push the frames and test the next value.
Instances For
The loop over a stack #
The stack-loop machine: initialize the current value, test it, repeat rounds while the test fails, then emit the current value and clear the tapes.
Instances For
The run of the stack-loop machine. If s is the run of a stack loop from an initial
value computed from the input with an empty stack, which halts after n rounds with an empty
stack, then the machine computes the halting value, within the costs of the initialization, of
the halting tests and of the rounds.