I'm designing a context-free grammar to generate this language:
{ w in {a,b}* | w is of the form uvu^R, where u and v are any strings in {a,b}* }
I would define the first two strings as:
U -> aU | bU | _
V -> aV | bV | _
And then combine those:
S -> UV
But how do I express the reversal as context-free grammar?