Question: Consider terminal symbols 0 , 1 , 2 , 3 and non - terminals S , A , B , C with S as the
Consider terminal symbols and nonterminals S A BC with S as the start symbol. This ques
tion will involve grammars based on these symbols and the languages they generate.
a If the only productions are S S and S what is the language generated by the grammar? Explain your
answer.
b You want to modify the grammar so as to generate the language consisting of all the strings m n mn where
m n N You are going to do this by adding the production A and exactly two further productions. What
are the productions, and why does this work? Your answer should describe the role of S and A
c Find a grammar which generates the language consisting of all strings of the form m n p mnp where
m n p N You are not required to use the productions from parts a and b although you may find the
ideas involved in those parts helpful. Once again you should explain why your grammar has the desired
effect, and explain the roles of any nonterminals you use
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
