Theory of Computation Lecture #27-28.

Slides:



Advertisements
Similar presentations
Chapter 5 Pushdown Automata
Advertisements

Pushdown Automata Section 2.2 CSC 4170 Theory of Computation.
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
Pushdown Automata CPSC 388 Ellen Walker Hiram College.
CS21 Decidability and Tractability
COMMONWEALTH OF AUSTRALIA Copyright Regulations 1969 WARNING This material has been reproduced and communicated to you by or on behalf of Monash University.
Introduction to Computability Theory
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.
Courtesy Costas Busch - RPI1 NPDAs Accept Context-Free Languages.
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.
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.
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.
Pushdown Automata CS 130: Theory of Computation HMU textbook, Chap 6.
Pushdown Automata (PDAs)
Lecture # 28 Theory Of Automata By Dr. MM Alam 1.
Push-down Automata Section 3.3 Fri, Oct 21, 2005.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
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.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Chapter 2 Context-Free Languages Some slides are in courtesy.
Lecture 11  2004 SDU Lecture7 Pushdown Automaton.
CSCI 2670 Introduction to Theory of Computing September 22, 2004.
Formal Languages, Automata and Models of Computation
Pushdown Automata.
Theory of Computation Pushdown Automata pda Lecture #10.
CSE 105 theory of computation
Deterministic FA/ PDA Sequential Machine Theory Prof. K. J. Hintz
CSE 105 theory of computation
Pushdown Automata PDAs
Push-down Automata Section 3.3 Wed, Oct 27, 2004.
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata PDAs
Pushdown Automata.
Push-down Automata.
AUTOMATA THEORY VI.
Pushdown Automata.
COSC 3340: Introduction to Theory of Computation
NPDAs Accept Context-Free Languages
Principles of Computing – UFCFA3-30-1
Context-Free Grammars
Context-Free Languages
فصل دوم Context-Free Languages
Pushdown automata a_introduction.htm.
Chapter 2 Context-Free Language - 01
CSE 105 theory of computation
Principles of Computing – UFCFA3-30-1
… NPDAs continued.
CSE 105 theory of computation
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,
Recap lecture 40 Recap of example of PDA corresponding to CFG, CFG corresponding to PDA. Theorem, HERE state, Definition of Conversion form, different.
CSE 105 theory of computation
COSC 3340: Introduction to Theory of Computation
Normal Forms for Context-free Grammars
CSE 105 theory of computation
CSE 105 theory of computation
Presentation transcript:

Theory of Computation Lecture #27-28

PDA A pushdown automata (PDA) is basically an Є-NFA with a stack. On a transition, the PDA: 1. Consumes an input symbol. 2. Goes to a new state (or stays in the old). 3. Replaces the top of the stack by any string (does nothing, pops the stack, or pushes a string onto the stack)

PDA PDAs are like NFAs but have an extra component called a stack The stack provides additional memory beyond the finite amount available in the control The stack allows PDA to recognize some non-regular languages

PDA

PDA and CFG PDA are equivalent in specification power with CFG This is useful because it gives us two options for proving that a language is context-free: 1. construct a CFG that generates the language or 2. construct a PDA that recognizes the language

A PDA is described by Γ Gamma Symbol

Pushdown Automaton -- PDA Input String Stack States

Initial Stack Symbol Stack Stack stack head top bottom special symbol Appears at time 0

The States Push symbol Input symbol Pop symbol

Push Down Automata An NFA with a stack Can be used to represent Context free languages

Example anbn

PDA A PDA is a collection of

Input Tape

States

States

State Representation

State Representation

Stack

Example FA that accepts all words ending in the letter a

Example

Example FA that contains at least a double aa

Example PDA that contains at least a double aa

Stack Operations

anbn Test - aaabbb Test aaabbb

Example

Equivalent Machine is Try the strings: 1). aaabbbb 2). aaaabbb

Example of all states a^nb^n

Definition

Example CFG is CFG is

Example Cont…

Palindrome Let us introduce the PALINDROMEX, language of all words of the form s X reverse(s) where s is any string in (a + b)* The words in this language are { X,aXa, bXb, aaXaa, abXba, baXab, bbXbb, aaaXaaa, aabXbaa . . . } Odd palindrome

Palindrome Machine Start can be like this Start can be like this

Palindrome Machine Start can be like this

Palindrome Machine (Odd Palindrome) For odd palindrome (Guess middle alphabet) . The problem here is that the middle letter does not stand out, so it is harder to recognize where the first half ends and the second half begins. In fact, it‘s not only harder; it's impossible For odd palindrome (Guess middle alphabet) . The problem here is that the middle letter does not stand out, so it is harder to recognize where the first half ends and the second half begins. In fact, it‘s not only harder; it's impossible

Palindrome Machine (even Palindrome)

Palindrome Machine (even Palindrome)

PDA accepts language from following CFG + before read and after read mean don’t change +. Same is for *

Example

Assignment Solve Question # of book 1, 2, 3, 5 at page 370

Another CFG to NPDA Example Equivalent PDA /NPDA is Equivalent PDA /NPDA is Input tape contains non termainals

Another CFG to NPDA Example Equivalent PDA /NPDA is Equivalent PDA /NPDA is For SB first bush B then S because stack uses LIFO

Another CFG to NPDA Example NON-DETERMINISM

Assignment Solve Questions 1,2,3,4,5 at page 424

Chomsky Normal Form

Chomsky Normal Form

Chomsky Normal Form