Langlib

Langlib.Grammars.LR.Equivalence.DPDAToLR.Construction

The characteristic grammar of a deterministic pushdown automaton #

This file fixes the construction used in the DPDA-to-LR(1) direction.

First, DPDA.firstFinal marks an epsilon phase after it has left a final state. The standard final-state-to-empty-stack conversion is then applied, followed by the standard PDA characteristic grammar. Finally, rules which are not fully productive are removed. Removing those rules is essential for the LR argument: the target states guessed by the characteristic grammar must actually be realizable by a computation.

noncomputable def DPDA_to_LR.emptyStackPDA {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] (M : DPDA Q T S) :
PDA (Q × Bool Fin 2) T (Option S)

The normalized PDA accepting by empty stack.

Equations
Instances For
    noncomputable def DPDA_to_LR.mathlibCharacteristicGrammar {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] (M : DPDA Q T S) :

    Mathlib's characteristic grammar for the normalized empty-stack PDA.

    Equations
    Instances For
      noncomputable def DPDA_to_LR.rawCharacteristicGrammar {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] (M : DPDA Q T S) :

      The same characteristic grammar in Langlib's CF_grammar representation.

      Equations
      Instances For
        noncomputable def DPDA_to_LR.characteristicGrammar {Q T S : Type} [Fintype Q] [Fintype T] [Fintype S] (M : DPDA Q T S) :

        The reduced characteristic grammar used for the LR(1) proof.

        Equations
        Instances For

          The complete language-equality chain for the characteristic grammar.