Restorable parking for copy-on-write overlays #
An overlay may leave the protected base block at the parking ticket of the current
productive window. This is the one situation in which the ordinary strict
IndexTicketLedger.ParkingBelow invariant is deliberately weakened to
ParkingAtOrBelow.
OverlayParking records the exact extra information needed to undo that weakening: either
the strict bound already holds, or a specified live base owner carries the unique ticket at
the current base. Reticketing that owner to a nonparking ticket then restores the strict
bound. The development here is ghost-only and independent of the physical overlay layout.
The parking invariant carried by overlay mode.
All live parking slots are at or below the current window base. If the strict bound does not
already hold, baseOwner is live and identifies the owner of the canonical parking ticket at
that base. Duplicate-freedom of the ticket ledger makes this owner unique.
- atOrBelow : ledger.ParkingAtOrBelow window
- strict_or_parked : ledger.ParkingBelow window ∨ baseOwner ∈ cursor.indexOwners ∧ ledger.ticketOf baseOwner = window.parkingTicket
Instances For
Swapping two nonparking tickets preserves a restorable parking marker. In the parked branch the canonical parking ticket is fixed by the swap; in the strict branch this is the ordinary strict parking preservation theorem.
A strict parking bound is already a restorable overlay parking invariant.
A live owner carrying the current canonical parking ticket supplies the parked branch of the invariant, provided the non-strict global parking bound is known.
In the parked branch, the designated base owner is the unique live owner carrying the current window parking ticket.
Transporting the cursor through a physical-owner permutation preserves restorable overlay parking.
Transporting the physical cursor while weakly increasing the productive-window base preserves restorable overlay parking. A strict base increase absorbs a parked current-base ticket into the ordinary strict bound; under equal bases the parked witness is unchanged.
Replacing one live ticket by a nonparking ticket, while leaving every other live ticket unchanged, preserves the non-strict parking bound.
Replacing one live ticket by a nonparking ticket, while leaving every other
live ticket unchanged, preserves a strict parking bound. This abstract form is
useful for ticket normalizations whose implementation is not literally
IndexTicketLedger.reticket.
Replacing one live ticket by a nonparking ticket, while leaving every other live ticket unchanged, preserves restorable overlay parking. If the changed owner was the parked base owner, the resulting invariant is strict; otherwise the parked witness remains unchanged.
Allocating a fresh owner at a nonparking ticket preserves restorable overlay parking. The designated parked owner, when present, was already live and hence is not the allocated owner.
Abstract restoration lemma. Suppose a parked base owner is reticketed to a
nonparking target and every other live ticket is unchanged. Once the updated ledger still
satisfies ParkingAtOrBelow, its bound is automatically strict.
This formulation deliberately does not depend on the implementation of reticket; it is the
generic fact needed by any later overlay ticket surgery.
Reticketing the designated base owner to a fresh nonparking target restores the strict
parking bound. IndexTicketLedger.reticket supplies the required unchanged-tail property.
Reticketing any live owner to a fresh nonparking target preserves the restorable invariant. When the selected owner is the parked base owner, the result takes the strict branch; otherwise the parked witness is unchanged.
Releasing an owner other than the designated base owner preserves restorable overlay parking. This is the operation used when an unrelated private overlay head is erased.
Releasing the designated parked owner itself restores the strict parking bound. The released ticket is absent from the tail by duplicate-freedom, so no remaining owner can carry the current canonical parking ticket.
Releasing an arbitrary overlay owner preserves restorable parking. If it is the designated parked owner, the result moves to the strict branch; otherwise the witness remains live.