Pushdown Automata and Determinism
Learn about the formal definition of deterministic PDA.
We'll cover the following...
Let’s consider the following PDA, which accepts the language .
In the diagram above, we initiated the stack with an , which effectively increments the count of ’s in a string accepted by the PDA. Using such a stack “start symbol” can be helpful for other purposes as well.
The following PDA for uses a start symbol, , to know when the stack has “hit bottom” (i.e., when is at the top of the stack, it is the only symbol on the stack). Furthermore, whenever an is on the top of the stack in this machine, it means that an equal number of ’s and ’s have been encountered so far up to that point.
Compare the transitions in state above with those from the first figure for language . The following transitions have replaced from the PDA for the language :
Since is always on the bottom of the stack in this machine, we know that when it is at the top of the stack, nothing else is on the stack, so we can push an to account for the symbol just read. The transition is omitted because, like before, 's and 's do not appear on the stack simultaneously in this PDA. The two replacement transitions mentioned above are equivalent to in that their net effect is to add an to the stack when reading an ...