Timeline editing by reset and replay #
This is the elementary rebuilding transformation motivated by retroactive data structures Demaine, Iacono, and Langerman. A timeline edit is followed by an explicit reset and replay of the edited history. It is not an efficient rollback algorithm or a historical-query interface. Editing an admissible timeline can make later operations invalid, so admissibility checks the entire edited history.
Main definitions #
TimelineEdit: insertion and deletion by position.Retroactive.spec: the abstract timeline-editing specification.Retroactive.backend: an interface exposing edit, reset, and ordinary operations.Retroactive.implementation: the reusable rebuilding module.
Main results #
Retroactive.replay_run: replay has exactly the ordinary history's state and operations.Retroactive.operation_charge: costs include editing, reset, and the entire replay.Retroactive.realized_bound: the same bound transports to every backend realization.Retroactive.realized_linear_bound: an ordinary-operation bound gives linear replay overhead.
The edit primitive includes storing the timeline and exposing the edited list to its caller.
A backend must certify this primitive's resource weight; list copying is not assumed constant
time. Like all Spec.Client results, the resource claims count explicit backend operations and
leave pure Lean controller computation uncharged. There is no fixed Word-RAM compiler here.
References #
An edit position names a gap for insertion and an existing entry for deletion.
- insert {Op : Type} (position : ℕ) (operation : Op) : TimelineEdit Op
- erase {Op : Type} (position : ℕ) : TimelineEdit Op
Instances For
Edit the operation sequence. Valid excludes out-of-range positions.
Instances For
Insertion allows the final gap; deletion requires an existing entry.
Instances For
A dynamic specification of admissible timeline edits.
Instances For
The rebuilding backend tracks the stored timeline and current ordinary state separately.
Instances For
Replay ordinary operations through explicitly charged backend calls.
Instances For
Editing, reset, and replay are distinct calls in the interface client.
Instances For
Replay preserves the stored timeline and has precisely the original operation trace.
Every admissible ordinary history is admissible when executed through the backend.
Rebuilding correctness is independent of the implementation of reset, edit, and execution.
Instances For
Separate charges for timeline editing, resetting, and ordinary operations.
Instances For
Charges for replay are exactly the charges for the ordinary history.
The full operation charge retains both editing and resetting overhead.
Resource bounds transport to any realization of the backend interface.
This certificate then composes across arbitrary admissible timeline edits via Bound.client.
A uniform ordinary-operation bound gives linear replay overhead. Editing and resetting remain explicit, and the resulting certificate applies to every concrete operation execution.