1

Is the following CSG for a^nb^nc^n correct?

S->aSbC|abc
Cb->bC
C->c

If not please explain why?

Preethi Y
  • 11
  • 2

1 Answers1

0

Productions:
S -> abc | aAbc
Ab -> bA
Ac -> Bbcc
bB -> Bb
aB -> aa | aaA

Solution:

S → aAbc
→ abAc
→ abBbcc
→ aBbbcc
→ aaAbbcc
→ aabAbcc
→ aabbAcc
→ aabbBbccc
→ aabBbbccc
→ aaBbbbccc
→ aaabbbccc

  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 11 '22 at 05:39