Consider the context-free grammar ({S}, {(,)}, P, S), where P contains the following productions:
S → (S)S
S → ε
(1p) Which of the following expressions are well-formed sequences of derivations for the grammar above?
S ⇒ (S)S ⇒ (S) ⇒ ()
S ⇒ ((S)S)S ⇒ ((S)) ⇒ (())
S ⇒ (S)S ⇒ ((S)S)S ⇒ (()S)S ⇒ (())S
S ⇒ ε
S ⇒ (())()
(1p) Which of the following expressions are well-formed sequences of left-most derivations for the grammar above?
S ⇒lm (S)S ⇒lm (S) ⇒lm ()
S ⇒lm ((S)S)S ⇒lm ((S)) ⇒lm (())
S ⇒lm (S)S ⇒lm ((S)S)S ⇒lm (()S)S ⇒lm (())S
S ⇒lm ε
S ⇒lm (())()
(1p) Which of the following strings are members of the language defined by the grammar above?
(())()()
(()(()()
(((())))
))))((((
(())()(())
(1p) Which of the following strings are right-sentential forms for the grammar above?
ε
SS
((S))()
(()S)()
(((())))
(1p) Consider the (unique) parse tree for the grammar above that has (())() as its yield. How many leaves does this tree have?