Note that this assignment is due on the day we come back from spring break. Also, Problem Set 4 will be due less that three weeks after that. So you might want to finish, or come close to finishing, these problems before the break.
F → [E] to the grammar of Figure 5.19 on p. 211 of the text. Assume that the term delimiters refers only to parentheses and brackets. Let L' be the subset of L consisting of those strings of L where
So for example, the strings ( a * [ b + c ] ) and
( a + b ) * ( a + b * [ a + b * ( a + b ) ] ) and
b + ( a * [ b + a ] * [ a + a ] ) are in L',
while the strings [ a * ( b + c ) ] and
( a * ( b + c ) ) and
a + b * ( a + b * [ a + b * [ a + b ] ] ) are not in L'
Find a CFG that generates L'.
Hint: Let E be a nonterminal symbol that yields expressions satisfying conditions (2) and (3) whose outermost delimiters are all parentheses, and let E' be a nonterminal symbol that yields expressions satisfying conditions (2) and (3) whose outermost delimiters are all brackets.