Polynomial-time string reversal — proof internals #
The transducer reverseTM has one work tape and four control states: it copies
the input onto the work tape left to right, then walks the work head back to the
left-end marker, emitting each cell to the output as it passes. The result is the
input read backwards, in 2 · |x| + 3 steps.
Reversal is what turns a right-to-left recursion into a left-to-right loop: recursion on notation peels the head of a string, so an iterative evaluation consumes the last bit first.
Main results #
Complexity.reverse_mem_FP— reversal is inFP
@[implicit_reducible]
@[implicit_reducible]
Equations
The reversal transducer. Copies the input onto its work tape, then
sweeps the work head back to the left-end marker, writing each cell it passes to
the output tape. Computes List.reverse.
Equations
- One or more equations did not get rendered due to their size.
Instances For
reverseTM computes List.reverse in 2 · |x| + 3 steps.