Question: 3. Consider a context-free grammar G generating language L and a set D of leftmost derivations of strings r from L. Observe that a grammar

 3. Consider a context-free grammar G generating language L and a

3. Consider a context-free grammar G generating language L and a set D of leftmost derivations of strings r 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 a 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 different context-free grammars G1 and G2 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!