Theory of Computation Lecture 14: A Universal Program V

Slides:



Advertisements
Similar presentations
1 Turing Machines and Equivalent Models Section 13.2 The Church-Turing Thesis.
Advertisements

Primitive Recursive Functions (Chapter 3)
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.
Discrete Mathematics Lecture 5 Alexander Bukharovich New York University.
Mu-Recursive Functions
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
Discrete Mathematics Lecture 4 Harper Langston New York University.
November 17, 2009Theory of Computation Lecture 18: Calculations on Strings III 1 Numerical Representation of Strings We will now look at several primitive.
October 27, 2009Theory of Computation Lecture 12: A Universal Program IV 1Universality Then we append the following instruction: [C]IF K = Lt(Z) + 1 
November 10, 2009Theory of Computation Lecture 16: Computation on Strings I 1Diagonalization Another example: Let TOT be the set of all numbers p such.
CHAPTER 4 Decidability Contents Decidable Languages
CS 5000: Lecture 37 Vladimir Kulyukin Department of Computer Science Utah State University.
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-
October 8, 2009Theory of Computation Lecture 10: A Universal Program II 1 Pairing Functions and Gödel Numbers This way the equation  x, y  = z defines.
September 24, 2009Theory of Computation Lecture 6: Primitive Recursive Functions II 1 Homework Questions Question 1: Write a program P that computes 
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, …,
October 1, 2009Theory of Computation Lecture 8: Primitive Recursive Functions IV 1 Primitive Recursive Predicates Theorem 6.1: Let C be a PRC class. If.
November 3, 2009Theory of Computation Lecture 14: A Universal Program VI 1 Recursively Enumerable Sets Definition: We write: W n = {x  N |  (x, n) 
TR1413: Discrete Mathematics For Computer Science Lecture 1: Mathematical System.
Chapter 4: A Universal Program 1. Coding programs Example : For our programs P we have variables that are arranged in a certain order: Y 1 X 1 Z 1 X 2.
Chapter 10 Computable Functions Copyright © 2011 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1.
September 29, 2009Theory of Computation Lecture 7: Primitive Recursive Functions III 1 Some Primitive Recursive Functions Example 3: h(x) = x! Here are.
Theory of Computation Lecture 5: Primitive Recursive Functions I
Computability Go over homework problems. Godel numbering. Homework: prepare for midterm.
November 12, 2009Theory of Computation Lecture 17: Calculations on Strings II 1 Numerical Representation of Strings First, we define two primitive recursive.
October 4, 2016Theory of Computation Lecture 9: A Universal Program I 1Minimalization Example 15: R(x, y) R(x, y) is the remainder when x is divided by.
The Acceptance Problem for TMs
Another Word on PRC Classes
Gödel's Legacy: The Limits Of Logics
Theory of Computation Lecture 10: A Universal Program I
Theory of Computation Lecture 4: Programs and Computable Functions II
Theory of Computation Lecture 12: A Universal Program III
Theory Of Computer Science
Diagonalization and Reducibility
Theory of Computation Lecture 23: Turing Machines IV
Recursively Enumerable Sets
CS154, Lecture 11: Self Reference, Foundation of Mathematics
Numerical Representation of Strings
Theory of Computation Lecture 22: Turing Machines III
Great Theoretical Ideas in Computer Science
Theory of Computation Lecture 16: A Universal Program VII
Theory of Computation Lecture 5: Programs and Computable Functions III
Theory of Computation Lecture 6: Primitive Recursive Functions I
Busch Complexity Lectures: Undecidable Problems (unsolvable problems)
Copyright © Cengage Learning. All rights reserved.
Theory Of Computer Science
The Programming Language L
Theory of Computation Lecture 21: Turing Machines II
Numerical Representation of Strings
Diagonalization and Reducibility
Recursively Enumerable Sets
Primitive Recursive Predicates
Theory of Computation Lecture 5: Programs and Computable Functions III
The Programming Language L
Numerical Representation of Strings
Theory of Computation Lecture 4: Programs and Computable Functions II
Decidability continued….
Numerical Representation of Strings
Theory of Computation Lecture 9: A Universal Program I
Pairing Functions and Gödel Numbers
Theory of Computation Lecture 6: Primitive Recursive Functions I
Some Primitive Recursive Functions
Theory of Computation Lecture 22: Turing Machines II
Theory of Computation Lecture 13: A Universal Program V
Recursively Enumerable Sets
Theory of Computation Lecture 17: Calculations on Strings II
Theory of Computation Lecture 12: A Universal Program IV
Theory of Computation Lecture 11: A Universal Program III
Theory of Computation Lecture 23: Turing Machines III
Lecture 2: Limiting Models of Instruction Obeying Machine
Presentation transcript:

Theory of Computation Lecture 14: A Universal Program V Universality Consider the following predicates: STP(n)(x1, …, xn, y, t)  Program number y halts after t or fewer steps on inputs x1, …, xn  There is a computation of program y of length  t + 1, beginning with inputs x1, …, xn These predicates are computable, which we can easily prove: We can simply add a counter to our universal programs to determine when we have simulated t steps. October 31, 2017 Theory of Computation Lecture 14: A Universal Program V

Theory of Computation Lecture 14: A Universal Program V Universality We can prove an even stronger theorem: Theorem 3.2 (Step-Counter Theorem): For each n > 0, the predicate STP(n)(x1, …, xn, y, t) is primitive recursive. Proof: We will provide numerical descriptions of the notions of snapshot and successor snapshot. This will show that the necessary functions are primitive recursive. See pages 74 and 75 in the textbook for the proof. October 31, 2017 Theory of Computation Lecture 14: A Universal Program V

Theory of Computation Lecture 14: A Universal Program V Universality Now that we know the Step-Counter Theorem, we are ready for yet another theorem. Proving this theorem will be similar to the last one. Theorem 3.3 (Normal Form Theorem): Let f(x1, …, xn) be a partially computable function. Then there is a primitive recursive predicate R(x1, …, xn, y) such that f(x1, …, xn) = l(minz R(x1, …, xn, z)) October 31, 2017 Theory of Computation Lecture 14: A Universal Program V

Theory of Computation Lecture 14: A Universal Program V Universality Proof: Let y0 be the number of a program that computes f(x1, …, xn). Then consider the equation f(x1, …, xn) = l(minz R(x1, …, xn, z)) , where R(x1, …, xn, z) is the predicate STP(n) (x1, …, xn, y0, r(z)) & (r(SNAP(n) (x1, …, xn, y0, r(z))))1 = l(z) If the right side of the first equation is defined, then there exists a number z such that STP(n) (x1, …, xn, y0, r(z)) and (r(SNAP(n) (x1, …, xn, y0, r(z))))1 = l(z) October 31, 2017 Theory of Computation Lecture 14: A Universal Program V

Theory of Computation Lecture 14: A Universal Program V Universality Note: As introduced in the proof on pages 74 and 75, SNAP(n) (x1, …, xn, y0, i) stands for the snapshot of program number y0 after executing i instructions when run with inputs x1, …, xn. The snapshot is represented as a pairing <i, s>, where i is the number of the next instruction to be executed and s is the Gödel number of the current state. October 31, 2017 Theory of Computation Lecture 14: A Universal Program V

Theory of Computation Lecture 14: A Universal Program V Universality Consequently, SNAP(n) (x1, …, xn, y0, r(z)) is the snapshot after executing r(z) instructions of program number y0. r(SNAP(n) (x1, …, xn, y0, r(z))) is the Gödel number of the state taken from that snapshot. (r(SNAP(n) (x1, …, xn, y0, r(z))))1 is the first number in the sequence represented by that Gödel number. Because Y is the first variable in the list, this expression equals the value of variable Y in the program number y0 after executing r(z) instructions. October 31, 2017 Theory of Computation Lecture 14: A Universal Program V

Theory of Computation Lecture 14: A Universal Program V Universality For any such z, the computation by the program with number y0 has reached a terminal snapshot in r(z) or fewer steps, l(z) is the value of the output variable Y, that is, l(z) = f(x1, …, xn). If the right side of the equation is undefined, it must be true that STP(n) (x1, …, xn, y0, t) is false for all values of t, that is, f(x1, …, xn) is undefined. October 31, 2017 Theory of Computation Lecture 14: A Universal Program V

Theory of Computation Lecture 14: A Universal Program V Universality Theorem 3.4: A function is partially computable if and only if it can be obtained from the initial functions by a finite number of applications of composition, recursion, and minimalization. Proof: It follows from Theorems 1.1, 2.1, 2.2, 3.1, and 7.2 in Chapter 3 that every function that can be so obtained is partially computable. October 31, 2017 Theory of Computation Lecture 14: A Universal Program V

Theory of Computation Lecture 14: A Universal Program V Universality Now let us consider the “opposite direction” of the Normal Form Theorem (Theorem 3.3): We can use the normal form theorem to write any given partially computable function in the form l(miny R(x1, …, xn, y)) , where R is a primitive recursive predicate and therefore is obtained from the initial functions by a finite number of applications of composition and recursion. Finally, our given function is obtained from R by one use of minimalization and then by composition with the primitive recursive function l. October 31, 2017 Theory of Computation Lecture 14: A Universal Program V

Theory of Computation Lecture 14: A Universal Program V Universality When miny R(x1, …, xn, y)) is a total function (that is, when for each x1, …, xn there is at least one y for which R(x1, …, xn, y) is true), we say that we are applying the operation of proper minimalization to R. Now, if l(miny R(x1, …, xn, y)) is total, then miny R(x1, …, xn, y) must be total. This gives us the following theorem: Theorem 3.5: A function is computable if and only if it can be obtained from the initial functions by a finite number of applications of composition, recursion, and proper minimalization. October 31, 2017 Theory of Computation Lecture 14: A Universal Program V

Recursively Enumerable Sets From previous classes, such as CS 320, you may remember the correspondence between predicates and sets. We now want to use the set notation in our discussion of solvable and unsolvable problems. For example, the predicate HALT(x, y) is the characteristic function of the set {(x, y)  N2 | HALT(x, y)}. We say that a set B  Nm belongs to some class of functions if and only if the characteristic function P(x1, …, xm) of B belongs to the class in question. October 31, 2017 Theory of Computation Lecture 14: A Universal Program V