Question
3. A pure grammar, G, is one which uses no variables in its productions. Such a grammar is dened by a triple, (T,P,w), where T
3. A pure grammar, G, is one which uses no variables in its productions. Such a grammar is dened by a triple, (T,P,w), where T is a nite set of terminals, P is a nite set of productions T T, and w is the start word. For such a grammar, dene the language generated by G to be the set of all terminal strings derivable from the start word. For example, if G = ({a,b},P,ab) with P dened by a ab,b bab | bb then one deriva- tion would be ab abb ababb abbabb, so L(G) contains the words ab,abb,ababb, and abbabb, among others. (a) Show that every pure language, L(G), is a CFL by describing how to construct an equivalent CFG, H, from the pure grammar G. (b) Under what circumstances is L(G) nite, for a pure grammar G? (c) Bonus. Show that the pure languages are a proper subset of the CFLs by nding a CFL that cant be generated by a pure grammar.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started