Languages to context free grammars
Provide context free grammars for the following languages.
(a) {a^mb^nc^n | m ¡Ý 0 and n ¡Ý 0 }
(b) {a^nb^nc^m | m ¡Ý 0 and n ¡Ý 0 }
If there were any other rules involved such as m = n or anything like
that, I could get it, but the general m greater than or equal to zero? I'm
pretty confused. and also I don't understand how a and b would be any
different. Here was my shot at making a grammar out of this:
S1 --> S2 | e
S2 --> aS2bS2c | S3
S3 --> aS3 | S4
S4 --> bS4 | S5
S5 --> cS5 | c
No comments:
Post a Comment