COSC 3340: Introduction to Theory of Computation University of Houston Fall 2003, Dr. Verma Lecture 11 Lecture 11 UofH - COSC 3340 - Dr. Verma
Push Down Automaton (PDA) Language Acceptor Model for CFLs It is an NFA with a stack. Finite State control Input Accept/Reject Stack Lecture 11 UofH - COSC 3340 - Dr. Verma
PDA (contd.) In one move the PDA can : change state, consume a symbol from the input tape or ignore it pop a symbol from the stack or ignore it push a symbol onto the stack or not A string is accepted provided the machine when started in the start state consumes the string and reaches a final state. Lecture 11 UofH - COSC 3340 - Dr. Verma
PDA (contd.) If PDA in state q can consume u, pop x from stack, change state to p, and push w on stack we show it as u, x w q0 q1 u, x ; w In JFLAP Lecture 11 UofH - COSC 3340 - Dr. Verma
Example of a PDA PDA L = {anbn |n 0} Push S to the stack in the beginning and then pop it at the end before accepting. Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
JFLAP Simulation Lecture 11 UofH - COSC 3340 - Dr. Verma
Definition of PDA Formally, a PDA M = (K, , , , s, F). where K -- finite set of states -- is the input alphabet -- is the tape alphabet s K -- is the start state F K -- is the set of final states (K X X ) X (K X ) Lecture 11 UofH - COSC 3340 - Dr. Verma
Definition of L(M) Define * as: (1) *(q, , ) = {(q, , )} {(p, , ) |((q, , ), (p, )) } (2) *(q, uv, xy) = {(p, v, wy) | ((q, u, x), (p, w)) } M accepts w if (f, , x) in *(s, w, ) L(M) = {w * | M accepts w} Lecture 11 UofH - COSC 3340 - Dr. Verma
Example What is L(M)? Push S to the stack in the beginning and then pop it at the end before accepting. Lecture 11 UofH - COSC 3340 - Dr. Verma