Pda 1
Pda 1
Figure 1: Schematic representations
Informal algorithm:
1. Read symbols from the input. As each 0 is read push it onto the
stack
2. As soon as a 1 is read, pop a 0 off the stack for each 1 read
3. If input finishes when stack becomes empty accept; if stack
becomes empty while there is still input or input finishes while
stack is not empty reject
require nondeterminism, but other do. Such a
language is
Nondeterminism allows PDA to make transitions on empty input.
Hence we will use and
Domain of the PDA transition function is where is
the set of states
Since a PDA can write on the stack while performing
nondeterministic transitions the range of the PDA transition
function is
In conclusion:
where , , , and are finite
sets, and:
1. is a set of states
4.
A PDA computes as
follows:
inputs , where each
There are a sequence of states and a sequence
of strings that satisfy the conditions:
2. For we have where
and for some and , i.e.,
moves properly according to the state, stack, and input symbol
3. , i.e., an accept state occurs at the input end
Notation:
$
0
,
Example PDA
is defined by the table:
,
1
$
where:
,
means
The PDA that recognizes the language
!
%
"
& #
$
.
Pushdown Automata – p.15/25
Transition diagrams of PDA
recognizing the language
&
&
&
&
&
Figure 2: Transition diagram for PDA
Pushdown Automata – p.18/25
Note 1
Informal description:
The PDA first reads and push ’s on the stack
When this is done, it can match s with s or s
Since machine does not know in advance whether s are
matched with s or s, nondeterminism helps
&
Figure 3:
&
&
recognizing
&
The transition diagram is in Figure 3
& &
& &
& &
&
Transition diagram of PDA
Pushdown Automata – p.22/25
Example 2.11
the input has been reached
3. When middle of the word has reached the machine starts popping
off the stack for each symbol read, checking to see that what is
read and what is popped off is the same symbol
4. If the symbol read from the input and popped out from the stack is
the same and the stack empties as the same time as input is
finished, accept; otherwise reject
recognizing the language
&
&
&
&
&
&
&
Figure 4: Transition diagram for PDA
Pushdown Automata – p.25/25