Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Secrets Of Analytical Leaders Insights From Information Insiders

Authors: Wayne Eckerson

1st Edition

1935504347, 9781935504344

More Books

Students also viewed these Databases questions

Question

How do modern Dashboards differ from earlier implementations?

Answered: 1 week ago