The Recursion Theorem




CS154

Chris Pollett

May 9, 2011

Outline

Machines that Print Themselves

`mbox{SELF}`

The Recursion Theorem (Kleene, 1938)

We can generalize the above argument to allow machines to compute with their own descriptions

Theorem. Let `T` be a TM that computes a function `t:Sigma^star times Sigma^star -> Sigma^star`. There is a Turing machine `R` that computes a function `r: Sigma^star -> Sigma^star`, where for every `w`, `r(w) = t(langle R rangle, w)`.

Proof. The proof is like the construction of `mbox{SELF}` except now we have the machine `T` besides `A` and `B`, and `R` will be a combined machine `ABT`. In the current construction `A=P'_{langle BT rangle}`. Here `P'_{langle BT rangle}` is like `P_{langle BT rangle}` except that it prints `langle BT rangle` after the input and a `#`. We design a `q'` so it looks for a `#`, sees the string `v` that follows it and, and appends `langle P'_{langle v rangle}rangle` to the input. So after `A` runs the tape has `w#langle BT rangle` on it. Now `B` applies `q'` to the output of `A` to get `w#langle BT rangle langle P'_{langle BT rangle} rangle = w#langle BT rangle langle A rangle`, and then reformats this as `langle langle ABT rangle, w rangle`. It then starts `T`. So we have `langle R rangle = langle ABT rangle`.

Quiz

Which of the following is true?

  1. Unlike for LBAs, every question one could ask about CFGs is decidable.
  2. In the Post Correspondence Problem, the string on the top of a domino is always the same length as the string on the bottom of a domino.
  3. Rice's Theorem can be used to show undecidability results.

Applications of the Recursion Theorem

More Applications

The Fixed-Point Theorem

A fixed point of a function `f` is a value `x` such that `f(x)=x`.

Theorem. Let `t: Sigma^star->Sigma^star` be a computable function. Then there is a machine `F` for which `L(t(langle F rangle)) = L(F)`. Here we are assuming that if a string isn't a proper TM, then it describes the empty language.

Proof. Consider the machine `F =` "On input `w`:

  1. Obtain via the recursion theorem, own description .
  2. Compute `t(langle F rangle)` to obtain a TM description `G`.
  3. Simulate `G` on `w`."