-1

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}
Cœur
  • 37,241
  • 25
  • 195
  • 267

1 Answers1

-1

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...

Jim Lewis
  • 43,505
  • 7
  • 82
  • 96