Langlib

Langlib.Grammars.LR.Equivalence.CanonicalSoundness

Soundness of the canonical LR parser #

Every bottom-up parser step reverses either no grammar step (a shift) or one rightmost grammar step (a reduction). Consequently an accepting canonical run reconstructs a derivation of its input word.

A trusted canonical parser step reads the sentential forms backwards.

Along a canonical run, the current sentential form rightmost-derives the sentential form at the beginning of the run.

theorem CF_grammar.LRk.CanonicalParser.accepts_sound {T : Type} [Fintype T] (G : CF_grammar T) (k : ) {w : List T} (h : Accepts G k w) :

Every word accepted by the canonical table belongs to the source context-free language.