Re: context-free grammars (cfg) for the language



In article <1140620321.687004.104720@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
"kool_guy" <yjaplomb@xxxxxxxxx> wrote:

Can someone come up with a CFG for the following language?

L = { xcy | x != y, (x, y in {a, b} *) }

Any help is appreciated!

Hint: make a grammar for { xcy | x = y, (x, y in {a, b} *) };
then modify it to add more 'a's and/or 'b's to one side or the other.

--
---------------------------
| BBB b \ Barbara at LivingHistory stop co stop uk
| B B aa rrr b |
| BBB a a r bbb | Quidquid latine dictum sit,
| B B a a r b b | altum viditur.
| BBB aa a r bbb |
-----------------------------
.