Question: Consider a context-free grammar g generating language L and a set D of leftmost derivations of strings z from L. Observe that a grammar g'

 Consider a context-free grammar g generating language L and a set

Consider a context-free grammar g generating language L and a set D of leftmost derivations of strings z from L. Observe that a grammar g' generating the set D can be derived from g by modifying the righthand sides of productions; more specifically, by removing all termi- nal symbols from the righthand sides and inserting new terminal symbols (the production numbers) in front of the remaining nonterminals (a) Find a context-free grammar G for which the grammar G' is regular. (b) Find a context-free grammar g for which the grammar G' is also context-free. (c) Find two dfferent context-free grammars Gi and 92 such that their sets of leftmost derivations are the same. (d) Is g' ambiguous if g is ambiguous? Explain why and provide an example illustrating your

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!