Reputation: 1
So I've come across this problem in my study of context free grammars and I have no idea how to get the production rules of this English sentence.
Language L is defined as: "All odd-length strings over {a, b}∗ with middle symbol a."
Upvotes: 0
Views: 1033
Reputation: 7544
You can build the string from the middle and always add one letter to both sides
A -> aAa | aAb | bAa | bAb | a
Upvotes: 1