0

I'm trying to find the PDA of the above language. I understand that this is the complement of the language
$L_1=\{w : w=a^nb^n : n\geq0\}$
However, I can't understand the idea behind constructing the PDA. Even if I construct the PDA for $L_1$, and convert the non-accepting states to accepting states and vice-versa, the resulting PDA will still not accept all strings belonging to $L$. Any help is appreciated in this regard.

Jayajit
  • 7
  • 3
  • I suggest studying the material at https://cs.stackexchange.com/q/18524/755 and https://en.wikipedia.org/wiki/Context-free_grammar#Closure_properties. – D.W. May 06 '21 at 07:43
  • @D.W. thanks, but I have verified that $L$ and $L_1$ are both context-free. Hence, I'm asking this question – Jayajit May 06 '21 at 07:47
  • I suggest studying it again. That question is not just about how to verify they are context-free, but how to prove it - and part of proving it typically involves showing how to construct a PDA or grammar, so those resources give you methods to construct a PDA or a grammar. – D.W. May 06 '21 at 18:51
  • Swapping accepting and non-accepting states is a technique that will successfully work for deterministic finite automata. In general it will fail for pushdown automata. It might work, but you have to start from deterministic pushdown automata that have a computation on every input. And even then, $\varepsilon$-transitions need some special care. – Hendrik Jan May 06 '21 at 20:47

0 Answers0