**{a^i b^j c^k d^m | i+j=k+m | i<m}**
The grammar should allow the language in order abbccd
not cbbcda
. First should be the a's then b's and so on.
I know that you must "count" the number of a's and b's you are adding to make sure there are an equivalent number of c's and d's. I just can't seem to figure out how to make sure there are more c's than a's in the language. I appreciate any help anyone can give. I've been working on this for many hours now.
Edit:
The grammar should be Context Free
I have only got these two currently because all others turned out to be very wrong:
S -> C A D | B
B -> C B D |
C -> a | b
D -> c | d
and
S -> a S d | A
A -> b A c |
(which is close but doesn't satisfy the i < k part)
i<k
and notj<k
? – rici