The Recursion Theorem




CS154

Chris Pollett

May 6, 2013

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 (Sec 1)

Which of the following is true?

  1. There is an LBA that decides `E_{TM}`.
  2. We gave a quadratic time decision procedure for Post Correspondence Problem.
  3. `ALL_{CFG}` is undecidable.

Quiz (Sec 3)

Which of the following is true?

  1. The language consisting of encodings of TMs which accept only unary strings over `{0,1}` is undecidable via Rice's Theorem.
  2. `E_{CFG}` is undecidable.
  3. PCP is decidable by an LBA.

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`."