Class9

1,468 views

Published on

0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,468
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
0
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide
  • Fall 2007
  • Fall 2007 This language is not context free (ref. Ex.8.8 p.217), but its complement is CF.
  • Class9

    1. 1. Two Non Context-Free Languages (We will prove them later if we have time)
    2. 2. Regular languages Context-free languages Non Context-free languages
    3. 3. Positive Properties of Context-Free languages
    4. 4. Context-free languages are closed under: Union is context free is context free is context-free Union
    5. 5. Example Union Language Grammar
    6. 6. In general: The grammar of the union has new start variable and additional production For context-free languages with context-free grammars and start variables
    7. 7. Context-free languages are closed under: Concatenation is context free is context free is context-free Concatenation
    8. 8. In general: The grammar of the concatenation has new start variable and additional production For context-free languages with context-free grammars and start variables
    9. 9. Example Concatenation Language Grammar
    10. 10. Context-free languages are closed under: Star-operation is context free is context-free Star Operation
    11. 11. In general: The grammar of the star operation has new start variable and additional production For context-free language with context-free grammar and start variable
    12. 12. Example Language Grammar Star Operation
    13. 13. Context-free languages are closed under: reversal is context free is context-free Reversal
    14. 14. In general: The grammar of the reversal operation has production For context-free language with context-free grammar and every production
    15. 15. Example Language Grammar Reversal Operation
    16. 16. Negative Properties of Context-Free Languages
    17. 17. Context-free languages are not closed under: intersection is context free is context free not necessarily context-free Intersection
    18. 18. Example Context-free: Context-free: NOT context-free Intersection
    19. 19. Context-free languages are not closed under: complement is context free not necessarily context-free Complement
    20. 20. NOT context-free Example Context-free: Context-free: Complement
    21. 21. Is the complement of context free? Hw #1 p.219 For n a ( w ) > n b ( w ) : | cS 1 | S 1 c | cE | Ec This language is not context free (ref. Ex.8.8 p.217), but its complement is CF.
    22. 22. Intersection of Context-free languages and Regular Languages
    23. 23. The intersection of a context-free language and a regular language is a context-free language context free regular context-free
    24. 24. for for NPDA DFA Construct a new NPDA machine that accepts Machine Machine context-free regular simulates in parallel and i.e. whenever a symbol is read from input, M simultaneously executes the moves of M 1 and M 2
    25. 25. transition transition NPDA DFA transition NPDA
    26. 26. initial state initial state NPDA DFA Initial state NPDA
    27. 27. final state final states NPDA DFA final states NPDA
    28. 28. simulates in parallel and accepts string if and only if accepts string and accepts string
    29. 29. Therefore: (since is NPDA) is context-free is context-free
    30. 30. Applications of Regular Closure HW # 1, 7, 12, 17, 18, 21 ( 8.2 p.220)
    31. 31. The intersection of a context-free language and a regular language is a context-free language context free regular context-free Regular Closure
    32. 32. An Application of Regular Closure Prove that: is context-free
    33. 33. We know: is context-free
    34. 34. is regular is regular We also know:
    35. 35. regular context-free is context-free is context-free (regular closure)
    36. 36. Another Application of Regular Closure Prove that: is not context-free
    37. 37. context-free regular context-free If is context-free Then Impossible!!! (regular closure) Therefore, is not context free
    38. 38. Consider set difference: L 1 - L 2 Is it closed for context free languages? It is context free if L 2 is regular.

    ×