COMS W3261 CS Theory
Lecture 8: Pushdown Automata

1. Examples of Context-Free Grammars

  1. Even-length palindromes: S → aSa | bSb | ε
  2. Odd-length palindromes: S → aSa | bSb | a | b
  3. Palindromes with a center marker: S → aSa | bSb | c
  4. Prefix notation: E → + E E | * E E | a
  5. Postfix notation: E → E E + | E E * | a
  6. Balanced parentheses: S → ( S ) S | ε
  7. Arithmetic expressions over ids and nums (ambiguous):
  8. Arithmetic expressions over ids and nums (unambiguous):
  9. Regular expressions over {a, b} (ambiguous):
  10. If-then, if-then-else statements (ambiguous):

2. Pushdown Automata

3. Instantaneous Descriptions of PDAs

4. The Language of a PDA

5. Deterministic Pushdown Automata

6. Practice Problems

  1. Construct a PDA that accepts { wcwR | w is any string of a's and b's } by final state.
  2. Construct a PDA that accepts { wcwR | w is any string of a's and b's } by empty stack.
  3. Construct a DPDA that accepts { wcwR | w is any string of a's and b's } by final state.
  4. Construct a PDA that accepts { wwR | w is any string of a's and b's } by final state.
  5. Construct a PDA that accepts { wwR | w is any string of a's and b's } by empty stack.
  6. Construct a PDA P such that N(P) = L(G) where G is S → (S)S | ε.
  7. Prove that a DPDA can recognize any regular language.

7. Reading


aho@cs.columbia.edu
verma@cs.columbia.edu