Pushdown Automata PDAs

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.
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
Costas Busch - RPI1 Pushdown Automata PDAs. Costas Busch - RPI2 Pushdown Automaton -- PDA Input String Stack States.
1 … NPDAs continued. 2 Pushing Strings Input symbol Pop symbol Push string.
Courtesy Costas Busch - RPI1 Pushdown Automata PDAs.
Courtesy Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
1 Normal Forms for Context-free Grammars. 2 Chomsky Normal Form All productions have form: variable and terminal.
Fall 2004COMP 3351 Pushdown Automata PDAs. Fall 2004COMP 3352 Pushdown Automaton -- PDA Input String Stack States.
Fall 2006Costas Busch - RPI1 Pushdown Automata PDAs.
1 Normal Forms for Context-free Grammars. 2 Chomsky Normal Form All productions have form: variable and terminal.
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
Prof. Busch - LSU1 Pushdown Automata PDAs. Prof. Busch - LSU2 Pushdown Automaton -- PDA Input String Stack States.
Prof. Busch - LSU1 Turing Machines. Prof. Busch - LSU2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Fall 2005Costas Busch - RPI1 Pushdown Automata PDAs.
1 Pushdown Automata PDAs. 2 Pushdown Automaton -- PDA Input String Stack States.
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
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.
Pushdown Automata (PDAs)
Lecture Pushdown Automata. stack stack head finite control tape head tape.
1 CDT314 FABER Formal Languages, Automata and Models of Computation Lecture 6 Mälardalen University 2010.
Complexity and Computability Theory I Lecture #11 Instructor: Rina Zviel-Girshin Lea Epstein.
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.
CSCI 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Pushdown.
Formal Languages, Automata and Models of Computation
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.
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.
CS 154 Formal Languages and Computability March 10 Class Meeting Department of Computer Science San Jose State University Spring 2016 Instructor: Ron Mak.
1 Turing Machines. 2 The Language Hierarchy Regular Languages Context-Free 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.
Formal Languages, Automata and Models of Computation
Lecture 14 Push Down Automata (PDA)
CSE 105 theory of computation
Busch Complexity Lectures: Turing Machines
Pushdown Automata (PDA). Part 2
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
CS 461 – Sept. 28 Section 2.2 – Pushdown Automata { 0n 1n }
Theory of Computation Lecture #27-28.
Chapter 7 PUSHDOWN AUTOMATA.
AUTOMATA THEORY VI.
Pushdown Automata PDAs
Turing Machines 2nd 2017 Lecture 9.
Pushdown Automata (PDA). Part 3
NPDAs Accept Context-Free Languages
Principles of Computing – UFCFA3-30-1
Non-Deterministic Finite Automata
CSE322 Definition and description of finite Automata
Pushdown automata a_introduction.htm.
Definition Moves of the PDA Languages of the PDA Deterministic PDA’s
Chapter 2 Context-Free Language - 01
CSE 105 theory of computation
… NPDAs continued.
Pushdown automata The Chinese University of Hong Kong Fall 2011
CSE 105 theory of computation
Non Deterministic Automata
Normal Forms for Context-free Grammars
CSE 105 theory of computation
Presentation transcript:

Pushdown Automata PDAs 2nd 2017 Lecture 8

Pushdown Automaton -- PDA Input String Stack States 2nd 2017 Lecture 8

Initial Stack Symbol Stack Stack stack head top bottom special symbol Appears at time 0 2nd 2017 Lecture 8

The States Pop symbol Input symbol Push symbol 2nd 2017 Lecture 8

input stack top Replace 2nd 2017 Lecture 8

input stack top Push 2nd 2017 Lecture 8

input stack top Pop 2nd 2017 Lecture 8

input stack top No Change 2nd 2017 Lecture 8

If the automaton attempts to pop from Pop from Empty Stack input Pop Automaton halts! stack top If the automaton attempts to pop from empty stack then it halts and rejects input 2nd 2017 Lecture 8

PDAs are non-deterministic Non-Determinism PDAs are non-deterministic Allowed non-deterministic transitions 2nd 2017 Lecture 8

Example PDA PDA : 2nd 2017 Lecture 8

Basic Idea: Push the a’s 2. Match the b’s on input on the stack with a’s on stack 3. Match found 2nd 2017 Lecture 8

Execution Example: Time 0 Input Stack current state 2nd 2017 Lecture 8

Time 1 Input Stack 2nd 2017 Lecture 8

Time 2 Input Stack 2nd 2017 Lecture 8

Time 3 Input Stack 2nd 2017 Lecture 8

Time 4 Input Stack 2nd 2017 Lecture 8

Time 5 Input Stack 2nd 2017 Lecture 8

Time 6 Input Stack 2nd 2017 Lecture 8

Time 7 Input Stack 2nd 2017 Lecture 8

Time 8 Input Stack accept 2nd 2017 Lecture 8

A string is accepted if there is a computation such that: All the input is consumed AND The last state is an accepting state we do not care about the stack contents at the end of the accepting computation 2nd 2017 Lecture 8

Rejection Example: Time 0 Input Stack current state 2nd 2017 Lecture 8

Rejection Example: Time 1 Input Stack current state 2nd 2017 Lecture 8

Rejection Example: Time 2 Input Stack current state 2nd 2017 Lecture 8

Rejection Example: Time 3 Input Stack current state 2nd 2017 Lecture 8

Rejection Example: Time 4 Input Stack current state 2nd 2017 Lecture 8

reject Rejection Example: Time 4 Input Stack current state 2nd 2017 Lecture 8

There is no accepting computation for The string is rejected by the PDA 2nd 2017 Lecture 8

Another PDA example PDA : 2nd 2017 Lecture 8

Basic Idea: Push v on stack 3. Match on input with v on stack 2. Guess middle of input 4. Match found 2nd 2017 Lecture 8

Execution Example: Time 0 Input Stack 2nd 2017 Lecture 8

Time 1 Input Stack 2nd 2017 Lecture 8

Time 2 Input Stack 2nd 2017 Lecture 8

Time 3 Input Guess the middle of string Stack 2nd 2017 Lecture 8

Time 4 Input Stack 2nd 2017 Lecture 8

Time 5 Input Stack 2nd 2017 Lecture 8

Time 6 Input Stack accept 2nd 2017 Lecture 8

Rejection Example: Time 0 Input Stack 2nd 2017 Lecture 8

Time 1 Input Stack 2nd 2017 Lecture 8

Time 2 Input Stack 2nd 2017 Lecture 8

Time 3 Input Guess the middle of string Stack 2nd 2017 Lecture 8

Time 4 Input Stack 2nd 2017 Lecture 8

There is no possible transition. Input Time 5 There is no possible transition. Input Input is not consumed Stack 2nd 2017 Lecture 8

Another computation on same string: Input Time 0 Stack 2nd 2017 Lecture 8

Time 1 Input Stack 2nd 2017 Lecture 8

Time 2 Input Stack 2nd 2017 Lecture 8

Time 3 Input Stack 2nd 2017 Lecture 8

Time 4 Input Stack 2nd 2017 Lecture 8

Time 5 Input No accept state is reached Stack 2nd 2017 Lecture 8

There is no computation that accepts string 2nd 2017 Lecture 8

Pushing & Popping Strings Input symbol Push string 2nd 2017 Lecture 8

Example: input stack top push string top pop string Replace 2nd 2017 Lecture 8

Equivalent transitions pop push 2nd 2017 Lecture 8

Another PDA example PDA 2nd 2017 Lecture 8

Execution Example: Time 0 Input Stack current state 2nd 2017 Lecture 8

Time 1 Input Stack 2nd 2017 Lecture 8

Time 3 Input Stack 2nd 2017 Lecture 8

Time 4 Input Stack 2nd 2017 Lecture 8

Time 5 Input Stack 2nd 2017 Lecture 8

Time 6 Input Stack 2nd 2017 Lecture 8

Time 7 Input Stack 2nd 2017 Lecture 8

Time 8 Input Stack accept 2nd 2017 Lecture 8

Formalities for PDAs 2nd 2017 Lecture 8

Transition function: 2nd 2017 Lecture 8

Transition function: 2nd 2017 Lecture 8

Formal Definition Pushdown Automaton (PDA) Accept states States Input alphabet Stack start symbol Transition function Initial state Stack alphabet 2nd 2017 Lecture 8

Instantaneous Description Current state Current stack contents Remaining input 2nd 2017 Lecture 8

Instantaneous Description Example: Instantaneous Description Input Time 4: Stack 2nd 2017 Lecture 8

Instantaneous Description Example: Instantaneous Description Input Time 5: Stack 2nd 2017 Lecture 8

We write: Time 4 Time 5 2nd 2017 Lecture 8

A computation: 2nd 2017 Lecture 8

For convenience we write: 2nd 2017 Lecture 8

Language of PDA Language accepted by PDA : Initial state Accept state 2nd 2017 Lecture 8

Example: PDA : 2nd 2017 Lecture 8

PDA : 2nd 2017 Lecture 8

Therefore: PDA : 2nd 2017 Lecture 8