Left folds with bounds of given degrees #
Turing.MultiTapeTM.ComputableTidilyInTimeAndSpace.foldl asks for bounds on the arguments of the
step function and on the intermediate states paired with the rest of the list. For list encodings
whose elements, suffixes and lengths are bounded by the encoded list (SizedListEncoding), and the
framed encodings of pairs and options, only a bound on the intermediate states is left.
A fold whose step also needs a fixed parameter, such as a key to look up, keeps the parameter in its
state (Turing.MultiTapeTM.ComputableTidilyInDegree.foldlWith).
Main definitions #
Turing.MultiTapeTM.SizedListEncoding: list encodings that bound their elements, suffixes and lengths.
Main results #
Turing.MultiTapeTM.ComputableTidilyInDegree.foldl': left folds, with the degree of a round plus the degree of the number of rounds.Turing.MultiTapeTM.ComputableTidilyInDegree.foldlWith: the same, with a parameter.
Left folds with bounds of given degrees. If the list has output degree eL, the states have
length of degree b, and a round has degree dS, a fold takes time of degree
eL + max 1 dS * max b eL: at most O(n ^ eL) rounds, on arguments of length O(n ^ max b eL).
Left folds with a parameter, with bounds of given degrees. The step may depend on a
parameter par x, which is kept in the state.