Context Free Grammars




CS154

Chris Pollett

Mar 4, 2013

Outline

Context Free Languages

Example CFG

More on CFGs

Quiz (Sec 1)

Which of the following is true?

  1. The proof presented in class that a language recognized by a DFA is generated by a right linear grammar used auxiliary states.
  2. The proof presented in class that the regular languages are closed under homomorphism involved reversing accepting and rejecting states.
  3. The proof presented in class that the regular languages are closed under quotient made use of the Cartesian product construction.

Quiz (Sec 3)

Which of the following is true?

  1. We gave in class an algorithm to check if a regular language is finite.
  2. The image of an alphabet symbol under a homomorphism is always a string of length greater than one.
  3. Right linear grammars generate more languages than left linear grammars.

Formal Definitions

Example

Techniques for Designing CFGs

Intuitions about Compilers

Ambiguity

Leftmost and Rightmost Derivations

Ambiguity and Leftmost Derivations