Let $L = \{a^nb^n : n \geq 0\} \cup \{a\}$, where $\Gamma = x, \$, \Sigma = \{a, b\}$, we have the NPDA of $L in three states:
In the above state diagram, I can break the transtion \lambda, \lambda \rightarrow \$ by creating another initial state, but my question is if I put it in the loop together is it still ok? Since the notation of Peter Linz's book is so confusing, I have to borrow Micheal Sipser's book notations for this problem. The idea of PDA is as follows:
- Read nothing, push onto stack - Read an $a$, push $x$ onto stack. - Read a $b$, pop $x$ out of stack. - Special case is when reading an $a$, push \$ onto stack and move to state $q_1$, then from $q_1$ read nothing, pop \$ out of stack and go to accepting state.
Does this PDA looks reasonable at all?
Thank you.