Question: Let G = ({S, A}, sigma, R, S) be the context-free grammar with sigma = {a, b} and rules R = S rightarrow SS |

 Let G = ({S, A}, sigma, R, S) be the context-free

Let G = ({S, A}, sigma, R, S) be the context-free grammar with sigma = {a, b} and rules R = S rightarrow SS | ASa | aA, A rightarrow bA | SAa | a. And let T be the language of strings x such that #a(x) is even. (a) Show that this grammar is unsound for T-that is, find a string in L(G)\T. (b) Change one of the rules to make a grammar G' that is sound for T. Make it a "single-edit" change: that is, inserting, deleting, or changing just one character (terminal or variable symbol). Then explain why your new G' is sound. (c) Is the original grammar comprehensive for T? OK, it's not: elementof elementof \L(G). So let's change the target language to be T' = T\{elementof}and revise the question: Is the original grammar comprehensive for T'? If you say yes, argue why as best you can; if you say no, give a nonempty string with an even number of a's that G does not generate, and explain why not. Let G = ({S, A}, sigma, R, S) be the context-free grammar with sigma = {a, b} and rules R = S rightarrow SS | ASa | aA, A rightarrow bA | SAa | a. And let T be the language of strings x such that #a(x) is even. (a) Show that this grammar is unsound for T-that is, find a string in L(G)\T. (b) Change one of the rules to make a grammar G' that is sound for T. Make it a "single-edit" change: that is, inserting, deleting, or changing just one character (terminal or variable symbol). Then explain why your new G' is sound. (c) Is the original grammar comprehensive for T? OK, it's not: elementof elementof \L(G). So let's change the target language to be T' = T\{elementof}and revise the question: Is the original grammar comprehensive for T'? If you say yes, argue why as best you can; if you say no, give a nonempty string with an even number of a's that G does not generate, and explain why not

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!