Langlib

Langlib.Grammars.Indexed.NormalForm.Aho.Soundness.Denotation.Control

Whole-tape denotation for Aho's close-crossing control stack #

Stack visibility and execution order are deliberately separated. PhysicalRep scans the whole physical tape right-to-left, ignoring control delimiters. Exec follows active symbols and the $/¢ return discipline to emit the remaining sentential form in execution order. This handles later pops whose index-free scan crosses one or more ¢ markers.

Mark-insensitive alignment #

Equations
  • One or more equations did not get rendered due to their size.
Instances For

    Ghost work symbols. An index remembers its denoted concrete block and only its first/later class; the operational pending/used bit has no semantic content.

    Instances For
      Instances For
        Equations
        Instances For
          Equations
          • One or more equations did not get rendered due to their size.
          Instances For

            Physical stack assignment #

            Instances For
              theorem IndexedGrammar.Aho.ControlDenotation.physicalRep_append_iff {T : Type} {g : IndexedGrammar T} [Fintype g.nt] (xs ys : List (AnnSym g)) {inherited before : BlockDenotation.VisibleStack g} :
              PhysicalRep g inherited (xs ++ ys) before ∃ (middle : BlockDenotation.VisibleStack g), PhysicalRep g inherited ys middle PhysicalRep g middle xs before
              Equations
              • One or more equations did not get rendered due to their size.
              Instances For
                theorem IndexedGrammar.Aho.ControlDenotation.PhysicalRep.stack_eq_of_indexFree {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {inherited before : BlockDenotation.VisibleStack g} {xs : List (AnnSym g)} (hfree : AnnIndexFree xs) (h : PhysicalRep g inherited xs before) :
                before = inherited

                Shrinking execution-order interpreter #

                Traverse active symbols in machine order. Every recursive cursor is shorter: an ordinary or index step deletes its focus, and a return step deletes one $/¢ pair.

                Instances For

                  Active-right stack semantics #

                  Only symbols to the right of the active focus index that occurrence. A close does not stop the scan: this is exactly how a later pop reaches a lower block across completed inner frames. When a frame returns, ExecRep.returnFrame reactivates its saved left material and the right stack is recomputed in that new cursor, preventing an inner consumed block from leaking across older $ scopes.

                  Instances For

                    A right-stack prefix transformer, used to split at a selected compressed token without inventing annotations for ordinary symbols.

                    Instances For
                      theorem IndexedGrammar.Aho.ControlDenotation.rightRep_append {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {xs ys : List (WorkSym g)} {stack : BlockDenotation.VisibleStack g} (h : RightRep g (xs ++ ys) stack) :
                      ∃ (middle : BlockDenotation.VisibleStack g), RightRep g ys middle RightPrefix g xs stack middle
                      theorem IndexedGrammar.Aho.ControlDenotation.RightPrefix.stack_eq_of_indexFree {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {xs : List (WorkSym g)} {before after : BlockDenotation.VisibleStack g} (hfree : IndexFree xs) (h : RightPrefix g xs before after) :
                      before = after
                      theorem IndexedGrammar.Aho.ControlDenotation.RightPrefix.toRightRep {T : Type} {g : IndexedGrammar T} [Fintype g.nt] {xs ys : List (WorkSym g)} {before after : BlockDenotation.VisibleStack g} (hp : RightPrefix g xs before after) (hr : RightRep g ys after) :
                      RightRep g (xs ++ ys) before

                      Execution traversal coupled to the concrete stack visible from every active focus.

                      Instances For

                        Boundary configurations #