Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider terminal symbols 0 , 1 , 2 , 3 and non - terminals S , A , B , C with S as the

Consider terminal symbols 0,1,2,3 and non-terminals S, A, B,C 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 !0S2 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 0 m 1 n 2 m+n , where
m, n 2 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 0 m 1 n 2 p 3 m+n+p , where
m, n, p 2 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 non-terminals you use

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

Students also viewed these Databases questions

Question

Consider the pdf f(x): Scr (1 - r), 0

Answered: 1 week ago

Question

u = 5 j , v = 6 i Find the angle between the vectors.

Answered: 1 week ago