Space bounds on plain machines #
Turing.MultiTapeTM.ComputableInSpace tracks work space (with encoded output charged to the
bound) while leaving running time existentially quantified. This file provides its direct plain
combinator calculus — weakening, encoding transport, composition, pairs, concatenation,
conditionals, finite lookup, binary-counted iteration and list folds — built directly from
Turing.MultiTapeTM.ComputableInO without routing through tidy computability.
It also records the equivalence with Turing.MultiTapeTM.ComputableTidilyInSpace via
Turing.MultiTapeTM.ComputableInSpace.tidy and Turing.MultiTapeTM.ComputableInSpace.of_tidy.
Main results #
Turing.MultiTapeTM.ComputableInSpace.of_inO,.exists_inO: conversion withComputableInOretaining the realizing machine.Turing.MultiTapeTM.ComputableInSpace.comp,.prod,.append,.ite,.constZero: plain closure rules.Turing.MultiTapeTM.ComputableInSpace.iterate,.foldl,.foldlWith: plain space-bounded loops.
A function computable within space O(S) is tidily computable within it.
A function tidily computable within space O(S) is computable within it, by the same
machine.
Turing.MultiTapeTM.ComputableInSpace.of_tidy for dot notation on a tidy hypothesis.
Forget the explicit time bound of a ComputableInO certificate, retaining its machine.
Recover an existentially quantified ComputableInO certificate from ComputableInSpace,
retaining the same realizing machine.
A fixed output is computed within constant workspace, even when its input is unbounded: the
zero envelope is realized within c * (0 + 1) cells, as in ComputableInO.constZero, and weakens
to any other bound by mono_le.
Iterating a step a computed number of times, within the space of the counter, of the initial state, of a round and of the states.
Left folds, within the space of the list, of the initial state, of a round and of the states.
Left folds with a parameter, within the space of the parameter, the list, the initial state, a round and the states.