Find a contextfree grammar G for which the following tree is

Find a context-free grammar G for which the following tree is the derivation tree of the string bba. Then find two more sentences of L(G).

Solution

CFG GRAMMAR

S -> bSSa
S -> b
S ->

We can put them in one line since all are transitions on one non terminal, S. Final CFG is given below

S -> bSSa | b |

-----------------------------------------------------------

Two more strings derived from this grammar

Consider the least length possible, emptystring and a terminal b can be derived directly then considering bSSa, ba can be derived

Find a context-free grammar G for which the following tree is the derivation tree of the string bba. Then find two more sentences of L(G).SolutionCFG GRAMMAR S

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site