Sei sulla pagina 1di 7

Tahir Naseem/Handout 22

-1-

Theory of Automata and Formal Languages

Lesson 25, 26 & 27


Pushdown Automata.(PDA)
Just as a DFA is a way to implement a regular expression, a pushdown automata is a way to
implement a context free grammar

PDA equivalent in power to a CFG

Can choose the representation most useful to our particular problem

Essentially identical to a regular automata except for the addition of a stack

Stack is of infinite size

Stack allows us to recognize some of the non-regular languages

Example 1:

Example 2:

Tahir Naseem/Handout 22

Example 3:

-2-

Theory of Automata and Formal Languages

Tahir Naseem/Handout 22

-3-

Theory of Automata and Formal Languages

The process of running the string aaabbb can also be expressed in the following table

Tahir Naseem/Handout 22

More Examples:

-4-

Theory of Automata and Formal Languages

Tahir Naseem/Handout 22

-5-

Theory of Automata and Formal Languages

Tahir Naseem/Handout 22

-6-

Theory of Automata and Formal Languages

Tahir Naseem/Handout 22

-7-

Theory of Automata and Formal Languages

Non-deterministic PDA

Here non-determinism can be observed at state READ 1. It can be observed that the above
PDA accepts the language of EVENPALINDROME.

Potrebbero piacerti anche