How would I go about writing a context free grammar for the following language:
{a^x b^y c^z | x >= 0, y >= 0, z >= 0, y = x + z}
How would I go about writing a context free grammar for the following language:
{a^x b^y c^z | x >= 0, y >= 0, z >= 0, y = x + z}
Note that
b^y = b^(x+z) = b^x b^z
So you can rewrite the specification as:
a^x b^x b^z c^z
Let L = a^x b^x, x >= 0
, and R = b^z c^z, z >= 0
I think you should be able to fill in the rest from there...