0
votes

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

1

1 Answers

1
votes

You can build the string from the middle and always add one letter to both sides

A -> aAa | aAb | bAa | bAb | a