State-returning calls between query machines #
QueryMachine.withCalls suspends a caller while a callee runs on the same original input.
A request supplies the callee's initial state, and returning supplies its final state to the
caller. Callee emissions are discarded: this construction does not store or return an output
word. In particular, any data retained across a call is part of the explicit machine state.
Main definitions #
Turing.QueryMachine.withCalls: state-returning calls on the original input.
Main results #
Turing.QueryMachine.withCalls_runFrom_subroutine_prefix: exact simulation before return.Turing.QueryMachine.withCalls_runFrom_call: a call takes the callee's running time plus one entry step and one return step.
Suspend the caller on a request and resume it with the callee's final state. Both machines read the same original input. Only ordinary caller steps emit output; call entry, callee steps, and return emit nothing. The suspended caller and callee states are stored explicitly.
Without a request, a composite step is precisely a caller step, including halted states.
Entering a call takes one step and preserves the suspended caller state.
A live callee step reads exactly the bit that the callee reads on the original input.
Returning from a halted callee takes one additional step.
Up to its first halt, the callee is simulated step for step.
A callee that first halts at T returns its final state at time T + 1.
Entry and return add two steps to the running time of a state-returning call.