I need to construct a CFG for the language consisting of even length palindromes with the same number of a's and b's and then prove that it generates that language.
This is the CFG I got:
S→ abba | baab | abSba | baSab | ε
I'm unsure of what to do to prove it (I just came up with this logically)...If anyone could point me in the right direction I would appreciate it. Thank you!