Assignment 6

Nils Anders Danielsson

In order to pass this assignment you have to get at least two points.

  1. (2p) The following string represents a Turing machine, using the encoding presented in the lectures:

      100110010101010110110101101110100011101100010

    The following string is an encoding, using the encoding presented in the lectures, of some input to the Turing machine:

      110110111011011100

    What Turing machine and what input do the strings represent? And what is the result of running the Turing machine with the given input?

  2. (2p) Implement a Turing machine interpreter using χ.

    The interpreter should be a closed χ expression. If we denote this expression by run, then it should satisfy the following property (but you do not have to prove that it does):

    (The ⟦_⟧ brackets to the left stand for the Turing machine semantics, and the ⟦_⟧ brackets to the right stand for the χ semantics.)

    Turing machines should be represented in the following way:

    The input and output strings should use the usual representation of lists, with the representation specified above for the input and tape symbols.

    Please test that addition, implemented as in Tutorial 5, Exercise 6, works as it should when run on your Turing machine interpreter. A testing procedure that you can use is included in the wrapper module (documentation).

  3. (2p) Prove that every Turing-computable partial function in ℕ ⇀ ℕ is also χ-computable. You can assume that the definition of “Turing-computable” uses Turing machines of the kind used in the previous exercise.

    Hint: Use the interpreter from the previous exercise. Do not forget to convert the input and output to the right formats.