80 likes | 114 Views
DS020 오토마타형식언어. Chapter 8. PROPERTIES OF CONTEXT-FREE LANGUAGES Exercises. 8.1 TWO PUMPING LEMMAS. 7. Show that the following languages on are not context-free. w = a (m-1)^3 b m. Solution. (m-1) 3 m. a … … a b … b. 1) |vxy| 2) |v x y|
E N D
DS020 오토마타형식언어 Chapter 8. PROPERTIES OF CONTEXT-FREE LANGUAGES Exercises
8.1 TWO PUMPING LEMMAS 7. Show that the following languages on are not context-free. w = a(m-1)^3bm Solution (m-1)3 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
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 i = 2 i = 2 If |y| = 0 i = 2, otherwise i = 0 i = 0
8.1 TWO PUMPING LEMMAS w = ambm+1cm+1 Solution m m+1 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 i = 2
8.1 TWO PUMPING LEMMAS 11. Show that the languageis 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 … ab … b |uv| |yz| i = 2
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?
8.2 CLOSURE PROPERTIES AND DECISION ALGORITHMS FOR CONTEXT-FREE LANGUAGES 10. Show that the family of linear language is not closed under intersection.
8.2 CLOSURE PROPERTIES AND DECISION ALGORITHMS FOR CONTEXT-FREE LANGUAGES 19. Is the family of deterministic context-free languages closed under homomorphism?