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.

Slides:



Advertisements
Similar presentations
Chapter 5 Pushdown Automata
Advertisements

Pushdown Automata Section 2.2 CSC 4170 Theory of Computation.
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.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
CFG => PDA Sipser 2 (pages ).
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.
Lecture 3UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 3.
Costas Busch - RPI1 Pushdown Automata PDAs. Costas Busch - RPI2 Pushdown Automaton -- PDA Input String Stack States.
Courtesy Costas Busch - RPI1 Pushdown Automata PDAs.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
Fall 2004COMP 3351 Pushdown Automata PDAs. Fall 2004COMP 3352 Pushdown Automaton -- PDA Input String Stack States.
Fall 2006Costas Busch - RPI1 Pushdown Automata PDAs.
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
Pushdown Automaton (PDA)
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.
FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY
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.
Nondeterminism (Deterministic) FA required for every state q and every symbol  of the alphabet to have exactly one arrow out of q labeled . What happens.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
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.
Chapter 7 PDA and CFLs.
Pushdown Automata CS 130: Theory of Computation HMU textbook, Chap 6.
Pushdown Automata (PDAs)
Pushdown Automata Part I: PDAs Chapter Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2)
Lecture Pushdown Automata. stack stack head finite control tape head tape.
Push-down Automata Section 3.3 Fri, Oct 21, 2005.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 6 Mälardalen University 2010.
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.
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.
Formal Languages, Automata and Models of Computation
Pushdown Automata Hopcroft, Motawi, Ullman, Chap 6.
1.Draw a parse tree for the following derivation: S  C A C  C A b b  b b A b b  b b B b b  b b a A a a b b  b b a b a a b b 2. Show on your parse.
1.Draw a parse tree for the following derivation: S  C A C  C A b b  b b A b b  b b B b b  b b a A a a b b  b b a b a a b b 2. Show on your parse.
Grammar Set of variables Set of terminal symbols Start variable Set of Production rules.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 8 Mälardalen University 2011.
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.
CS 154 Formal Languages and Computability March 15 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
1/29/02CSE460 - MSU1 Nondeterminism-NFA Section 4.1 of Martin Textbook CSE460 – Computability & Formal Language Theory Comp. Science & Engineering Michigan.
CSCI 2670 Introduction to Theory of Computing September 22, 2004.
Costas Busch - LSU1 Deterministic Finite Automata And Regular Languages.
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.
6. Pushdown Automata CIS Automata and Formal Languages – Pei Wang.
Theory of Computation Pushdown Automata pda Lecture #10.
CSE 105 theory of computation
CIS Automata and Formal Languages – Pei Wang
Pushdown Automata PDAs
Push-down Automata Section 3.3 Wed, Oct 27, 2004.
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
CS 461 – Sept. 28 Section 2.2 – Pushdown Automata { 0n 1n }
AUTOMATA THEORY VI.
Pushdown Automata (PDA). Part 3
Non-Determinism 12CS45 Finite Automata.
Chapter 5 Pushdown Automata
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
COSC 3340: Introduction to Theory of Computation
Pushdown automata a_introduction.htm.
Chapter 2 Context-Free Language - 01
CSE 105 theory of computation
Principles of Computing – UFCFA3-30-1
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

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 is removed from the stack) and returns a state and a string to place in the stack - the automaton starts in the initial state, reading the first symbol on the tape, and having a special initial symbol on the stack - automaton accepts a string x if, after reading all of x, it can get to an accepting state (the stack content does not matter) - if the stack is empty, the automaton is stuck [Section 7.1]

Pushdown Automata Example: L = { a k b k | k ¸ 0 } [Section 7.1]

Pushdown Automata Example: L = { w 2 {a,b}* | w is an even-length palindrome } [Section 7.1]

Pushdown Automata [Section 7.2] Def: A pushdown automaton (PDA) is a 7-tuple (Q, , ,q 0,Z 0,A,  ) where - Q is a finite set of states -  is a finite input alphabet -  is a finite stack alphabet - q 0 2 Q is the initial state - Z 0 2  is the initial stack symbol - A µ Q is the set of accepting states -  is the transition function from ______________ to finite subsets of Q £  *

Pushdown Automata [Section 7.2] Def: Let M = (Q, , ,q 0,Z 0,A,  ) be a PDA. A configuration is a triple (p,x,  ) where p is the current state, x is the rest of the input (the yet-unread part), and  is the content of the stack (the top is on the left). We write (p,x,  ) ` M (q,y,  ) if we can get from the configuration (p,x,  ) to the configuration (q,y,  ) using one transition of M. Similarly we write (p,x,  ) ` M * (q,y,  ) if we can get from (p,x,  ) to (q,y,  ) through a finite sequence of transitions of M. The language accepted by M : L(M) = { x 2  * | ________________________ }

Deterministic Pushdown Automata [Section 7.3] Def: Let M = (Q, , ,q 0,Z 0,A,  ) be a PDA. M is deterministic (DPDA) if A language L is a deterministic context-free language (DCFL) if there exists a DPDA accepting L.

Deterministic Pushdown Automata [Section 7.3] Example: Give a DPDA for L = { a k b k | k ¸ 1 }. Can you give a DPDA for L 2 = { a k b k | k ¸ 0 } ?

Determinism vs. Nondeterminism [Section 7.3] For finite automata : For PDA : There exists a language which can be accepted by a PDA but not by a DPDA !

Determinism vs. Nondeterminism [Section 7.3] Example: Is the language given by S  SS | (S) |  a DCFL ?

Determinism vs. Nondeterminism [Section 7.3] Example: { x 2 {a,b}* | number of a’s in x = number of b’s in x }

Determinism vs. Nondeterminism [Section 7.3] Example: { x 2 {a,b}* | (numb. a’s in x) = 2 (numb. b’s in x) }

CFG vs. PDA [Sections 7.4 and 7.5] It is possible to show that every language generated by a CFG can be accepted by a PDA and vice versa. Thm: Let G = (V,  G,S,P) be a CFG. Then there exists a PDA M = (Q,  M, ,q 0,Z 0,A,  ) such that L(M) = L(G). Thm: Let M = (Q,  M, ,q 0,Z 0,A,  ) be a PDA. Then there exists a CFG G = (V,  G,S,P) such that L(G) = L(M). Which one is easier to prove ?

CFG vs. PDA [Section 7.4] Thm: Let G = (V,  G,S,P) be a CFG. Then there exists a PDA M = (Q,  M, ,q 0,Z 0,A,  ) such that L(M) = L(G). Example: S  S + T | T T  T * R | R R  (S) | x