Internal description dispatch for Rice's self-reference construction #
This is the existing dispatch program and its native run proof, moved unchanged from
Halting.Rice. It buffers the output of a normalized total machine, branches on its first bit,
and runs the selected description on the remaining word. The clean input/work-tape premise is
essential: Universal.Desc.computes_dispatch retains it explicitly. The public Rice facade imports
this module only for its proof; ordinary clients need no machine normal-form contract.
Finding transitions #
Dispatching on a computed bit #
The action on the virtual input tape writing there the symbol o emitted by a transition.
The states of the description d b in Turing.MultiTapeTM.Universal.dispatch.
The number of work tapes of the two descriptions.
The transitions of tm, in the states 4 * q + 1, writing its output on the virtual input
tape, and moving to the state 4 when tm halts.
Dispatching on a computed bit. The description runs the machine tm, buffering its output
on a new first work tape, the virtual input tape; when tm halts with output b :: v and blank
work tapes, as after a tidy computation, it runs the description d b on v, reading it from the
virtual input tape (Turing.MultiTapeTM.Universal.Desc.computes_dispatch).
Each transition writing the marker, rewinding or branching is the one found for its key.
For the states of tm, the transitions found are those of tm, writing the output on the
virtual input tape.
For the states of d b and an input head reading a blank, the transitions found are those of
d b, redirected.
Running tm #
A step of tm is a step of dispatch eS tm d, which emits nothing.
While the description of tm runs, dispatch eS tm d runs it after writing the marker.
The run of tm on w, from a tidy computation: the description of tm runs, with a
transition for every key it meets, until it halts with the input head on the first symbol, blank
work tapes and the output b :: v.
Dispatching on a computed bit: if tm computes b :: v from w tidily, then
dispatch eS tm d halts on w with output o exactly when d b halts on v with output o.