INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.

Slides:



Advertisements
Similar presentations
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.
Advertisements

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Variants of Turing machines
THE CHURCH-TURING T H E S I S “ TURING MACHINES” Pages COMPUTABILITY THEORY.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Foundations of (Theoretical) Computer Science Chapter 3 Lecture Notes (Section 3.2: Variants of Turing Machines) David Martin With.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Variants.
INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011.
Applied Computer Science II Chapter 3 : Turing Machines Prof. Dr. Luc De Raedt Institut für Informatik Albert-Ludwigs Universität Freiburg Germany.
More Turing Machines Sipser 3.2 (pages ). CS 311 Fall Multitape Turing Machines Formally, we need only change the transition function to.
1 Introduction to Computability Theory Lecture11: Variants of Turing Machines Prof. Amos Israeli.
More Turing Machines Sipser 3.2 (pages ).
Prof. Busch - LSU1 Decidable Languages. Prof. Busch - LSU2 Recall that: A language is Turing-Acceptable if there is a Turing machine that accepts Also.
CS 302: Discrete Math II A Review. An alphabet Σ is a finite set (e.g., Σ = {0,1}) A string over Σ is a finite-length sequence of elements of Σ For x.
CS5371 Theory of Computation Lecture 11: Computability Theory II (TM Variants, Church-Turing Thesis)
Programming the TM qa  (,q) (,q) q1q1 0q1q1 R q1q1 1q1q1 R q1q1  h  Qa  (,q) (,q) q1q1 0q2q2  q1q1 1q3q3  q1q1  h  q2q2 0q4q4 R q2q2 1q4q4.
Lecture 5 Turing Machines
Computation Theory Introduction to Turing Machine.
CS 490: Automata and Language Theory Daniel Firpo Spring 2003.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 5 Reducibility Contents Undecidable Problems from Language Theory.
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.
CSCI 4325 / 6339 Theory of Computation Zhixiang Chen Department of Computer Science University of Texas-Pan American.
Introduction to CS Theory Lecture 15 –Turing Machines Piotr Faliszewski
Computability Construct TMs. Decidability. Preview: next class: diagonalization and Halting theorem.
Turing Machines. Intro to Turing Machines A Turing Machine (TM) has finite-state control (like PDA), and an infinite read-write tape. The tape serves.
1 More About Turing Machines “Programming Tricks” Restrictions Extensions Closure Properties.
CSCI 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Variants.
1 Turing Machines Reading: Chapter 8. 2 Turing Machines are… Very powerful (abstract) machines that could simulate any modern day computer (although very,
Computability Chapter 5. Overview  Turing Machine (TM) considered to be the most general computational model that can be devised (Church-Turing thesis)
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,
1Computer Sciences Department. Book: INTRODUCTION TO THE THEORY OF COMPUTATION, SECOND EDITION, by: MICHAEL SIPSER Reference 3Computer Sciences Department.
CSC 3130: Automata theory and formal languages Andrej Bogdanov The Chinese University of Hong Kong Turing Machines.
CS 461 – Nov. 7 Decidability concepts –Countable = can number the elements  –Uncountable = numbering scheme impossible  –A TM undecidable –Language classes.
Turing -Recognizable vs. -Decidable
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
Transparency No. P3C2-1 Formal Language and Automata Theory PART III Chapter 2 Other Equivalent models of Standard Turing machine.
Automata & Formal Languages, Feodor F. Dragan, Kent State University 1 CHAPTER 3 The Church-Turing Thesis Contents Turing Machines definitions, examples,
Umans Complexity Theory Lectures Lecture 1b: Turing Machines & Halting Problem.
Turing Machines Sections 17.6 – The Universal Turing Machine Problem: All our machines so far are hardwired. ENIAC
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.
The Church-Turing Thesis
The Church-Turing Thesis Chapter Are We Done? FSM  PDA  Turing machine Is this the end of the line? There are still problems we cannot solve:
FORMAL LANGUAGES, AUTOMATA, AND COMPUTABILITY * Read chapter 4 of the book for next time * Lecture9x.ppt.
Universal Turing Machine
Theory of Computational Complexity TA : Junichi Teruyama Iwama lab. D3
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.
Chapters 11 and 12 Decision Problems and Undecidability.
CSCI 3130: Formal languages and automata theory Andrej Bogdanov The Chinese University of Hong Kong Polynomial.
Recursively Enumerable Languages
Reductions Costas Busch - LSU.
CSE 105 theory of computation
CSCI 2670 Introduction to Theory of Computing
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
فصل سوم The Church-Turing Thesis
Intro to Theory of Computation
Decidable Languages Costas Busch - LSU.
Decidability and Undecidability
CSE 105 theory of computation
Variants of Turing machines
Intro to Theory of Computation
CSE 105 theory of computation
Presentation transcript:

INHERENT LIMITATIONS OF COMPUTER PROGRAMS CSci 4011

TURING MACHINE FINITE STATE CONTROL INFINITE TAPE INPUT q0q0 q1q1 A

A TM decides a language if it accepts all strings in the language and rejects all strings not in the language A language is called decidable or recursive if some TM decides it A TM recognizes a language if it accepts all (and only) strings in the language.

Theorem: If L is decidable then so is its negation. Proof: Let M = (Q, , , ,q 0,q accept,q reject ) decide L. We construct M’ that decides ¬L. M’ = (Q, , , ,q 0,q reject,q accept ), i.e. M with q reject and q accept swapped. Suppose that w ∈ L. Then M’ rejects w, since M will go to q accept on w. Suppose that w  L. Then M’ accepts w, since M will go to q reject on w.

Theorem: If L 1 and L 2 are decidable then so is L 1 ∩ L 2 = { w | w ∈ L 1 and w ∈ L 2 }. Proof: Let M 1 decide L 1 and M 2 decide L 2. We build a two-tape TM M’ to decide L 1 ∩ L 2.

MULTITAPE TURING MACHINES  : Q  Γ k → Q  Γ k  {L,R,S} k FINITE STATE CONTROL

Theorem: If L 1 and L 2 are decidable then so is L 1 ∩ L 2 = { w | w ∈ L 1 and w ∈ L 2 }. Proof: Let M 1 decide L 1 and M 2 decide L 2. We build a two-tape TM M’ to decide L 1 ∩L 2. M’ works as follows: 1. Copy the input to tape 2 and move to left edge 2. Run M 1 on tape 1 and M 2 on tape 2. If either M 1 or M 2 reject, go to q reject If both M 1 and M 2 accept, go to q accept

Formally, let M i = (Q i, ,  i,  i,q s i,q a i,q r i ). Then M’ = (Q, , , ,q 0,q a,q r ), where: Q = Q 1 Q 2 ∪ Q cp,  =  1 ∪  2 ∪  cp,  ((q 1,q 2 ),s 1,s 2 ) = (q r,s 1,s 2,S,S), if q 1 = q 1 r or q 2 = q 2 r (q a,s 1,s 2,S,S), if q 1 = q 1 a and q 2 = q 2 a ((q 1 ’,q 2 ’),s 1 ’,s 2 ’,d 1,d 2 ), else ((q 1,q 2 ’),s 1,s 2 ’,S,d 2 ), if q 1 =q 1 a ((q 1 ’,q 2 ),s 1 ’,s 2,d 1,S), if q 2 =q 2 a where (q i ’,s i ’,d i ) =  i (q i,s i )

Theorem: Every Multitape Turing Machine can be transformed into a single tape Turing Machine FINITE STATE CONTROL # # #

SIMULATING MULTIPLE TAPES 1. “Format” tape. 3. If a tape head goes off right end, insert blank. If tape head goes off left end, move back right. Scan left-to-right, finding current symbols Scan left-to-right, writing new symbols Scan left-to-right, moving each tape head. 2. For each move of the k-tape TM: L#100#□#□#R qiqi q i1 q i1□ q i1□□ q j101RSS L#100#0#□#R L#100#0#1#R ● q jRSS 100 ● ● ● qjqj

DOUBLE UNBOUNDED TURING MACHINE FINITE STATE CONTROL UNBOUNDED TAPE INPUT

Theorem: Double Unbounded Turing Machines are equivalent to ordinary Turing Machines Proof: To simulate ordinary machine: To simulate a double unbounded tape: On “L” in any state, go right. Go left, write“L”, go right. Insert “L” at left edge. Write “R” at right edge. On “L” or “R” insert □.

ENUMERATORS …Are TMs with “print” and “halt” states instead of “accept” and “reject” A string w is in L(E) if E eventually goes into “print” state with w on the tape.

Terminology A TM recognizes a language if it accepts all and only those strings in the language A TM decides L if it accepts all strings in L language and rejects all strings not in L A language is called decidable or recursive if some TM decides it A language is called Turing-recognizable if some TM recognizes it A language L is called recursively enumerable if for some enumerator E, L(E) = L.

Theorem: L is Turing-recognizable ⇔ L is recursively enumerable. ⇐ : Let L be enumerated by E. We write a 2-tape TM that recognizes L. INPUT: ENUM: … … Run E on tape 2; when E goes to “print” state, Check if tape 2 = tape 1 and accept if true.

Theorem: L is Turing-recognizable ⇔ L is recursively enumerable. ⇒ : Let L be recognized by M. We can enumerate L as follows: Run M for 1 step on all strings of length ≤ 1 Run M for 2 steps on all strings of length ≤ 2 Run M for k steps on all strings of length ≤ k   Whenever M accepts on string w, print w.

A language is called Turing-recognizable or recursively enumerable if some TM recognizes it A language is called decidable or recursive if some TM decides it recursive languages r.e. languages

Theorem: If A and  A are r.e. then A is recursive Given TM M 1 that recognizes A and TM M 2 that recognizes  A, we can build a new machine that decides A: Run M 1 on tape 1, and M 2 on tape 2. accept. If M 2 accepts, reject. If M 1 accepts,

SO… TMs are equivalent to 2-stack PDAs. TMs are equivalent to cellular automata. TMs are equivalent to multitape TMs TMs are equivalent to double unbounded TMs TMs are equivalent to IDTMs. TMs are equivalent to primitive recursive functions.

THE CHURCH-TURING THESIS L is recognized by a program for some computer* ⇔ L is recognized by a TM * The computer must be “reasonable”

The Church-Turing Thesis is consistent with all known “reasonable” computers. SCRATCH: R1: R2:  RAM: 1111… … … #1011# # #...# Programs for a computer have instructions like ADD R1, R2, R3; LOAD R1, R2; STORE R1,R2; MUL R1, R2, R2; BRANCH R1, X;…

Programming languages like Java, Python, Scheme, C, … are equivalent to TMs We call such languages Turing complete. Corollary. If two programming languages are Turing complete, then they can recognize exactly the same set of languages.

We can encode a TM as a string of 0s and 1s 0 n 10 m 10 k 10 s 10 t 10 r 10 u 1… n states m tape symbols (first k are input symbols) start state accept state reject state blank symbol 〈 (p,a), (q,b,L) 〉 = 0 p 10 a 10 q 10 b 10

Since TMs and other languages are equivalent we can also express TMs as programs. Since programs are strings, we can consider languages whose elements are programs. We let 〈 M 〉 denote the encoding of TM M. Theorem. We can make a Universal TM, a TM that takes any 〈 M 〉 and any string w as input and simulates the computation of M on w.