Examples of PDA
Learn about pushdown automata using some examples.
We'll cover the following...
Let’s look at a few examples of pushdown automata that accept the following languages:
PDA for palindromes
The following PDA accepts the language , i.e., odd-length palindromes of 's and 's with a in the middle.
We push distinct symbols for 's and 's. Once the is consumed, we expect to find the reversal of the first half of the string in terms of 's and 's. The minimal string is accepted, since it does not modify the stack (leaving it empty), and ends in an accepting state.
All the examples so far have been deterministic PDAs—there is no ambiguity as to which transition applies for each input symbol. It is not possible, however, to construct a deterministic PDA (a DPDA) for the language of even-length palindromes, i.e., ...