Push-down Automata Section 3.3 Fri, Oct 21, 2005.

Slides:



Advertisements
Similar presentations
Chapter 5 Pushdown Automata
Advertisements

Pushdown Automata Section 2.2 CSC 4170 Theory of Computation.
1 Pushdown Automata (PDA) Informally: –A PDA is an NFA-ε with a stack. –Transitions are modified to accommodate stack operations. Questions: –What is a.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
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.
YES-NO machines Finite State Automata as language recognizers.
CFGs and PDAs Sipser 2 (pages ). Long long ago…
CS21 Decidability and Tractability
CFGs and PDAs Sipser 2 (pages ). Last time…
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.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
1 Languages and Finite Automata or how to talk to machines...
Fall 2004COMP 3351 Pushdown Automata PDAs. Fall 2004COMP 3352 Pushdown Automaton -- PDA Input String Stack States.
Fall 2006Costas Busch - RPI1 Pushdown Automata PDAs.
Prof. Busch - LSU1 Pushdown Automata PDAs. Prof. Busch - LSU2 Pushdown Automaton -- PDA Input String Stack States.
Fall 2005Costas Busch - RPI1 Pushdown Automata PDAs.
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
1 Pushdown Automata PDAs. 2 Pushdown Automaton -- PDA Input String Stack States.
Finite State Machines Data Structures and Algorithms for Information Processing 1.
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.
Regular Languages A language is regular over  if it can be built from ;, {  }, and { a } for every a 2 , using operators union ( [ ), concatenation.
Chapter 7 PDA and CFLs.
1 Theory of Digital Computation Course material for undergraduate students on IT Department of Computer Science University of Veszprem Veszprem, Hungary.
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)
Complexity and Computability Theory I Lecture #11 Instructor: Rina Zviel-Girshin Lea Epstein.
Chapter 7 Pushdown Automata
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2010 with acknowledgement.
Lecture 11UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 11.
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.
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.
Transparency No. 2-1 Formal Language and Automata Theory Homework 2.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Pushdown.
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.
Pushdown Automata Chapter 12. Recognizing Context-Free Languages Two notions of recognition: (1) Say yes or no, just like with FSMs (2) Say yes or no,
CS 154 Formal Languages and Computability March 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
CS6800 Advance Theory of Computation Spring 2016 Nasser Alsaedi
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.
6. Pushdown Automata CIS Automata and Formal Languages – Pei Wang.
Theory of Computation Pushdown Automata pda Lecture #10.
Pushdown Automata PDAs
Push-down Automata Section 3.3 Wed, Oct 27, 2004.
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Theory of Computation Lecture #27-28.
Push-down Automata.
AUTOMATA THEORY VI.
Deterministic Finite Automata
Discrete Math II Howon Kim
COSC 3340: Introduction to Theory of Computation
Pushdown Automata Reading: Chapter 6.
Deterministic Finite Automata
Pushdown automata a_introduction.htm.
Pushdown automata The Chinese University of Hong Kong Fall 2011
Recap lecture 37 New format for FAs, input TAPE, START, ACCEPT , REJECT, READ states Examples of New Format of FAs, PUSHDOWN STACK , PUSH and POP states,
COSC 3340: Introduction to Theory of Computation
Presentation transcript:

Push-down Automata Section 3.3 Fri, Oct 21, 2005

Push-Down Automata  Recall that DFAs accept regular languages.  We want to design machines similar to DFAs that will accept context-free languages.  These machines will need to be more powerful.  To handle a language like {a n b n | n  0}, the machine needs to “remember” the number of as.  To do this, we use a stack.  A push-down automaton (PDA) is essentially an NFA with a stack.

Definition of a Push-Down Automaton  A push-down automaton (PDA) is a sextuple (K, Σ, Γ, Δ, s, F) where K is a finite set of states. Σ is a finite alphabet of tape symbols. Γ is a finite alphabet of stack symbols. s  K is the start state. F  K is the set of final states. Δ is the transition relation, i.e., Δ is a finite subset of (K  (Σ  {e})  Γ * )  (K  Γ * ).

Transitions  Let ((p, a, β), (q, γ))  Δ be a transition.  It means that we Move from state p. Read a from the tape, Pop the string β from the stack, Move to state q, Push string γ onto the stack.  The first three (p, a, β), are “input.”  The last two (q, γ) are “output.”

Transitions  We will draw it as pq a,  ; 

Pushing and Popping  When we push β, we push the symbols of β as we read them right to left. When we push the string abc, we push c, then push b, then push a.  When we pop γ, we pop the symbols of γ as we read them from left to right (reverse order). When we pop the string abc, we pop a, then pop b, then pop c.

Pushing and Popping  Thus, if we push the string abc and then pop it, we will get back abc, not cba.  If we wanted to reverse the order, we would use three separate transitions: Push a Push b Push c

Configurations  A configuration fully describes the current “state” of the PDA. The current state p. The remaining input w. The current stack contents .  Thus, a configuration is a triple (p, w,  )  (K,  *,  * ).

Computations  A configuration (p, w,  ) yields a configuration (p', w',  ') in one step, denoted (p, w,  ) (p', w',  '), if there is a transition ((p, a,  ), (p',  ))  Δ such that w = aw',  = , and  ' =  for some    *.  The reflexive, transitive closure of is denoted *.

Accepting Strings  After processing the string on the tape, The PDA is in either a final or a nonfinal state, and The stack is either empty or not empty.  The input string is accepted if The ending state is a final state, and The stack is empty.  That is, the string w   * is accepted if (s, w, e) * (f, e, e) for some f  F.

Accepting Strings  One may define acceptance “by final state” only. The input is accepted if and only if the last state is a final state, regardless of whether the stack is empty.  One may define acceptance “by empty stack” only. The input is accepted if and only if the stack is empty once the input is processed, regardless of which state the PDA is in.

Example of a PDA  Run the following PDA on the input string aaabbb. sp q a, e; a b, a; e a, e; a

Example of a PDA  The steps in the processing are (s, aaabbb, e) (p, aabbb, a) (p, abbb, aa) (p, bbb, aaa) (p, bb, aa) (p, b, a) (q, e, e).

The Language of a PDA  The language of a PDA A is L(A) = {w   *  A accepts w}.  What is the language of the PDA in the previous example?

s p e, e; e b, a; ea, e; a Example of a PDA  What is the language of the following PDA?

Examples of PDAs  Let  = {a, b}.  Design a PDA that accepts the language {wcw R | w   * }.  Design a PDA that accepts the language {ww R | w   * }.

Examples of PDAs  Design a PDA whose language is {a m b n  0  m < n}.  Design a PDA whose language is {a m b n  0  n < m}.

Examples of PDAs  Design a PDA whose language is {a m b n c n d m | m  0, n  0}.  Design a PDA whose language is {a m b m c n d n | m  0, n  0}.  Design a PDA whose language is {a m b n c p d q | m + n = p + q}.  Design a PDA whose language is {a m b n c k | m = n or m = k}.