3,594 views

1 Answer

0 0 votes

Below is the grammar for L = {a^n b^n c^n | n>=1}

S → abc | aSAc

cA → Ac

bA → bb 

Let’s try deriving string w = aaabbbccc

S → aSAc                 [S → aSAc]

   → aaSAcAc           [S → aSAc]

   → aaSAAcc           [cA → Ac]

   → aaabcAAcc       [S → abc]

   → aaabAcAcc       [cA → Ac]

   → aaabAAccc       [cA → Ac]

   → aaabbAccc       [bA → bb]

   → aaabbbccc       [bA → bb] 

Position:
Show:

Related questions

0 0 votes
2 2 answers
927
927 views
Ravi prakash pandey asked Apr 7, 2018
927 views
it is given that in csg if @->#then length of @ should be less or equal to #then how aaB->c is a csg???
0 0 votes
0 0 answers
737
737 views
Purple asked Jan 12, 2017
737 views
How can L(G) be regular?If we derive bSb bAcAb, now we have Ab >b but we do not have the production bA since G is all production except last. So there is no production ...
3 3 votes
2 2 answers
1.8k
1.8k views
Mahesha999 asked Dec 25, 2016
1,814 views
How can I tell if languages $L_1$ and $L_2$ are Context Sensitive or not?