Pushdown Automata PDAs

Slides:



Advertisements
Similar presentations
Pushdown Automata Section 2.2 CSC 4170 Theory of Computation.
Advertisements

Costas Busch - RPI1 Pushdown Automata PDAs. Costas Busch - RPI2 Pushdown Automaton -- PDA Input String Stack States.
Courtesy Costas Busch - RPI1 Non Deterministic Automata.
1 … NPDAs continued. 2 Pushing Strings Input symbol Pop symbol Push string.
Courtesy Costas Busch - RPI1 Pushdown Automata PDAs.
Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automata And Regular Languages.
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 NPDA’s Accept Context-Free Languages.
Courtesy Costas Busch - RPI1 Turing Machines. Courtesy Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
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.
Fall 2006Costas Busch - RPI1 Non-Deterministic Finite Automata.
Costas Busch - RPI1 Turing Machines. Costas Busch - RPI2 The Language Hierarchy Regular Languages Context-Free Languages ? ?
Costas Busch - RPI1 CSCI-2400 Models of Computation.
Finite Automata Costas Busch - RPI.
Fall 2006Costas Busch - RPI1 PDAs Accept Context-Free Languages.
Costas Busch - LSU1 Non-Deterministic Finite Automata.
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.
1 Non-Deterministic Finite Automata. 2 Alphabet = Nondeterministic Finite Automaton (NFA)
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 8 Mälardalen University 2010.
Pushdown Automata CS 130: Theory of Computation HMU textbook, Chap 6.
Fall 2006Costas Busch - RPI1 Deterministic Finite Automaton (DFA) Input Tape “Accept” or “Reject” String Finite Automaton Output.
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.
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.
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.
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.
Formal Languages, Automata and Models of Computation
Theory of Computation Pushdown Automata pda Lecture #10.
G. Pullaiah College of Engineering and Technology
PDAs Accept Context-Free Languages
NPDAs Accept Context-Free Languages
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
Pushdown Automata (PDA). Part 3
NPDAs Accept Context-Free Languages
Principles of Computing – UFCFA3-30-1
CSCI-2400 Models of Computation Costas Busch - RPI.
Deterministic Finite Automata And Regular Languages Prof. Busch - LSU.
Non-Deterministic Finite Automata
Non-Deterministic Finite Automata
CSE322 Definition and description of finite Automata
CS322D Tutorials.
… NPDAs continued.
Pushdown automata The Chinese University of Hong Kong Fall 2011
Formal Definitions for Turing Machines
Non Deterministic Automata
Normal Forms for Context-free Grammars
Presentation transcript:

Pushdown Automata PDAs Costas Busch - RPI

Pushdown Automaton -- PDA Input String Stack States Costas Busch - RPI

Formal Definition Non-Deterministic Pushdown Automaton NPDA Final states States Input alphabet Stack start symbol Transition function Initial state Stack alphabet Costas Busch - RPI

Initial Stack Symbol Stack Stack stack head top bottom special symbol Costas Busch - RPI

The States Pop symbol Input symbol Push symbol Costas Busch - RPI

input stack top Replace Costas Busch - RPI

input stack top Push Costas Busch - RPI

input stack top Pop Costas Busch - RPI

input stack top No Change Costas Busch - RPI

A Possible Transition input stack empty Pop top Costas Busch - RPI

The automaton Halts in state and Rejects the input string A Bad Transition input Empty stack HALT The automaton Halts in state and Rejects the input string Costas Busch - RPI

The automaton Halts in state and Rejects the input string A Bad Transition input Empty stack HALT The automaton Halts in state and Rejects the input string Costas Busch - RPI

No transition is allowed to be followed When the stack is empty Empty stack Costas Busch - RPI

A Good Transition input stack Pop top Costas Busch - RPI

Non-Determinism These are allowed transitions in a Non-deterministic PDA (NPDA) Costas Busch - RPI

NPDA: Non-Deterministic PDA Example: Costas Busch - RPI

Execution Example: Time 0 Input Stack current state Costas Busch - RPI

Time 1 Input Stack Costas Busch - RPI

Time 2 Input Stack Costas Busch - RPI

Time 3 Input Stack Costas Busch - RPI

Time 4 Input Stack Costas Busch - RPI

Time 5 Input Stack Costas Busch - RPI

Time 6 Input Stack Costas Busch - RPI

Time 7 Input Stack Costas Busch - RPI

Time 8 Input Stack accept Costas Busch - RPI

A string is accepted if there is a computation such that: All the input is consumed AND The last state is a final state At the end of the computation, we do not care about the stack contents Costas Busch - RPI

is accepted by the NPDA: The input string is accepted by the NPDA: Costas Busch - RPI

is the language accepted by the NPDA: In general, is the language accepted by the NPDA: Costas Busch - RPI

Another NPDA example NPDA Costas Busch - RPI

Execution Example: Time 0 Input Stack Costas Busch - RPI

Time 1 Input Stack Costas Busch - RPI

Time 2 Input Stack Costas Busch - RPI

Time 3 Input Guess the middle of string Stack Costas Busch - RPI

Time 4 Input Stack Costas Busch - RPI

Time 5 Input Stack Costas Busch - RPI

Time 6 Input Stack accept Costas Busch - RPI

Rejection Example: Time 0 Input Stack Costas Busch - RPI

Time 1 Input Stack Costas Busch - RPI

Time 2 Input Stack Costas Busch - RPI

Time 3 Input Guess the middle of string Stack Costas Busch - RPI

Time 4 Input Stack Costas Busch - RPI

There is no possible transition. Input Time 5 There is no possible transition. Input Input is not consumed Stack Costas Busch - RPI

Another computation on same string: Input Time 0 Stack Costas Busch - RPI

Time 1 Input Stack Costas Busch - RPI

Time 2 Input Stack Costas Busch - RPI

Time 3 Input Stack Costas Busch - RPI

Time 4 Input Stack Costas Busch - RPI

Time 5 Input No final state is reached Stack Costas Busch - RPI

There is no computation that accepts string Costas Busch - RPI

A string is rejected if there is no computation such that: All the input is consumed AND The last state is a final state At the end of the computation, we do not care about the stack contents Costas Busch - RPI

In other words, a string is rejected if in every computation with this string: The input cannot be consumed OR The input is consumed and the last state is not a final state The stack head moves below the bottom of the stack Costas Busch - RPI

Another NPDA example NPDA Costas Busch - RPI

Execution Example: Time 0 Input Stack Costas Busch - RPI

Time 1 Input Stack Costas Busch - RPI

Time 2 Input Stack Costas Busch - RPI

Time 3 Input Stack accept Costas Busch - RPI

Rejection example: Time 0 Input Stack Costas Busch - RPI

Time 1 Input Stack Costas Busch - RPI

Time 2 Input Stack Costas Busch - RPI

Time 3 Input Stack Costas Busch - RPI

Time 4 Input Stack Halt and Reject Costas Busch - RPI

Pushing Strings Pop symbol Input symbol Push string Costas Busch - RPI

Example: input pushed string stack top Push Costas Busch - RPI

Another NPDA example NPDA Costas Busch - RPI

Execution Example: Time 0 Input Stack current state Costas Busch - RPI

Time 1 Input Stack Costas Busch - RPI

Time 3 Input Stack Costas Busch - RPI

Time 4 Input Stack Costas Busch - RPI

Time 5 Input Stack Costas Busch - RPI

Time 6 Input Stack Costas Busch - RPI

Time 7 Input Stack Costas Busch - RPI

Time 8 Input Stack accept Costas Busch - RPI

Formalities for NPDAs Costas Busch - RPI

Transition function: Costas Busch - RPI

Transition function: Costas Busch - RPI

Formal Definition Non-Deterministic Pushdown Automaton NPDA Final states States Input alphabet Stack start symbol Transition function Initial state Stack alphabet Costas Busch - RPI