Initialized iteration with a preserved input #
initializedStep init step keeps its state in the first component of pair
and its unchanged input in the second. An empty state is the initialization
sentinel: the first call on pair [] x installs init x, and later calls apply
step x while the state is nonempty. The step may depend on the original input.
initializedStep_iterate identifies the packed orbit with the ordinary orbit
of step x, with one extra call for initialization. Its nonemptiness hypothesis
covers exactly the states on which a step is taken; the final state may be empty.
Without that hypothesis an empty intermediate state would initialize again.
The controller uses the total projections pairFst and pairSnd on arbitrary
strings; no validity of malformed pair encodings is assumed. Its polynomial-time
closure theorem and orbit equation are shared by Savitch's and IP's space-bounded
iterations, independently of their state encodings and invariants.
A polynomial-time initializer and step give a polynomial-time packed controller. The step receives the unchanged input and current state through the pair projections.