Copyright © 2011-2014 Curt Hill Other Automata Pushdown through Turing machines.

Slides:



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

C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
CFGs and PDAs Sipser 2 (pages ). Long long ago…
CS21 Decidability and Tractability
CFGs and PDAs Sipser 2 (pages ). Last time…
Introduction to Computability Theory
1 Introduction to Computability Theory Lecture7: PushDown Automata (Part 1) Prof. Amos Israeli.
1 CSCI-2400 Models of Computation. 2 Computation CPU memory.
CS 310 – Fall 2006 Pacific University CS310 Pushdown Automata Sections: 2.2 page 109 October 9, 2006.
Foundations of (Theoretical) Computer Science Chapter 2 Lecture Notes (Section 2.2: Pushdown Automata) Prof. Karen Daniels, Fall 2009 with acknowledgement.
Fall 2006Costas Busch - RPI1 Pushdown Automata PDAs.
CS5371 Theory of Computation Lecture 8: Automata Theory VI (PDA, PDA = CFG)
Costas Busch - RPI1 CSCI-2400 Models of Computation.
Fall 2006Costas Busch - RPI1 CSCI-2400 Models of Computation.
PZ03A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ03A - Pushdown automata Programming Language Design.
Grammars, Languages and Finite-state automata Languages are described by grammars We need an algorithm that takes as input grammar sentence And gives a.
Finite State Machines Data Structures and Algorithms for Information Processing 1.
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.
Language Recognizer Connecting Type 3 languages and Finite State Automata Copyright © – Curt Hill.
Pushdown Automata.
1 An Introduction to Formal Languages and Automata Provided by : Babak Salimi webAdd:
Pushdown Automata CS 130: Theory of Computation HMU textbook, Chap 6.
Pushdown Automata (PDAs)
1 INFO 2950 Prof. Carla Gomes Module Modeling Computation: Language Recognition Rosen, Chapter 12.4.
Push-down Automata Section 3.3 Fri, Oct 21, 2005.
Complexity and Computability Theory I Lecture #11 Instructor: Rina Zviel-Girshin Lea Epstein.
Models of Computation. Computation: Computation is a general term for any type of information processing information processing CPU memory.
9.7: Chomsky Hierarchy.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
PZ03A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ03A - Pushdown automata Programming Language Design.
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.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
Pushdown Automata Hopcroft, Motawi, Ullman, Chap 6.
C Sc 132 Computing Theory Professor Meiliu Lu Computer Science Department.
1 Unit – 5 : STATE MACHINES Syllabus: Languages and Grammars – Finite State Machines State machines and languages – Turing Machines – Computational Complexity.
Turing Machines CS 130 Theory of Computation HMU Textbook: Chap 8.
CS6800 Advance Theory of Computation Spring 2016 Nasser Alsaedi
Modeling Arithmetic, Computation, and Languages Mathematical Structures for Computer Science Chapter 8 Copyright © 2006 W.H. Freeman & Co.MSCS SlidesAlgebraic.
Language Recognition MSU CSE 260.
Formal Languages, Automata and Models of Computation
Pushdown Automata.
Formal Foundations-II [Theory of Automata]
CS-300 Theory of Computation 2nd Sem 2017 Lecture 1.
CSE 105 theory of computation
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Pushdown Automata PDAs
Pushdown Automata PDAs
AUTOMATA THEORY VI.
PZ03A - Pushdown automata
Modeling Computation:
CSE322 Chomsky classification
CSE322 The Chomsky Hierarchy
Jaya Krishna, M.Tech, Assistant Professor
CSCI-2400 Models of Computation Costas Busch - RPI.
Intro to Data Structures
Pushdown automata a_introduction.htm.
CSE 105 theory of computation
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Principles of Computing – UFCFA3-30-1
… NPDAs continued.
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Pushdown automata The Chinese University of Hong Kong Fall 2011
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
CSE 105 theory of computation
The Chomsky Hierarchy Costas Busch - LSU.
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
Pushdown automata Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Section
CSE 105 theory of computation
Presentation transcript:

Copyright © Curt Hill Other Automata Pushdown through Turing machines

Copyright © Curt Hill Finite State Machine We have previously seen these What can they not do? They are unable to handle the recursive nature of most programming languages Eg. C –A statement may be a for-statement –A for-statement contains a statement They cannot remember where they came from

Finite State Automata Two things (and only two things) determine the next state: –Current state –Input symbol To strengthen this we add a stack –The symbols on the stack may be different than input This results in the pushdown machine Copyright © Curt Hill

Pushdown automata The transition function now has three parameters Three things choose the next state: –Current state –Input symbol –Symbol on top of stack Any state transition may push or pop a symbol on/off the stack –Or decline to do so Copyright © Curt Hill

Pictures Copyright © Curt Hill Finite Control acba… Finite State Automaton Finite Control acba… Pushdown Automaton xyw… Input (r/o) Stack (r/w)

Transition Relation A finite state automaton has a transition function A pushdown automaton has a transition relation The parameters are: –The current input value –The current state –The top of stack The result is: –The new state –The action on the stack Copyright © Curt Hill

State Transitions The form is: (a, s, t) (s, n) a is the symbol on the input s is the state t is the top of the stack –0 means it is ignored n is the new action –0 means no action Copyright © Curt Hill

A very simple grammar V – {X} T – {a,b,c} S – X P –X ::= b –X ::= a X c This will give expressions of the form: a n bc n –b–b –aaabccc Why is this not a Type 3 grammar? Copyright © Curt Hill

Why is this not regular? The best we can do in a regular language is arbitrary string of a followed by one b and an arbitrary string of c a*bc* There is no way to force the number of as and cs to match The simple grammar above requires equal numbers Copyright © Curt Hill

Grammar State Transitions (a, s1, 0) (s1, push x) (b, s1, 0) (s2, 0) (c, s2, x) (s3, pop) (c, s3, x) (s3, pop) (c, s3, empty) (s4, 0) Copyright © Curt Hill

Graphics Copyright © Curt Hill Finite State Automata are simple –There representation is simple Push Down Automata are somewhat more complex –This makes the picture more complicated We will attempt: : a n bc n

PDA Copyright © Curt Hill s1s1 s2s2 s3s3 a,0 Push x b,0 c,x pop c,x pop s4s4 c,empty Transitions have two pieces to choose and one action –First is input, second is stack –Zero means ignore this input –Second line is action

What’s next? Turing machine A thought experiment devised by Alan Turing in 1936 –Original paper is 1937 Turing wanted to investigate what was and was not computable Copyright © Curt Hill

Description A finite state machine The input is now a tape that is infinite in both directions The finite automaton may read forward or backward as many times as desired Any symbol read may be rewritten –Not read/only like Finite State Machine or Pushdown machine Copyright © Curt Hill

In Practice and Theory In practice, this is a terrible way to make a computer In theory, there is no stronger means of computation –Strong: ability to compute a result This is one of the foundations of the theoretical computer science With the exception of the infinite storage a Turing machine is equivalent to Von Neumann machines Copyright © Curt Hill

Equivalence A CPU is a finite state machine –Very many states If we consider the memory/secondary storage as equivalent to tape the parallels should be clear –We may simulate an array with a list so random access memory is faster but not stronger than the tape Copyright © Curt Hill

Simulators There are a variety of simulators for a Turing machine on the web Here are few (2014) – – e/ e/ – ook/tmjava.htmlhttp:// ook/tmjava.html – er-turing-machine/ er-turing-machine/ Copyright © Curt Hill

Linear Bounded Recall that context sensitive languages may be handled by linear bounded automaton What is that? A Turing machine with limited tape that may make a limited number of passes through that tape Copyright © Curt Hill

Equivalences A Finite State Automaton may recognize a Type 3 or Regular Language A Push Down Automaton may recognize a Type 2 or Context Free Language A Linear Bounded Automaton may recognize a Type 1 or Context Sensitive Language A Turing Machine may recognize a Type 0 or any phrase structured language Copyright © Curt Hill