Theory of Computation Lecture 22: Turing Machines II

Slides:



Advertisements
Similar presentations
The Turing Machine A definition of computability by Noah Richards.
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.
November 19, 2009Theory of Computation Lecture 19: Calculations on Strings IV 1 Numerical Representation of Strings Correspondingly, we define the following:
Lecture 16 Deterministic Turing Machine (DTM) Finite Control tape head.
Variants of Turing machines
October 13, 2009Theory of Computation Lecture 11: A Universal Program III 1 Coding Programs by Numbers Gödel numbers are usually very large, even for small.
Computability and Complexity 14-1 Computability and Complexity Andrei Bulatov Cook’s Theorem.
October 27, 2009Theory of Computation Lecture 12: A Universal Program IV 1Universality Then we append the following instruction: [C]IF K = Lt(Z) + 1 
December 8, 2009Theory of Computation Lecture 22: Turing Machines IV 1 Turing Machines Theorem 1.1: Any partial function that can be computed by a Post-
September 17, 2009Theory of Computation Lecture 4: Programs and Computable Functions III 1 Macros Now we want to use macros of the form: W  f(V 1, …,
Presented by Ravi Teja Pampana
December 1, 2009Theory of Computation Lecture 21: Turing Machines II 1 Simulation of L n in T We will now construct a Post-Turing program Q that simulates.
Theory of Computation, NTUEE Theory of Computation Lecture 04 Undecidability Part of the materials are from Courtesy of Prof. Peter J. Downey Department.
Theory of Computation Lecture 5: Primitive Recursive Functions I
Lecture 17 Undecidability Topics:  TM variations  Undecidability June 25, 2015 CSCE 355 Foundations of Computation.
1 Which languages do the following TM’s accept over the alphabet Σ={a, b}? Recall: A TM M accepts a language L defined over an alphabet Σ if M halts on.
Recursively Enumerable and Recursive Languages
Lecture 24UofH - COSC Dr. Verma 1 COSC 3340: Introduction to Theory of Computation University of Houston Dr. Verma Lecture 24.
December 3, 2009Theory of Computation Lecture 21: Turing Machines III 1 Simulation of T in L Now the MIDDLE section of Q can be generated by replacing.
Chapter 5 Recursive and recursively enumerable functions Phrase-structure grammars.
1 Recursively Enumerable and Recursive Languages.
Lecture # 16. Applications of Incrementing and Complementing machines 1’s complementing and incrementing machines which are basically Mealy machines are.
1 Assignment #5 is posted.. 2 An artist's rendition of a steam-powered Turing machine. There is a mural of this between the second and third floors in.
Fall 2006Costas Busch - RPI1 RE languages and Enumerators.
Turing’s Thesis.
Multi-tape TM’s Often it’s useful to have several tapes when carrying out a computations. For example, consider a two tape I/O TM for adding numbers (we.
Theory of Computation Lecture 12: A Universal Program III
Theory Of Computer Science
Busch Complexity Lectures: Reductions
Linear Bounded Automata LBAs
Reductions Costas Busch - LSU.
Theory of Computation Lecture 23: Turing Machines IV
Theory of Computation Lecture 14: A Universal Program V
Numerical Representation of Strings
Theory of Computation Lecture 22: Turing Machines III
Turing Machines 2nd 2017 Lecture 9.
CSE 105 theory of computation
Turing Machines Acceptors; Enumerators
Chapter 9 TURING MACHINES.
Theory of Computation Lecture 5: Programs and Computable Functions III
COSC 3340: Introduction to Theory of Computation
Theory of Computation Lecture 6: Primitive Recursive Functions I
Finite State Machines.
Turing acceptable languages and Enumerators
Theory Of Computer Science
Turing acceptable languages and Enumerators
The Programming Language L
Computability and Complexity
Variations of the Turing Machine
Proposed in Turing’s 1936 paper
Formal Languages, Automata and Models of Computation
Recap lecture 44 Decidability, whether a CFG generates certain string (emptiness), examples, whether a nonterminal is used in the derivation of some word.
Pairing Functions and Gödel Numbers
Theory of Computation Lecture 21: Turing Machines II
… NPDAs continued.
CSE 105 theory of computation
Numerical Representation of Strings
Diagonalization and Reducibility
Subject Name: FORMAL LANGUAGES AND AUTOMATA THEORY
The Programming Language L
Numerical Representation of Strings
Theory of Computation Lecture 4: Programs and Computable Functions II
Variants of Turing machines
DSPACE Slides By: Alexander Eskin, Ilya Berdichevsky
Kleene’s Theorem (Part-3)
Theory of Computation Lecture 6: Primitive Recursive Functions I
Theory of Computation Lecture 17: Calculations on Strings II
Theory of Computation Lecture 11: A Universal Program III
Theory of Computation Lecture 23: Turing Machines III
CSE 105 theory of computation
Presentation transcript:

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T We are going to prove the following theorem: Theorem 5.1: If f(x1, …, xm) is partially computable in Ln, then there is a Post-Turing program that computes f strictly. Proof: Let P be a program in Ln which computes f. We assume that P uses the following variables: X1, …, Xm, Z1, …, Zk, Y. So all in all there are l variables, where l = m + k + 1. Therefore, we can rename the variables as follows (while keeping their order): V1, …, Vl. May 2, 2019 Theory of Computation Lecture 22: Turing Machines II

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T We will now construct a Post-Turing program Q that simulates P step by step. Of course, the information available to Q must be put onto the tape. Therefore, we have to use a system for storing the values of all variables at certain positions on the tape: B x1 B x2 B … B xm B z1 B z2 B … B zk B y ,  where x1, x2, …, xm, z1, z2 , …, zk, y are the current values of the variables X1, X2, …, Xm, Z1, Z2 , …, Zk, Y (using the original variable names). May 2, 2019 Theory of Computation Lecture 22: Turing Machines II

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T An advantage of this system is that the initial tape configuration is already in the correct form: B x1 B x2 B … B xm .  What needs to be done now is to show how to program the effect of each instruction type of Ln in the language T. In the following, we will define some macros that will help us to do this task. May 2, 2019 Theory of Computation Lecture 22: Turing Machines II

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T The macro GOTO L has the expansion IF s0 GOTO L // Remember: s0 = B IF s1 GOTO L : IF sn GOTO L May 2, 2019 Theory of Computation Lecture 22: Turing Machines II

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T The macro RIGHT TO NEXT BLANK has the expansion [A] RIGHT IF B GOTO E GOTO A The macro LEFT TO NEXT BLANK has the expansion [A] LEFT May 2, 2019 Theory of Computation Lecture 22: Turing Machines II

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T The macro MOVE BLOCK RIGHT has the expansion [C] LEFT IF s0 GOTO A0 IF s1 GOTO A1 : IF sn GOTO An [Ai] RIGHT i = 1, 2, …, n PRINT si : LEFT : GOTO C : [A0] RIGHT PRINT B LEFT Example: s3Bs1s2B  s3Bs1s2B  s3Bs1s2s2  s3Bs1s2s2  s3Bs1s2s2  s3Bs1s2s2  s3Bs1s1s2  s3Bs1s1s2  s3Bs1s1s2  s3BBs1s2  s3BBs1s2  May 2, 2019 Theory of Computation Lecture 22: Turing Machines II

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T The macro ERASE A BLOCK has the expansion [A] RIGHT IF B GOTO E PRINT B GOTO A This program causes the head to move to the right, erasing everything between its initial position and the first blank to its right. May 2, 2019 Theory of Computation Lecture 22: Turing Machines II

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T We introduce another convention: A number in square brackets after the name of a macro indicates how many times the macro expansion is to be inserted into the program. For example, MOVE BLOCK RIGHT [4] is short for MOVE BLOCK RIGHT MOVE BLOCK RIGHT MOVE BLOCK RIGHT MOVE BLOCK RIGHT May 2, 2019 Theory of Computation Lecture 22: Turing Machines II

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T Now we can start simulating the three instruction types in the language Ln by Post-Turing programs. We begin the instruction type Vj  siVj . In order to place the symbol si to the left of the j-th variable on the tape, the values of the variables Vj, …, Vl must all be moved one square to the right to make room. After inserting si the tapehead must go back to the blank at the left of the value of V1 in order to be ready for the next simulated instruction. May 2, 2019 Theory of Computation Lecture 22: Turing Machines II

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T Here is the program for the simulation of Vj  siVj: RIGHT TO NEXT BLANK [ l ] MOVE BLOCK RIGHT [ l – j + 1 ] RIGHT PRINT si LEFT TO NEXT BLANK [ j ] May 2, 2019 Theory of Computation Lecture 22: Turing Machines II

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T Now we want to show how to simulate Vj  Vj- . The problem here is that if Vj contains the null string, it must be left unchanged. Thus, we move to the blank immediately to the right of the value of Vj. Then we move one step to the left, and if we find another blank there, Vj must contain the null string (indicated by two successive blanks). May 2, 2019 Theory of Computation Lecture 22: Turing Machines II

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T Here is the program for the simulation of Vj  Vj- : RIGHT TO NEXT BLANK [ j ] LEFT IF B GOTO C // Vj contains null string MOVE BLOCK RIGHT [ j ] RIGHT GOTO E [C] LEFT TO NEXT BLANK [ j - 1 ] May 2, 2019 Theory of Computation Lecture 22: Turing Machines II

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T And finally, here is the program for the simulation of IF Vj ENDS si GOTO L: RIGHT TO NEXT BLANK [ j ] LEFT IF si GOTO C // Vj ends in si GOTO D [C] LEFT TO NEXT BLANK [ j ] GOTO L // Note: transfer all labels from Ln to T [D] RIGHT // Vj could contain null string LEFT TO NEXT BLANK [ j ] May 2, 2019 Theory of Computation Lecture 22: Turing Machines II

Theory of Computation Lecture 22: Turing Machines II Simulation of Ln in T Now we are able to translate any program in the language Ln into a corresponding program in T. There is only one thing that needs to be fixed: After the program terminates, we want only the string y to remain on the tape as the program’s output. This can be done by appending the following code to our generated T program: ERASE A BLOCK [ l – 1 ] This will erase the values of the first l – 1 variables on the tape, so only the last variable will remain and the final tape configuration will be … B B B y B B B …  May 2, 2019 Theory of Computation Lecture 22: Turing Machines II