Question: 1 - Recognizing simple languages: For each of the following grammars, briefly describe the language it defines in a sentence or two. Assume that the

1 - Recognizing simple languages: For each of the following grammars, briefly describe the language it defines in a sentence or two. Assume that the start symbol is S for each and that any symbol found only on the right hand side of a production is a terminal symbol. We've done the first one for you as an example. Hint: if it's not obvious by inspection, try writing down sentences in the language until you can see the patterns emerging. If it is obvious by inspection, write down some sentences generated by the grammar to verify that they match your expectations and fit your English description. Please be as precise as possible in describing the language.

0 - Example) S -> a S a S -> b Answer: This grammar defines the language consisting of strings of N a's (where N >= 0) followed by one b followed by N a's. Another description could be strings of zero or more as followed by one b followed by zero or more as.

1 ) S -> Q a Q -> b S Q -> c 2) S -> A B C A -> a | Aa B -> bB | bc C -> cCc | cc

3) S -> A B C D A -> a | aA B -> Bb | b C -> bC | b D -> a | aD

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!