Direct charged folds with full reachable-prefix bounds #
The original independent time/workspace formulas are retained. Each plain input certificate supplies its own normalized machine within the internal construction; no higher tidy O calculus is imported or used. The state invariant applies only to actual reachable prefixes.
Main results #
ComputableInO.foldl: independent callback time/workspace bounds and a full prefix invariant.ComputableInO.foldlWith: the same with an encoded runtime parameter retained in state.
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.