Question: BASED ON DISCRETE MATHS AND COMPUTER SCIENCE = PROBLEM 3 (5 marks) The grammar GBP = ({C,)},{S}, {S + () | SS| (s)},5) generates the
BASED ON DISCRETE MATHS AND COMPUTER SCIENCE

= PROBLEM 3 (5 marks) The grammar GBP = ({C,)},{S}, {S + () | SS| (s)},5) generates the language of nonempty balanced parentheses strings, that is, strings like () and (0)(), but not 1, ) and ((). 1. Use the rules of GBp to generate the string () () (). Show clearly all the steps of the generation. 2. Using the grammar GBP as a guide, write a new grammar to generate the language of two types of nonempty balanced parentheses strings such as []() and [[]()]. The alphabet in this case is {(,), [,1}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
