A non-computable set can be seen as an unsolvable problem. To compare unsolvable problems with one another, Turing introduced in 1939 machines that may consult an oracle: a set , given as an infinite external resource, which the machine may query at any time for the value of . A set is then computable relative to if some oracle machine decides it with oracle . This lesson defines oracle computations, proves the property that makes them manageable — a halting computation consults only finitely many bits of the oracle — and shows that the basic results of the course on fundamentals hold relative to any oracle.
1.1 Strings and sequences
We use the notation of Definition 4.1 of “The diagonal argument”. A string is an element of , the set of finite binary sequences; is its length, its -th bit for , and the empty string. For strings and and :
- means that is a prefix of , and that is a prefix of ;
- and are compatible if one is a prefix of the other, and incompatible otherwise;
- and denote concatenations, for , and ;
- is the cylinder of .
Strings are coded by integers in a fixed computable way, so that the usual operations on them are primitive recursive. Sets of integers are identified with elements of .
1.2 Oracle machines
An oracle machine is a Turing machine with a second, read-only tape, the oracle tape, whose cells are indexed by , and a second head on it, starting on cell . Its transition function has the form
in state , reading on the work tape and under the oracle head, the machine writes on the work tape, moves the work head in direction and the oracle head in direction ( meaning that it stays; a move to the left from cell leaves it on cell ), and enters the state , where .
With oracle , the oracle tape contains on cell . Inputs and outputs follow the conventions of Definition 2.4 of “Turing machines”.
An oracle machine computes, for each oracle , a partial function . Ordinary Turing machines are the oracle machines that ignore their oracle. Oracle machines are coded by integers as ordinary machines are; the integers that are not codes are treated as coding a machine that never halts.
For , the Turing functional is the map which sends an oracle to the partial function computed by the oracle machine of code with oracle . We also write for .
The notation is consistent with the course on fundamentals once a convention is fixed: from now on, denotes the functional of index , and when no oracle is written, stands for , for (defined below) and for . The partial computable functions of that course are exactly the functions , or for any computable (see the exercises), although a function need not have the same indices in the two enumerations. Since every ordinary machine is an oracle machine, every partial computable function is for some and every .
Let be an infinite set whose principal function (Lemma 3.2 of “Countable sets”) grows fast enough that implies , for every . Then there is an oracle machine computing with oracle : on input , read the oracle until its -th element is found, then run for stages, and answer if and only if it has converged. Fast-growing sets can thus compute the halting set; this phenomenon is studied in the lesson on limit computability.
1.3 Computations with finite oracles
A halting computation is finite, so it reads only finitely many cells of the oracle. This is the basis of everything that follows. For a string , the computation with oracle is the computation of the machine in which the oracle tape contains on the cells ; it is considered undefined as soon as the oracle head reaches a cell .
For , :
- means that the computation of the machine on input with oracle halts in a standard configuration with output , without the oracle head reaching a cell ;
- means that moreover and the code of this computation is smaller than ;
- for , .
As in Kleene's normal form, the relation ” codes a halting computation of the machine on input with oracle ” is primitive recursive in : configurations now include the position of the oracle head, and each step consults one bit of , available since is part of the data. A computation of code has fewer than steps, and the oracle head moves at most one cell per step, so it reads only cells .
- The relation is primitive recursive in .
- Monotonicity. If , and , then .
- Approximation. For every : if and only if for some , if and only if for some .
- holds if and only if and some codes a halting computation of on with oracle , with output : a bounded quantification of a primitive recursive relation.
- The computation with oracle reads only cells , where agrees with ; so with oracle the machine performs the same steps, and the computation has the same code.
- If , let be the code of the computation with oracle . It reads only cells , so it is also the computation with oracle , and for , since . If , then works. Finally, if with , the computation with oracle performs the same steps, by the argument of item 2.
If , the use of the computation, written , is plus the largest cell read by the oracle head during the computation (the head reads cell initially, so the use is at least ).
If with use , then , with the same use, for every such that . In particular .
By induction on the number of steps, the computations with oracles and pass through the same configurations: the oracle head stays within the cells during the computation with oracle , and there and agree, so each step reads the same oracle bit. Hence the computation with oracle halts after the same number of steps, with the same output, and reads the same cells. The last statement is the same argument with the finite oracle , of length .
The use principle says that the value of a convergent computation depends only on a finite part of the oracle. In topological terms, which are developed in the course on classes, the partial map is continuous on its domain, for the product topology on : if , then on the whole open neighborhood of .
1.4 Relativization
Let . A partial function is -computable, or computable in , if it is for some . A set is -computable if its characteristic function is. A set is -computably enumerable, or -c.e., if it is the domain of an -computable partial function; we write .
Every argument of the course on fundamentals is an algorithm, or a construction of algorithms, and remains valid if all machines are given access to the same oracle . This relativization yields, for each theorem, a version relative to , obtained by replacing computable with -computable and with throughout. For instance, relative to , the c.e. sets are characterized as in Theorem 4.3 of “Computably enumerable sets”, a set is -computable if and only if it and its complement are -c.e., and the fixed point theorem holds for -computable transformations of indices. Two results deserve to be stated explicitly, because their relativized form is uniform: the objects they provide do not depend on .
There is an index such that for every , and .
By Proposition 1.5, , where is the primitive recursive relation ” codes a halting computation of on with oracle ”. An oracle machine computes this expression: on input , for , it reads on its oracle tape, and tests the relation. The same machine works for every oracle.
For all , the primitive recursive function of SMN theorem satisfies, for every oracle ,
The construction of SMN theorem prepends to the machine a machine writing on the work tape, without touching the oracle head. The resulting oracle machine first writes , then behaves as the machine , with the same oracle; this does not depend on the oracle.
The function is computable, not merely -computable: it manipulates codes of machines and never consults the oracle. Uniformity of this kind is used repeatedly, for instance to show that the jump is monotone. In proofs, we use the parameter form: if is computed by an oracle machine, there is a computable with for every .
Almost all proofs of computability theory relativize. In complexity theory, this is a limitation: Baker, Gill and Solovay constructed oracles and with and , so no relativizing argument can settle the question . We admit this result.
1.5 Oracles that are functions
A function can also serve as an oracle, through its graph: let , a subset of . A machine with oracle can compute by searching for the with ; conversely, a machine that can compute can decide . We say that a set or a function is -computable if it is -computable. Computing with an oracle is therefore computing with the ability to evaluate at any point.
1.6 Exercises
Show that if is computable, then the -computable partial functions are exactly the partial computable functions.
Solution
A partial computable function is computed by a machine that ignores its oracle. Conversely, let be computable and let . Replace each consultation of the oracle tape at cell by a computation of ; more precisely, where is computable from . This expression is partial computable.
Show that the partial function is computed by an oracle machine: there is with for every , and .
Solution
On input with oracle , search for the least with , as in Theorem 1.9; the computation coded by is then known, and the use is plus the largest oracle head position appearing in its configurations. If , the search diverges, as it should.
Let be a functional such that is total for every . Show that there is a computable function such that for all and .
Hint
Use König’s lemma, or the compactness of : for a fixed , consider the strings on which the computation does not yet converge.
Solution
First, for every string , the computation of the machine on input with oracle either halts or reaches a cell after finitely many steps. Otherwise it would run forever while reading only cells , and with any oracle it would perform the same steps, so that , contradicting the hypothesis. Hence the relation is decidable: run the computation until one of the two events occurs.
Fix , and let be the set of strings such that for every . It is closed under prefixes and decidable. If contained strings of every length, then by König’s lemma (an infinite binary tree has an infinite path) there would be with all its prefixes in , and then by Proposition 1.5, a contradiction. So there is a length such that no string of length belongs to , and the least such is found by testing the strings of length in turn. Let be this . Every has a prefix of length at most with , and then by the use principle.
1.7 Notes and references
Oracle machines were introduced by Turing in his Princeton thesis, published in 1939, in the study of ordinal logics. Post (1944, 1948) and Kleene and Post (1954) made relative computability the central notion of the theory. The model with an oracle tape follows Rogers’ and Soare’s textbooks; models with query states give the same notion of relative computability.
- A. M. Turing, Systems of logic based on ordinals, Proceedings of the London Mathematical Society (2) 45 (1939), 161–228.
- S. C. Kleene and E. L. Post, The upper semi-lattice of degrees of recursive unsolvability, Annals of Mathematics 59 (1954), 379–407.
- T. Baker, J. Gill and R. Solovay, Relativizations of the P =? NP question, SIAM Journal on Computing 4 (1975), 431–442.
- R. I. Soare, Turing Computability: Theory and Applications, Springer, 2016.