'Context-sensitive Grammar for a^nb^nc^n
Is the following CSG for a^nb^nc^n correct?
S->aSbC|abc
Cb->bC
C->c
If not please explain why?
Solution 1:[1]
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
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Parth Sarathi Pathak |