About this closure stuff...TopSaving Registers during Calls The Correctness of LR(0) parsing

The Correctness of LR(0) parsing

  1. The correctness of the LR(0) parsers we have discussed rests on the theorem:
    Theorem
    [ N 1 . 2 ] ( 0, ) iff [ N 1 . 2 ] is valid for .
  2. Rather than completely prove the theorem, I would like to prove it in one direction (the easy one) and let you convince yourselves of the other direction. In particular, we will prove that:

    [N -> 1 . 2 ] ( 0, ) only if [ N 1 . 2 ] is valid for .

  3. We can break the proof of this half of the theorem into two lemmas:

    Lemma 1: Given a set of LR(0) items valid for some (Vn U Vt)*, all items in closure() are valid for .

    Lemma 2: For kernel items, [N -> 1 . 2 ] ( 0, ) only if [ N 1 . 2 ] is valid for .


Computer Science 434
Department of Computer Science
Williams College

 About this closure stuff...TopSaving Registers during Calls The Correctness of LR(0) parsing