Automata Chapter Four
Automata Chapter Four
Chapter Four
Pushdown Automata
Push-Down Automata (PDA) is an abstract model of a machine –Finite State Automata.
It has a finite set of states. However, in addition, it has a pushdown stack. Moves of the PDA
are as follows:
1. An input symbol is read and the top symbol on the stack is read.
2. Based on both inputs, the machine enters a new state and writes zero or more symbols onto
the pushdown stack.
3. Acceptance of a string occurs if the stack is ever empty. (Alternatively, acceptance can be
if the PDA is in a final state. Both models can be shown to be equivalent.)
Reviewing a Stack
A stack is a data structure that allows addition/deletion/access of an element only at the top of
a stack.
-
-
-
A stack
Contents of the entire stack is not visible to the automaton at any instant. Only the top element
is accessible.
- To get to an element the automaton has to “pop” its way down. Elements that are popped
are forgotten.
An NPDA is a seven-tuple:
The complicated formal appearance of the domain and range of δ merits a closer examination.
The arguments of δ are the current state of the control unit, the current input symbol, and the
current symbol on top of the stack. The result is a set of pairs (q, x), where q is the next state of the
control unit and x is a string that is put on top of the stack in place of the single symbol there
before.
Example 1
δ (q1,a,b)={(q2,cd),(q3, ε)}
If at any time the control unit is in state q1, the input symbol read is a, and the symbol on top of
the stack is b, then one of two things can happen: (1) the control unit goes into state q2 and the
string cd replaces b on top of the stack, or (2) the control unit goes into state q3 with the symbol b
removed from the top of the stack. In our notation we assume that the insertion of a string into a
stack is done symbol by symbol, starting at the right end of the string.
CFG and PDA are equivalent in power: a CFG generates a context-free language and a PDA
recognizes a context-free language. In addition, the equivalent PDA to be used to implement its
compiler. A language is context-free iff some pushdown automaton recognizes it.
It is a variation of the pushdown automaton, which has at most one possible move.
Let L be a language defined over the alphabet Σ, the language L is deterministic context-free
if and only if it accepted by a deterministic pushdown automaton.
A language is context-free if there exists a context-free grammar that can generate it.