CS 461 – Sept. 28 Section 2.2 – Pushdown Automata { 0n 1n }

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.
CS21 Decidability and Tractability
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.
CS 310 – Fall 2006 Pacific University CS310 Pushdown Automata Sections: 2.2 page 109 October 11, 2006.
CS 310 – Fall 2006 Pacific University CS310 Pushdown Automata Sections: 2.2 page 109 October 9, 2006.
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.
January 14, 2015CS21 Lecture 51 CS21 Decidability and Tractability Lecture 5 January 14, 2015.
Pushdown Automaton (PDA)
1 Pushdown Stack Automata Zeph Grunschlag. 2 Agenda Pushdown Automata Stacks and recursiveness Formal Definition.
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.
Fall 2005Costas Busch - RPI1 Pushdown Automata PDAs.
1 Pushdown Automata PDAs. 2 Pushdown Automaton -- PDA Input String Stack States.
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.
CSCI 2670 Introduction to Theory of Computing September 21, 2005.
CS 461 – Sept. 26 CFG correctness Section 2.2 – Pushdown Automata.
Pushdown Automata CS 130: Theory of Computation HMU textbook, Chap 6.
Lecture Pushdown Automata. stack stack head finite control tape head tape.
1 CD5560 FABER Formal Languages, Automata and Models of Computation Lecture 11 Midterm Exam 2 -Context-Free Languages Mälardalen University 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.
CSCI 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 Chapter Pushdown Automata. 2 Section 12.2 Pushdown Automata A pushdown automaton (PDA) is a finite automaton with a stack that has stack operations.
Theory of Computation Automata Theory Dr. Ayman Srour.
Transparency No. 1 Formal Language and Automata Theory Homework 6.
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.
Formal Languages, Automata and Models of Computation
Pushdown Automata.
CSE 105 theory of computation
Pushdown Automata (PDA). Part 2
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata.
PUSHDOWN AUTOMATA. PUSHDOWN AUTOMATA Hierarchy of languages Regular Languages  Finite State Machines, Regular Expression Context Free Languages 
Theory of Computation Lecture #27-28.
AUTOMATA THEORY VI.
Pushdown Automata PDAs
Pushdown Automata.
Pushdown Automata (PDA). Part 3
Principles of Computing – UFCFA3-30-1
Intro to Theory of Computation
Pushdown automata and CFG ↔ PDA conversions
فصل دوم Context-Free Languages
CS322D Tutorials.
Pushdown Automaton (PDA)
Chapter 2 Context-Free Language - 01
CSE 105 theory of computation
… NPDAs continued.
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,
Teori Bahasa dan Automata Lecture 10: Push Down Automata
CSE 105 theory of computation
Normal Forms for Context-free Grammars
CSE 105 theory of computation
Presentation transcript:

CS 461 – Sept. 28 Section 2.2 – Pushdown Automata { 0n 1n } Palindromes Equal Next: Converting CFG  PDA

{ 0n 1n } While reading 0s, push them. If you read 1, change state. Then, as you read 1s, pop 0s off the stack. Watch out for bad input! Unspecified transition  crash (reject) Now, let’s write this in the form of a table.

POP & Go to state “reading 1” PDA δ for { 0n 1n } State Reading 0 Reading 1 Tos (don’t care) Empty Input 1 Action Push 0 POP & Go to state “reading 1” Crash Pop Notes: Action depends on input symbol AND what’s on top of stack. Action includes manipulating stack AND/OR changing state.

Example #2 { w # wR } (easier form of palindrome) Let’s design a PDA that accepts its input by empty stack, as before. Think about: state, top-of-stack, input, action

PDA δ for { w # wR } Before # After # (don’t care) 1 # State Tos Input 1 Input # Action Push 0 Push 1 Go to “after #” Pop Crash

Palindrome PDA? Before # After # (don’t care) 1 # State Tos Input 1 Input # Action Push 0 Push 1 Go to “after #” Pop Crash Changes needed: Non-deterministically go to “after #” when you push 0 or 1. Also, non-deterministically don’t push, in case we are dealing with odd-length palindrome!

Other examples Think about these “equal” language More 1s than 0s. How many states do we need? … More 1s than 0s. Twice as many 1s as 0s. Hint: think of the 0s as counting double.

Equal PDA State (Just one state) Tos ε 1 Input Action Push 0 Push 1 1 Input Action Push 0 Push 1 Pop