Fall 2006Costas Busch - RPI1 Pushdown Automata PDAs.

Slides:



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

Pushdown Automata CPSC 388 Ellen Walker Hiram College.
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.
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.
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.
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)
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.
Pushdown Automata (PDAs)
Fall 2006Costas Busch - RPI1 Deterministic Finite Automaton (DFA) Input Tape “Accept” or “Reject” String Finite Automaton Output.
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.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2010 with acknowledgement.
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.
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.
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.
Costas Busch - LSU1 PDAs Accept Context-Free Languages.
Formal Languages, Automata and Models of Computation
PDAs Accept Context-Free Languages
CSE 105 theory of computation
Busch Complexity Lectures: Turing Machines
NPDAs Accept Context-Free Languages
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
AUTOMATA THEORY VI.
Pushdown Automata PDAs
NPDAs Accept Context-Free Languages
Principles of Computing – UFCFA3-30-1
CSCI-2400 Models of Computation Costas Busch - RPI.
Non-Deterministic Finite Automata
CSE322 Definition and description of finite Automata
Pushdown automata a_introduction.htm.
Chapter 2 Context-Free Language - 01
CSE 105 theory of computation
… NPDAs continued.
Pushdown automata The Chinese University of Hong Kong Fall 2011
Formal Definitions for Turing Machines
CSE 105 theory of computation
Non Deterministic Automata
Normal Forms for Context-free Grammars
CSE 105 theory of computation
Presentation transcript:

Fall 2006Costas Busch - RPI1 Pushdown Automata PDAs

Fall 2006Costas Busch - RPI2 Pushdown Automaton -- PDA Input String Stack States

Fall 2006Costas Busch - RPI3 Initial Stack Symbol Stack bottomspecial symbol stack head top Appears at time 0

Fall 2006Costas Busch - RPI4 The States Input symbol Pop symbol Push symbol

Fall 2006Costas Busch - RPI5 top input stack Replace

Fall 2006Costas Busch - RPI6 Push top input stack

Fall 2006Costas Busch - RPI7 Pop top input stack

Fall 2006Costas Busch - RPI8 No Change top input stack

Fall 2006Costas Busch - RPI9 Pop top input stack Pop from Empty Stack Automaton halts! If the automaton attempts to pop from empty stack then it halts and rejects input

Fall 2006Costas Busch - RPI10 Non-Determinism PDAs are non-deterministic Allowed non-deterministic transitions

Fall 2006Costas Busch - RPI11 Example PDA PDA :

Fall 2006Costas Busch - RPI12 Basic Idea: 1.Push the a’s on the stack 2. Match the b’s on input with a’s on stack 3. Match found

Fall 2006Costas Busch - RPI13 Execution Example: Input current state Time 0 Stack

Fall 2006Costas Busch - RPI14 Input Time 1 Stack

Fall 2006Costas Busch - RPI15 Input Stack Time 2

Fall 2006Costas Busch - RPI16 Input Stack Time 3

Fall 2006Costas Busch - RPI17 Input Stack Time 4

Fall 2006Costas Busch - RPI18 Input Stack Time 5

Fall 2006Costas Busch - RPI19 Input Stack Time 6

Fall 2006Costas Busch - RPI20 Input Stack Time 7

Fall 2006Costas Busch - RPI21 Input Time 8 accept Stack

Fall 2006Costas Busch - RPI22 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

Fall 2006Costas Busch - RPI23 Rejection Example: Input current state Time 0 Stack

Fall 2006Costas Busch - RPI24 Rejection Example: Input current state Time 1 Stack

Fall 2006Costas Busch - RPI25 Rejection Example: Input current state Time 2 Stack

Fall 2006Costas Busch - RPI26 Rejection Example: Input current state Time 3 Stack

Fall 2006Costas Busch - RPI27 Rejection Example: Input current state Time 4 Stack

Fall 2006Costas Busch - RPI28 Rejection Example: Input current state Time 4 Stack reject

Fall 2006Costas Busch - RPI29 The string is rejected by the PDA There is no accepting computation for

Fall 2006Costas Busch - RPI30 Another PDA example PDA :

Fall 2006Costas Busch - RPI31 Basic Idea: 1.Push v on stack 2. Guess middle of input 3. Match on input with v on stack 4. Match found

Fall 2006Costas Busch - RPI32 Execution Example: Input Time 0 Stack

Fall 2006Costas Busch - RPI33 Input Time 1 Stack

Fall 2006Costas Busch - RPI34 Input Time 2 Stack

Fall 2006Costas Busch - RPI35 Input Time 3 Stack Guess the middle of string

Fall 2006Costas Busch - RPI36 Input Time 4 Stack

Fall 2006Costas Busch - RPI37 Input Time 5 Stack

Fall 2006Costas Busch - RPI38 Input Time 6 Stack accept

Fall 2006Costas Busch - RPI39 Rejection Example: Input Time 0 Stack

Fall 2006Costas Busch - RPI40 Input Time 1 Stack

Fall 2006Costas Busch - RPI41 Input Time 2 Stack

Fall 2006Costas Busch - RPI42 Input Time 3 Stack Guess the middle of string

Fall 2006Costas Busch - RPI43 Input Time 4 Stack

Fall 2006Costas Busch - RPI44 Input Time 5 Stack There is no possible transition. Input is not consumed

Fall 2006Costas Busch - RPI45 Another computation on same string: Input Time 0 Stack

Fall 2006Costas Busch - RPI46 Input Time 1 Stack

Fall 2006Costas Busch - RPI47 Input Time 2 Stack

Fall 2006Costas Busch - RPI48 Input Time 3 Stack

Fall 2006Costas Busch - RPI49 Input Time 4 Stack

Fall 2006Costas Busch - RPI50 Input Time 5 Stack No accept state is reached

Fall 2006Costas Busch - RPI51 There is no computation that accepts string

Fall 2006Costas Busch - RPI52 Pushing & Popping Strings Input symbol Push string Pop string

Fall 2006Costas Busch - RPI53 top input stack Replace push string Example: pop string top

Fall 2006Costas Busch - RPI54 pop push Equivalent transitions

Fall 2006Costas Busch - RPI55 Another PDA example PDA

Fall 2006Costas Busch - RPI56 Time 0 Input current state Stack Execution Example:

Fall 2006Costas Busch - RPI57 Time 1 Input Stack

Fall 2006Costas Busch - RPI58 Time 3 Input Stack

Fall 2006Costas Busch - RPI59 Time 4 Input Stack

Fall 2006Costas Busch - RPI60 Time 5 Input Stack

Fall 2006Costas Busch - RPI61 Time 6 Input Stack

Fall 2006Costas Busch - RPI62 Time 7 Input Stack

Fall 2006Costas Busch - RPI63 Time 8 Input Stack accept

Fall 2006Costas Busch - RPI64 Formalities for PDAs

Fall 2006Costas Busch - RPI65 Transition function:

Fall 2006Costas Busch - RPI66 Transition function:

Fall 2006Costas Busch - RPI67 Formal Definition Pushdown Automaton (PDA) States Input alphabet Stack alphabet Transition function Accept states Stack start symbol Initial state

Fall 2006Costas Busch - RPI68 Instantaneous Description Current state Remaining input Current stack contents

Fall 2006Costas Busch - RPI69 Input Stack Time 4: Example:Instantaneous Description

Fall 2006Costas Busch - RPI70 Input Stack Time 5: Example:Instantaneous Description

Fall 2006Costas Busch - RPI71 We write: Time 4 Time 5

Fall 2006Costas Busch - RPI72 A computation:

Fall 2006Costas Busch - RPI73 For convenience we write:

Fall 2006Costas Busch - RPI74 Language of PDA Language accepted by PDA : Initial state Accept state

Fall 2006Costas Busch - RPI75 Example: PDA :

Fall 2006Costas Busch - RPI76 PDA :

Fall 2006Costas Busch - RPI77 PDA : Therefore: