I am trying to construct a context-free grammar for the following language: $$L=\{w_1cw_2:w_1\neq w_2^{R}\},$$ where words are over $\{a,b,c\}$.
I have tried to do this by taking the union of two sub-languages:
- The length of $w_1$ is not equal to the length of $w_2$.
- The lengths are equal.
For 1, I've already written the grammar. But I'm having difficulty with 2. In terms of a PDA I think non-determinism can solve this. However, what is the CFG for 2? If I can find it, I will union 1 and 2 to get the final solution.