CSCI 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Variants.

Slides:



Advertisements
Similar presentations
Restricted Machines Presented by Muhannad Harrim.
Advertisements

Turing Machines Memory = an infinitely long tape Persistent storage A read/write tape head that can move around the tape Initially, the tape contains only.
Variants of Turing machines
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
Foundations of (Theoretical) Computer Science Chapter 3 Lecture Notes (Section 3.2: Variants of Turing Machines) David Martin With.
Turing Machines (At last!). Designing Universal Computational Devices Was Not The Only Contribution from Alan Turing… Enter the year 1940: The world is.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Variants.
CS605 – The Mathematics and Theory of Computer Science Turing Machines.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
Complexity ©D.Moshkovitz 1 Turing Machines. Complexity ©D.Moshkovitz 2 Motivation Our main goal in this course is to analyze problems and categorize them.
CS5371 Theory of Computation Lecture 11: Computability Theory II (TM Variants, Church-Turing Thesis)
CS 310 – Fall 2006 Pacific University CS310 Turing Machines Section 3.1 November 6, 2006.
Lecture 5 Turing Machines
CS5371 Theory of Computation Lecture 10: Computability Theory I (Turing Machine)
Computability and Complexity 3-1 Turing Machine Computability and Complexity Andrei Bulatov.
January 28, 2015CS21 Lecture 101 CS21 Decidability and Tractability Lecture 10 January 28, 2015.
Chapter 9 Turing Machine (TMs).
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Section 11.4 Language Classes Based On Randomization
More Theory of Computing
Theory of Computing Lecture 15 MAS 714 Hartmut Klauck.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong DFA to regular.
CSCI 2670 Introduction to Theory of Computing September 28, 2005.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
Dale Roberts Department of Computer and Information Science, School of Science, IUPUI CSCI 230 Models of Computation - Turing Machines Dale Roberts, Lecturer.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Turing Machines.
::ICS 804:: Theory of Computation - Ibrahim Otieno SCI/ICT Building Rm. G15.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Turing.
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Part 1 – Pages COMPUTABILITY THEORY.
1 Turing Machines Reading: Chapter 8. 2 Turing Machines are… Very powerful (abstract) machines that could simulate any modern day computer (although very,
CSE 3813 Introduction to Formal Languages and Automata Chapter 10 Other Models of Turing Machines These class notes are based on material from our textbook,
The Church-Turing Thesis Chapter 3 Giorgi Japaridze Theory of Computability.
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Turing Machines.
Lecture 3: Count Programs, While Programs and Recursively Defined Functions 虞台文 大同大學資工所 智慧型多媒體研究室.
CMSC 104, Lecture 061 Stored Programs A look at how programs are executed.
1 Turing Machines and Equivalent Models Section 13.1 Turing Machines.
CSCI 3130: Formal languages and automata theory Tutorial 7 Chin.
Overview of the theory of computation Episode 3 0 Turing machines The traditional concepts of computability, decidability and recursive enumerability.
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
1 Introduction to Turing Machines
Umans Complexity Theory Lectures Lecture 1b: Turing Machines & Halting Problem.
1 8.4 Extensions to the Basic TM Extended TM’s to be studied: Multitape Turing machine Nondeterministic Turing machine The above extensions make no increase.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Decidable.
The Church-Turing Thesis
CS6800 Advance Theory of Computation Spring 2016 Nasser Alsaedi
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Undecidable.
CSCI 2670 Introduction to Theory of Computing November 15, 2005.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Polynomial.
More variants of Turing Machines
CSCI 2670 Introduction to Theory of Computing
Polynomial time The Chinese University of Hong Kong Fall 2010
CSE 105 theory of computation
CSCI 2670 Introduction to Theory of Computing
CSE 105 theory of computation
Reducibility The Chinese University of Hong Kong Fall 2010
The Processor and Machine Language
Chapter 9 TURING MACHINES.
Chapter 3: The CHURCH-Turing thesis
Decidable and undecidable languages
More undecidable languages
Variants of Turing Machines
CSE 105 theory of computation
Variants of Turing machines
CSE 105 theory of computation
Presentation transcript:

CSCI 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Variants of Turing Machines Fall 2010

The Church-Turing Thesis “On Computable Numbers, with an Application to the Entscheidungsproblem” 1936: Section 9. The extent of the computable numbers All arguments [for the CT Thesis] which can be given are bound to be, fundamentally, appeals to intuition, and for this reason rather unsatisfactory mathematically. The arguments which I shall use are of three kinds: 1. A direct appeal to intuition 2. A proof of the equivalence of two definitions (In case the new definition has greater intuitive appeal) 3. Giving examples of large classes of numbers [languages] which are computable.

The multitape Turing Machine The transition may depend on the contents of all the cells Different tape heads can be moved independently control tape 1 … 010 tape 2 … 01 tape 3 … 100

The multitape Turing Machine Multiple tapes are convenient, e.g. one can serve as temporary storage … 010 … 01 … 100 … 110 … 100 q3q3 q7q7 0/1R☐/1R0/0L0/1R☐/1R0/0L … 011

The multitape Turing Machine Multitape Turing Machines are equivalent to single-tape Turing Machines M … 010 … 01 … 100  = {0, 1, ☐ } S … 01010##0#10   ’ = {0, 1, ☐, 0, 1, ☐, #}   #

Simulating a multitape TM We show how to simulate a multitape TM on an ordinary (single tape TM) To be specific, let’s do a 3-tape TM … x1x1 x2x2 xaxa xixi …… … y1y1 y2y2 ybyb yjyj …… z1z1 zczc zkzk … … Multitape TM Single-tape TM #x 1 x 2...x a...x i #y 1 y 2...y b...y j #z 1 z 2...z c...z k #  

Simulating a multitape TM Single-tape TM: Initialization … 010###  #  … 010 #w 1 w 2...w n # ☐ # ☐ #    w 1 w 2...w n S:S: On input w 1...w n : Replace tape contents by #w 1 w 2...w n # ☐ # ☐ #    1. Remember that M is in state q 0

Simulating a multitape TM Single-tape TM: Simulating Multitape TM moves Suppose Multitape TM wants to move like this: q3q3 0/1R ☐ /1R 0/0L q7q7 … … … … … … We simulate move on single-tape TM like this: 01010##0#10  # 01010##0#10  #

Simulating a multitape TM S:S: On input w 1...w n : Replace tape contents by #w 1 w 2...w n # ☐ # ☐ #    1. To simulate a step of M : 2. qiqi x/x’A y/y’B z/z’C qjqj Remember (in state) that M is in state q 0 #x 1 x 2...x...x i #y 1 y 2...y...y j #z 1 z 2...z...z k #   Make a pass over tape to find x, y, z   If M is in state q i and has transition update state / tape accordingly. If M reaches accept (reject) state, accept (reject). 3.

Doing simulations To simulate a model M by another model N : 1. Say how the state and storage of N is used to represent the state and storage of M 2. Say what should be initially done to convert the input of N (if anything) 3. Say how each transition of M can be implemented by a sequence of transitions of N

CPU registers R0R0 R1R1 R2R2 R3R3 arithmetic logical unit 0000 PC What does a computer look like? data memory instruction memory

What does a computer look like? CPU registers R0R0 R1R1 R2R2 R3R3 data memory instruction memory arithmetic logical unit PC 0000 load write R store R add R jpos

Instruction set load x load R k store R k read R k write R k jump n jpos n Put the value x into R 0 add R k Copy the value of R k into R 0 Copy the value of R 0 into R k Copy the value at memory location R k into R 0 Copy the value of R 0 into memory location R k Add R 0 and R k, and put result in R 0 Set PC to n Set PC to n, if R 0 is positive jzero n Set PC to n, if R 0 is zero

Random access machines load -7 R 0 := -7 write R2 M[R 2 ] := R 0 store R1 R 1 := R 0 add R1 R 0 := R 0 + R 5 jzero 3 if R 0 = 0 then PC := 3 accept instructionmeaning PC 0 R0R0 0 R1R1 0 R2R2 2 M program counter registers memory … It has registers that can store integer values, a program counter, and a random-access memory

Random access machines load 7 R 0 := 7 write R2 M[R 2 ] := R 0 store R1 R 1 := R 0 add R1 R 0 := R 0 + R 1 jzero 3 if R 0 = 0 then PC := 3 accept instructionmeaning PC 0 R0R0 0 R1R1 0 R2R2 0 M … The instructions are indexed by the program counter Initially, the input is in the first k memory cells, all registers and PC are set to 0

Random access machines Simulating a Turing Machine on a RAM: Random access machines are equivalent to Turing Machines PC 2 R0R0 1 M 2100 … M … 211  = {0, 1, 2,..., k} head tape blank

Simulating a TM on a RAM store R1 handle for state q 0 0 store R1 handle for state q 1 … … accept handle for state q acc M q0q0 q1q1 1/2R … 211 store R1 save head position read R1 read tape contents x add -1 jzero 6 if x = 1 goto line 6 load 2 new value of cell write R1 write in memory load R1 recall head position add 1 move head to right jump 30 go to state q 1 program 0 PC 0 R0R0 1 M 21 0 R1R1

Simulating a TM on a RAM store R1 handle for state q 0 0 store R1 handle for state q 1 … 30 M q0q0 q1q1 1/2R … R0R0 1 M 21 store R1 save head position read R1 read tape contents x add -1 jzero 6 if x = 1 goto line 6 load 2 new value of cell write R1 write in memory load R1 recall head position add 1 move head to right jump 30 go to state q 1 program 0 R1R (head) (tape) … 2

Simulating a RAM on a Turing Machine The configuration of a RAM consists of –Program counter –Contents of registers –Indices and contents of all nonempty memory cells 14 PC 3 R0R0 17 R1R1 5 R2R2 2 M … configuration = (14, 3, 17, 5, (0, 2), (2, 1), (3, 2)) 0

Simulating a RAM on a 2-tape TM The TM has a simulation tape and a scratch tape The simulation tape stores RAM configuration The TM has a set of states corresponding to each program instruction of the RAM The TM tape is updates according to RAM instruction (14,3,17,5,(0,2),(2,1),(3,2)) M

Simulating a RAM on a 2-tape TM Initialization S:S: On input w 1...w n : Replace tape contents by (0, 0, 0,..., 0, (0, w 1 ), (1, w 2 ),..., (n-1, w n )) 1. TM input: RAM initial state: 0 PC 0 R0R0 1 M

Simulating a RAM on a 2-tape TM Example: load R1 (14,3,17,5,(0,2),(2,1),(3,2)) 2. Write R 1 to conf tape c 1. Copy R 1 to scratch tape 17 s (14,1,17,5,(0,2),(2,1),(3,2)) 17 c s (14,1,17,5,(0,2),(2,1),(3,2) ) c c.. Make more space as needed (14,17,17,5,(0,2),(2,1),(3,2)) c 3. Erase scratch tape 4. Update PC (15,17,17,5,(0,2),(2,1),(3,2)) c

Simulating a RAM on a 2-tape TM S:S: On input w 1...w n : Replace tape contents by (0, 0, 0,..., 0, (0, w 1 ), (1, w 2 ),..., (n-1, w n )) Simulate instruction in RAM program by a sequence of TM transitions See notes for details. 3. If RAM instruction is accept, go to accept state. If RAM instruction is reject, go to reject state.