Context-sensitive grammar for specific language

Posted by superagio on Stack Overflow See other posts from Stack Overflow or by superagio
Published on 2013-10-26T14:16:37Z Indexed on 2013/10/26 21:54 UTC
Read the original article Hit count: 356

How can I construct a grammar that generates this language? Construct a grammar that generates L:

L = {a^n b^m c^k|k>n, k>m}

I believe my productions should go along this lines:

S-> ABCC
A-> a|aBC|BC
B-> b|bBC
C-> c|Cc
CB->BC

The idea is to start with 2 c and keep always one more c, and then with C->c|Cc ad as much c as i want. How can my production for C remember the numbers of m and n.

© Stack Overflow or respective owner

Related posts about computer-science

Related posts about formal-languages