Theory of Computation Lecture 13: A Universal Program V

Slides:



Advertisements
Similar presentations
Primitive Recursive Functions (Chapter 3)
Advertisements

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.
Mu-Recursive Functions
1 Undecidability Andreas Klappenecker [based on slides by Prof. Welch]
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.
CS 5000: Lecture 37 Vladimir Kulyukin Department of Computer Science Utah State University.
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 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) 
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.
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.
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
Functional Verification III
Another Word on PRC Classes
Theory of Computation Lecture 10: A Universal Program I
Chapter 5 Limits and Continuity.
Theory of Computation Lecture 12: A Universal Program III
Theory Of Computer Science
Diagonalization and Reducibility
Theory of Computation Lecture 14: A Universal Program V
Recursively Enumerable Sets
CS154, Lecture 11: Self Reference, Foundation of Mathematics
Disjunctive Normal Form
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
Copyright © Cengage Learning. All rights reserved.
Copyright © Cengage Learning. All rights reserved.
CSCE 411 Design and Analysis of Algorithms
Copyright © Cengage Learning. All rights reserved.
Numerical Analysis Lecture 23.
Theory Of Computer Science
Numerical Analysis Lecture 26.
The Programming Language L
MA/CSSE 474 More Math Review Theory of Computation
Proposed in Turing’s 1936 paper
Theory of Computation Lecture 21: Turing Machines II
Functional Verification III
Numerical Representation of Strings
Diagonalization and Reducibility
Recursively Enumerable Sets
Primitive Recursive Predicates
The Programming Language L
Numerical Representation of Strings
Numerical Representation of Strings
Theory of Computation Lecture 4: Programs and Computable Functions II
Numerical Representation of Strings
Theory of Computation Lecture 9: A Universal Program I
Kleene’s Theorem (Part-3)
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
Recursively Enumerable Sets
Copyright © Cengage Learning. All rights reserved.
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
Numerical Analysis Lecture 24.
Presentation transcript:

Theory of Computation Lecture 13: 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. April 2, 2019 Theory of Computation Lecture 13: A Universal Program V

Theory of Computation Lecture 13: A Universal Program V Universality Similarly, we can also define the function SNAP(n)(x1, …, xn, y, t). It computes the snapshot of program P with #(P) = y after the execution of t instructions. Here, the snapshot is defined as the pairing <i, >, where i is the number of the instruction to be executed next and  is the state of the program, i.e., the values of its variables, encoded as a single Gödel number. Clearly, just like STP(n), we can also compute SNAP(n) by modifying the universal program and show that it is a primitive recursive function. April 2, 2019 Theory of Computation Lecture 13: A Universal Program V

Theory of Computation Lecture 13: 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)) April 2, 2019 Theory of Computation Lecture 13: A Universal Program V

Theory of Computation Lecture 13: 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) April 2, 2019 Theory of Computation Lecture 13: A Universal Program V

Theory of Computation Lecture 13: 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. April 2, 2019 Theory of Computation Lecture 13: A Universal Program V

Theory of Computation Lecture 13: 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. April 2, 2019 Theory of Computation Lecture 13: A Universal Program V

Theory of Computation Lecture 13: 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. April 2, 2019 Theory of Computation Lecture 13: A Universal Program V

Theory of Computation Lecture 13: 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. April 2, 2019 Theory of Computation Lecture 13: 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, …, xn) of B belongs to the class in question. April 2, 2019 Theory of Computation Lecture 13: A Universal Program V

Recursively Enumerable Sets Thus, saying that a set B is computable or recursive is the same as saying that P(x1, …, xn) is a computable function. Likewise, B is a primitive recursive set if P(x1, …, xn) is a primitive recursive predicate. It follows that: Theorem 4.1: Let the sets B, C belong to some PRC class C . Then so do the sets BC, BC, B. Proof: This is an immediate consequence of Theorem 5.1, Chapter 3. April 2, 2019 Theory of Computation Lecture 13: A Universal Program V

Recursively Enumerable Sets Example: Let us consider the case BC. There must be predicates PB and PC such that: B = { x  N | PB(x) } C = { x  N | PC(x) } Then: BC = { x  N | PB(x)  PC(x) } Since  is a primitive-recursive function, the predicate PB(x)  PC(x) is also in class C . Then the equation above shows that BC is in C as well. April 2, 2019 Theory of Computation Lecture 13: A Universal Program V