Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter 8. PROPERTIES OF CONTEXT-FREE LANGUAGES Exercises

Similar presentations


Presentation on theme: "Chapter 8. PROPERTIES OF CONTEXT-FREE LANGUAGES Exercises"— Presentation transcript:

1 Chapter 8. PROPERTIES OF CONTEXT-FREE LANGUAGES Exercises
DS020 오토마타형식언어 Chapter 8. PROPERTIES OF CONTEXT-FREE LANGUAGES Exercises September 25, 2003

2 7. Show that the following languages on are not context-free.
8.1 TWO PUMPING LEMMAS 7. Show that the following languages on are not context-free. w = a(m-1)^3bm Solution (m-1) m a … … a b … b 1) |vxy| 2) |v x y| 3) |vxy| i = 0 If |v| = 0  i = 2, else if |y| = 0  i = 0, otherwise (*) i = 2 i = 2  a는 (m-1)3 + k1개, b는 (m+k2)개 (m+k2-1)3 ≥ m3 = (m-1)3 + 3m2 -3m + 1 > (m-1)3 + k1 따라서 pumping된 문자열은 L에 속하지 않게 됨  Not CFL September 25, 2003

3 w = ambmcm+1 a … a b … b c … c |vxy| i = 2 2) |v x y| 3) |vxy|
8.1 TWO PUMPING LEMMAS w = ambmcm+1 Solution m m m+1 a … a b … b c … c |vxy| 2) |v x y| 3) |vxy| 4) |v x y| 5) |vxy| i = 2 If |y| = 0  i = 2, otherwise i = 0 i = 0 September 25, 2003

4 w = ambm+1cm+1 a … a b … b c … c |vxy| i = 2 2) |v x y|
8.1 TWO PUMPING LEMMAS w = ambm+1cm+1 Solution m m m+1 a … a b … b c … c |vxy| 2) |v x y| 3) |vxy| 4) |v x y| 5) |vxy| i = 2 If |y| = 0  i = 2, otherwise i = 0 i = 0 If |v| = 0  i = 2, otherwise i = 0 September 25, 2003

5 11. Show that the language is context-free but not linear.
8.1 TWO PUMPING LEMMAS 11. Show that the language is context-free but not linear. Solution 1) context free grammar S  S1 S2 S1  a S1 b | λ S2  a S2 b | λ 2) not linear w = ambm ambm m m m m a … a b … b a … a b … b |uv| |yz| i = 2 September 25, 2003

6 8.2 CLOSURE PROPERTIES AND DECISION ALGORITHMS
FOR CONTEXT-FREE LANGUAGES 6. Which of the language families we have discussed are not closed under reversal? September 25, 2003

7 8.2 CLOSURE PROPERTIES AND DECISION ALGORITHMS
FOR CONTEXT-FREE LANGUAGES 10. Show that the family of linear language is not closed under intersection. September 25, 2003

8 8.2 CLOSURE PROPERTIES AND DECISION ALGORITHMS
FOR CONTEXT-FREE LANGUAGES 19. Is the family of deterministic context-free languages closed under homomorphism? September 25, 2003


Download ppt "Chapter 8. PROPERTIES OF CONTEXT-FREE LANGUAGES Exercises"

Similar presentations


Ads by Google