COMS W3261
Computer Science Theory
Lecture 11: October 10, 2012
Decision and Closure Properties of CFL's

Outline

1. Cocke-Younger-Kasami Algorithm for Testing Membership in a CFL

2. Testing Emptiness of a CFG

3. Closure Properties of CFL's

4. Nonclosure Properties of CFL's

5. Undecidable CFL Problems

6. Practice Problems

  1. Let G be the following grammar:
  2. 
    S → AB | BC
    A → BA | a
    B → CC | b
    C → AB | a
    
    Use the CYK algorithm to determine whether aabab is in L(G).
  3. Modify the CYK algorithm to report the number of distinct parse trees there are for a given string w in a CNF grammar G.
  4. Let min(L) = { w | w is in L but no proper prefix of w is in L }. Are the CFL's closed under the min operation?
  5. Let max(L) = { w | w is in L but for no string x other than ε is wx is in L }. Are the CFL's closed under the max operation?
  6. Let init(L) = { w | wx is in L for some string x (possibly the empty string) }. Are the CFL's closed under the init operation?
  7. Let cycle(L) = { w | we can write w as xy where yx is in L }. Are the CFL's closed under the cycle operation?
  8. Let half(L) = { w | there exists a string x such that |w| = |x| and wx is in L }. Are the CFL's closed under the half operation?

7. Reading Assignment



aho@cs.columbia.edu