Langlib

Langlib.Grammars.Indexed.NormalForm.Aho.Scheduler.Runners.Overlay.Interface

Restorable parking for copy-on-write overlay execution #

This module states the runner interface used to preserve branch-local compressed accumulators. It intentionally contains no constructor dispatch.

The nonempty adjacent list head :: overlayTail is private to the active branch. word begins the sibling-shared protected suffix. A successful run erases every private overlay token and leaves the protected suffix in its existing used form.

structure IndexedGrammar.Aho.OverlayRestoreData {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {pre : List T} {cursor : ScheduleCursor g input} (resources : ScheduleRunResources parse pre cursor) (overlay : List (ScheduleIndex g input)) (baseBlocks : List (List g.flag)) (baseOwners : List (Fin (10 * input.length))) :

Restoration data carried only while a copy-on-write overlay is active.

restore is the nonparking ticket displaced when the protected base head was parked. It is reserved either by remaining absent from the live ticket image or by being carried by a private overlay index. Its semantic owner is tracked at a depth inside (or exactly at the lower boundary of) the private overlay prefix. This is the information needed to make it a valid residual depth-zero base ticket when the last private block is erased.

Instances For
    inductive IndexedGrammar.Aho.OverlayParkingContext {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {input : List T} {A : g.nt} {stack : List g.flag} {w : List T} {parse : g.NFParse A stack w} {pre : List T} {cursor : ScheduleCursor g input} (resources : ScheduleRunResources parse pre cursor) (overlay : List (ScheduleIndex g input)) (baseBlocks : List (List g.flag)) (baseOwners : List (Fin (10 * input.length))) :

    Parking state for an active overlay. Strict mode needs no restoration metadata. Attached mode records exactly how to restore the parked protected base before leaving overlay mode.

    Instances For
      def IndexedGrammar.Aho.OverlayScheduleRun {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {A : g.nt} {stack : List g.flag} {w : List T} (parse : g.NFParse A stack w) :

      Resource-aware copy-on-write overlay execution.

      The structural recursion intended for this interface is:

      • livePushCompress replaces head through AdjacentOverlayLayout.replaceHead;
      • livePushFresh conses a new private head through AdjacentOverlayLayout.push;
      • adjacent atomic pop erases head and resumes at overlayTail via AdjacentOverlayLayout.tail;
      • a binary fork seals the whole overlay with AdjacentOverlayLayout.toProtected, after which the already-certified protected runner may share it between both children.
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        def IndexedGrammar.Aho.CompleteScheduleRuns {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {A : g.nt} {stack : List g.flag} {w : List T} (parse : g.NFParse A stack w) :

        The sound mutual scheduler target. Ordinary and copy-on-write overlay execution are proved together by strong recursion on parse size.

        Equations
        Instances For