Tidy computability within given bounds, up to constants #
ComputableTidilyInO f encIn encOut T S: f is tidily computable within time O(T a) and space
O(S a) on the input a, and its encoded value has length O(S a). Unlike
Turing.MultiTapeTM.ComputableTidilyInDegree, the bounds are any functions of the input, not of the
length of its encoding, so that they can be stated in several measures of the input, such as the
length of a description, the length of an input and a number of steps.
The closure properties are exact up to constants: composition adds the bounds of the outer function at the intermediate value, a case distinction adds the bounds of the branch taken, and a left fold adds, for every round, a bound on the round and on the state to the time, but only once to the space. The encoded value counts towards the space since a combinator keeps it on a work tape.
Main definitions #
Turing.MultiTapeTM.ComputableTidilyInO: tidy computability within given bounds.Turing.MultiTapeTM.listMax: the largest value of a function on a list, to bound rounds.
Main results #
Turing.MultiTapeTM.ComputableTidilyInO.comp,.ite,.prod: closure properties.Turing.MultiTapeTM.ComputableTidilyInO.foldl,.foldlWith: left folds with a parameter.Turing.MultiTapeTM.ComputableTidilyInDegree.inO: bounds of a given degree.
A function computable within time O(T) and space O(S) is tidily computable within them.
A function tidily computable within time O(T) and space O(S) is computable within them, by
the same machine.
Turing.MultiTapeTM.ComputableInO.of_tidy for dot notation on a tidy hypothesis.
Bounds within a constant factor.
Weakening the bounds, up to a constant factor.
Weakening the bounds.
Weakening the bounds, up to constant factors.
The encoded values are within the space bound.
The encoded values are within the time bound.
Pairing with the framed encoding of pairs.
Bounds polynomial in the length of the encoded input give polynomial time.
A function whose encoded values are those of a function computable within the bounds.
A function computed on another encoding of its input, with the same words.
A function computed within the length of its encoded value, after one computed within T and
S, is computed within T and S.
The first component of a pair computed within bounds.
The second component of a pair computed within bounds.
Bounds of degree d in the length of the encoded input.
Linear bounds in the length of the encoded input.
Left folds #
Left folds within given bounds. If every round is within the time R x and the space
Q x, and every state has length at most B x, a fold takes the time of the list and of the
initial state, plus R x, B x and the length of the encoded list for every round, and the space
of the list and of the initial state, plus Q x, B x and the length of the encoded list once.
Left folds with a parameter, within given bounds. The step may depend on a parameter
par x, which is kept in the state.