A grammar is a 4-tuple G, G = (N, Σ, Π, S) where
N is a finite set of nonterminal symbols
Σ is a finite set of terminal symbols
ÃŽÂ is a finite set of rules
S is the starting symbol
N = {S, T}
Σ = {a, b, c}
ÃŽÂ =
{
S -> aTb
S -> ab
aT -> aaTb
aT -> ac
}
S is the starting symbol.
a. Prove that the given grammar G is a context-sensitive grammar.
b. What is the language L = L(G) generated by the given grammar G?
c. For the string aaacbbb, design the appropriate syntax tree based on the context-sensitive grammar G.
d. The language L = L(G) generated by the given grammar G is also a context-free language. Write the context-free grammar G1 that generates the language L.
e. For the string aaacbbb, design the appropriate syntax tree based on the context-free grammar G1.