Stored registers next to a read-only input, within a fixed workspace budget #
A body of Turing.MultiTapeTM.ComputableInSpace.loopWith or
Turing.MultiTapeTM.ComputableInSpace.recWith is a function of a pair (r, a) of stored
registers and the input, encoded by encPair encR encA, within a budget that charges the
registers and not the input. The rules of this module are the leaves of such a certificate, in
the budget-preserving form of Turing.MultiTapeTM.ComputableInSpace.budget_prod, so that space
composes the rest: the registers, a function of the input alone, a certified function of other
registers, the length of the input, and the bit of the input at a computed position.
Every rule asks that the budget cover the registers and the logarithm of the length of the
input, as the hypothesis
(fun p => (encR p.1).length + Nat.log2 (encA p.2).length) ≼ Bs. For a budget that is a sum
with these two summands, space proves it.
Main results #
Turing.MultiTapeTM.ComputableInSpace.budget_registers: the stored registers.Turing.MultiTapeTM.ComputableInSpace.budget_ofInput: a function of the input alone.Turing.MultiTapeTM.ComputableInSpace.budget_subst: a certified function of other registers and the input, on registers computed from the stored ones by a logspace map.Turing.MultiTapeTM.ComputableInSpace.assoc_context: registers next to the registers of an enclosing rule.Turing.MultiTapeTM.ComputableInSpace.inputLength,Turing.MultiTapeTM.ComputableInSpace.budget_inputLength,Turing.MultiTapeTM.ComputableInSpace.budget_inputBit: the length of the input, and its bit at a computed position.
A function of the input alone next to stored registers: within a budget that covers the registers and the budget of the function.
A certified function of registers and the input, on registers that a logspace map computes from the stored ones: within a budget that covers the stored registers and the budget of the function on the new ones. The new registers are recomputed, not stored.
Registers next to the registers of an enclosing rule. A function of registers (s, r) and
the input is also a function of the registers s and the context (r, a), in which the outer
registers r and the input are read-only. This is the form in which a rule such as
Turing.MultiTapeTM.ComputableInSpace.recWith asks for a part when the rule is itself applied to
stored registers and an input.
The bit of the input at a computed position, none past its end: the position is any
function of the registers and the input within the budget; it is stored, and the input is read
there (Turing.MultiTapeTM.ComputableInSpace.bindWith,
Turing.MultiTapeTM.ComputableInSpace.inputBit).