Pushdown Automata Hopcroft, Motawi, Ullman, Chap 6.

Slides:



Advertisements
Similar presentations
Chapter 5 Pushdown Automata
Advertisements

Pushdown Automata Section 2.2 CSC 4170 Theory of Computation.
Pushdown Automata CPSC 388 Ellen Walker Hiram College.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages We need a device similar to an FSM except that it needs more power. The insight: Precisely.
CS21 Decidability and Tractability
Introduction to Computability Theory
CFG => PDA Sipser 2 (pages ).
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
CFG => PDA Sipser 2 (pages ). CS 311 Fall Formally… A pushdown automaton is a sextuple M = (Q, Σ, Γ, δ, q 0, F), where – Q is a finite set.
Costas Busch - RPI1 Pushdown Automata PDAs. Costas Busch - RPI2 Pushdown Automaton -- PDA Input String Stack States.
Courtesy Costas Busch - RPI1 Pushdown Automata PDAs.
Introduction to the Theory of Computation John Paxton Montana State University Summer 2003.
CS 310 – Fall 2006 Pacific University CS310 Pushdown Automata Sections: 2.2 page 109 October 9, 2006.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2009 with acknowledgement.
Fall 2004COMP 3351 Pushdown Automata PDAs. Fall 2004COMP 3352 Pushdown Automaton -- PDA Input String Stack States.
Fall 2006Costas Busch - RPI1 Pushdown Automata PDAs.
January 14, 2015CS21 Lecture 51 CS21 Decidability and Tractability Lecture 5 January 14, 2015.
1 Pushdown Automata Definition Moves of the PDA Languages of the PDA Deterministic PDA’s.
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
Pushdown Automaton (PDA)
Fall 2006Costas Busch - RPI1 PDAs Accept Context-Free Languages.
Prof. Busch - LSU1 Pushdown Automata PDAs. Prof. Busch - LSU2 Pushdown Automaton -- PDA Input String Stack States.
Fall 2005Costas Busch - RPI1 Pushdown Automata PDAs.
1 Pushdown Automata PDAs. 2 Pushdown Automaton -- PDA Input String Stack States.
CS 3240: Languages and Computation Pushdown Automata & CF Grammars NOTE: THESE ARE ONLY PARTIAL SLIDES RELATED TO WEEKS 9 AND 10. PLEASE REFER TO THE TEXTBOOK.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 8 Mälardalen University 2010.
CSCI 2670 Introduction to Theory of Computing September 21, 2005.
Pushdown Automata CS 130: Theory of Computation HMU textbook, Chap 6.
Pushdown Automata (PDAs)
Lecture Pushdown Automata. stack stack head finite control tape head tape.
Push-down Automata Section 3.3 Fri, Oct 21, 2005.
1 Pushdown Automata Definition: relation to  -NFA Moves of the PDA Languages of the PDA Deterministic PDA’s Quiz Wednesday on CFGs lecture #3.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 6 Mälardalen University 2010.
Finite Automata – Definition and Examples Lecture 6 Section 1.1 Mon, Sep 3, 2007.
PushDown Automata. What is a stack? A stack is a Last In First Out data structure where I only have access to the last element inserted in the stack.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2010 with acknowledgement.
1 Pushdown Automata There are context-free languages that are not regular. Finite automata cannot recognize all context-free languages.
CSCI 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Pushdown.
1 Pushdown Automata Definition Moves of the PDA Languages of the PDA Deterministic PDA’s.
Lecture 14 Push Down Automata (PDA) Topics:  Definition  Moves of the PDA  Languages of the PDA  Deterministic PDA’s June 18, 2015 CSCE 355 Foundations.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Pushdown.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Pushdown.
Grammar Set of variables Set of terminal symbols Start variable Set of Production rules.
1 Chapter Pushdown Automata. 2 Section 12.2 Pushdown Automata A pushdown automaton (PDA) is a finite automaton with a stack that has stack operations.
CS 154 Formal Languages and Computability March 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
About Grammars Hopcroft, Motawi, Ullman, Chap 7.1, 6.3, 5.4.
Costas Busch - LSU1 PDAs Accept Context-Free Languages.
Theory of Computation Automata Theory Dr. Ayman Srour.
Lecture 11  2004 SDU Lecture7 Pushdown Automaton.
Pushdown Automata - like NFA-  but also has a stack - transition takes the current state, the current input symbol, and the top-of-the-stack symbol (which.
CSCI 2670 Introduction to Theory of Computing September 22, 2004.
Recap: Nondeterministic Finite Automaton (NFA) A deterministic finite automaton (NFA) is a 5-tuple (Q, , ,s,F) where: Q is a finite set of elements called.
Formal Languages, Automata and Models of Computation
Lecture 14 Push Down Automata (PDA)
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
CS 461 – Sept. 28 Section 2.2 – Pushdown Automata { 0n 1n }
Chapter 7 PUSHDOWN AUTOMATA.
Finite Automata & Regular Languages
Definition Moves of the PDA Languages of the PDA Deterministic PDA’s
Pushdown automata a_introduction.htm.
Definition Moves of the PDA Languages of the PDA Deterministic PDA’s
Chapter 2 Context-Free Language - 01
Principles of Computing – UFCFA3-30-1
… NPDAs continued.
Pushdown automata The Chinese University of Hong Kong Fall 2011
Hopcroft, Motawi, Ullman, Chap 8
Presentation transcript:

Pushdown Automata Hopcroft, Motawi, Ullman, Chap 6

PDAs: Pushdown Automata Same as Finite Automata (e.g., NFAs), but with the addition of a stack: On each transition, a stack is manipulated and monitored (operations: push, pop, inspect top, check for empty) Allows the automaton to “count” Definition will need to incorporate stack events When is a string acceptable?

PDA definition A pushdown automaton M is a tuple M = (Q, , , , q 0, Z 0, F), where: Q is a set of states  is the input alphabet  is the stack alphabet  : Q   +є    (Q   *)* is the state transition function mapping a (state, symbol, stack symbol) triple to a set of (state, string) pairs q 0 is the start state of M Z 0 is the starting stack symbol (initially on the stack) F  Q is the set of accepting states or final states of M

PDA transitions A transition between states q x and q y can be carried out in a PDA when a given next input symbol a is read and a given stack symbol X is on top of the stack When the transition to q y is carried out, the symbol X is replaced with a string w of stack symbols  (q x, a, X) contains the pair (q y, w) How are the stack operations push, pop, inspect top, and check if empty carried out? push Y on input a:  (q x, a, X) -> (q y, YX) pop Y:  (q x, a, X) -> (q y, є) How about inspect top and check if empty?

Example L = {a n b n : n >= 0} PDA M = ({q 0,q 1,q 2 }, {a,b}, {Z 0,X}, , q 0, Z 0, {q 2 })  defined (informally) as follows: On input a (from q 0 ) push X onto the stack On input b (from q 0 and q 1 ), pop X and transition to q1 (note: cannot transition if X is not on top of the stack) From q0 and q1, transition to final state q 2 if stack is “empty” (Z 0 is on top)

Transition function example  (q 0, a, Z 0 ) = {(q 0, XZ 0 )}  (q 0, a, X) = {(q 0, XX)}  (q 0, b, X) = {(q 1, є)}  (q 1, b, X) = {(q 1, є)}  (q 0, є, Z 0 ) = {(q 2, Z 0 )}  (q 1, є, Z 0 ) = {(q 2, Z 0 )}  (q 0, b, Z 0 ) =  (q 1, b, Z 0 ) =  (q 1, a, X) and many others are all equal to {} push X onto the stack on input a pop X from the stack on input b go to final state if Z 0 is on top

PDA diagram q0q0 q2q2 a, Z 0, XZ 0 a, X, XX q1q1 b, X, є є, Z 0, Z 0

Alternative diagram q0q0 q2q2 a, push X q1q1 b, pop X є, empty b, pop X

Accepting strings in a PDA By final state, just like in regular final automata Or by empty stack: string is acceptable once the stack is empty (Z 0 has been popped out), regardless of what state it is currently in These two “kinds” of PDAs are equivalent (proofs in section 6.2)

Equivalence of PDAs and CFGs PDAs and CFGs describe the same set of languages (section 6.3) Proof requires: Construction from a grammar to an equivalent PDA Construction from a PDA to an equivalent grammar