So i know that $L =$ { $ {w_1 w_2 : |w_1| =|w_2| , w_1 \neq w_2} $ }
is a CFL, but i cannot make a PDA for it because it doesn't make any sense to me why this is CFL
i even know the grammar for it but i cannot draw the PDA because :
even if we determine the middle of the string, if we push every word of w1 to the stack, then how can we compare it to w2 when we can only POP??? how is that even possible?
i mean how can i compare two strings and determine if they are the same if i can only compare the last word of first string to the first word of the second??!
also it would help me a lot to understand if you could say which of these are CFL and which are not :
$L_1 = \{ w_1 w_2 : |w_1| =|w_2| , w_1 = w_2 \} $
$L_2 = \{ w_1 w_2 : |w_1| \neq |w_2| , w_1 \neq w_2 \} $
$L_3 = \{w_1 w_2 : |w_1| \neq |w_2| , w_1 = w_2 \} $
there was a post about this but nobody answered how can we construct such a PDA? i don't want to just convert the grammar to PDA with algorithms, i want to understand how the PDA is comparing two strings?
PDA for { xy : |x| = |y|, x ≠ y} from its grammar, and intuition behind it