Langlib

Langlib.Grammars.LR.Equivalence.DPDAToLR.Focus

Computation zipper for characteristic rightmost derivations #

An occurrence in a right-sentential form has two pieces of operational meaning. A terminal completion of the symbols to its left drives the empty-stack PDA from its initial configuration to the configuration encoded by the occurrence. A terminal completion of the symbols to its right drives the saved stack context from the occurrence's target state to empty stack. This is the formal partial-tree invariant used in Knuth's DPDA-to-LR proof.

inductive DPDA_to_LR.Focused {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] (M : DPDA Q T S) :
Nonterminal MList TList TProp

Operational meaning of a focused characteristic nonterminal.

Instances For
    theorem DPDA_to_LR.focused_of_derivation {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] (M : DPDA Q T S) {form p right : List (symbol T (Nonterminal M))} {A : Nonterminal M} {preWord postWord : List T} (hroot : (characteristicGrammar M).DerivesRightmost [symbol.nonterminal (characteristicGrammar M).initial] form) (hshape : form = p ++ [symbol.nonterminal A] ++ right) (hp : (characteristicGrammar M).DerivesRightmost p (List.map symbol.terminal preWord)) (hright : (characteristicGrammar M).DerivesRightmost right (List.map symbol.terminal postWord)) :
    Focused M A preWord postWord

    The computation-zipper invariant for an arbitrary focused occurrence. The strings on both sides may be scheduled to terminals independently; their terminal yields are exactly the input consumed before the focus and the input handled by its saved continuation.

    Prehandle-specialized form of the computation zipper.