From c7928ec703ff2d7cef9ab368d33aa406ab284bf2 Mon Sep 17 00:00:00 2001 From: pingu Date: Tue, 9 Dec 2025 15:43:08 +0100 Subject: [PATCH] Hand ins --- 3or4or6/6.org | 7 ++++++- 5.org | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/3or4or6/6.org b/3or4or6/6.org index 2e581da..cbe6f6c 100644 --- a/3or4or6/6.org +++ b/3or4or6/6.org @@ -24,7 +24,7 @@ The Turing machine is the one described by the following: - States: $S = \{ s_0, s_1 \}$ - Initial state: $s_0$ - Input alphabet: $\{c_1,c_2\}$ -- Tape alphabet: $\{\text{\textvisiblespace}},c_1,c_2\}$ +- Tape alphabet: $\{\text{\textvisiblespace},c_1,c_2\}$ - Transition function: + $\delta (s_0, c_1) = (s_1,c_1,R)$ + $\delta (s_0, c_2) = (s_1,c_2,R)$ @@ -62,3 +62,8 @@ See =Turing.hs= Prove that every Turing-computable partial function in $\mathbb{N} \rightharpoonup \mathbb{N}$ is also $\chi$ 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. +** Answer +We know that we can construct an interpreter for Turing machines, and a translation of $\mathbb{N}$ to the language a Turing machine. +We also know that one can construct an interpreter in the form of a Turing machine of $\chi$, and the opposite. +This means that a partial function can be translated from $\chi$ to a Turing machine. +So, given a partial function, one can translate it to a Turing machine, and translate the input, and run the implemented Turing interpreter from the last task, and then translate the result back into $\chi$. diff --git a/5.org b/5.org index 87fae1e..cb8640f 100644 --- a/5.org +++ b/5.org @@ -28,7 +28,7 @@ Which means &= \llbracket \underline{\text{has-fixpoint}}\ \ulcorner \lambda n. ((\lambda \_. n)\ p) \urcorner \rrbracket \\ &= \ulcorner \text{has-fixpoint}(\lambda n. ((\lambda \_. n)\ p)) \urcorner \\ &= \begin{cases} - \ulcorner \text{true} \urcorner &\quad \text{if}\ \exists v \in Exp. \llbracket p \rrbracket = v,\\ + \ulcorner \text{true} \urcorner &\quad \text{if}\ \exists v \in Exp. \llbracket p \rrbracket = v\ \text{(due to strictness in application)},\\ \ulcorner \text{false} \urcorner &\quad otherwise \end{cases} \end{align*} @@ -138,7 +138,8 @@ Let a two-tape Turing machine be defined by the following: \UnaryInfC{$\text{\textvisiblespace} \notin \Sigma$} \AxiomC{$\Gamma$ is a finite set} \UnaryInfC{$\Sigma \cup \{\text{\textvisiblespace}\} \subseteq \Gamma$} -\AxiomC{$\delta \in S \times \Gamma \times \Gamma \rightharpoonup S \times (\Gamma \times \{L,R\}) \times (\Gamma \times \{L,R\})$} +\AxiomC{$\delta \in S \times \Gamma \times \Gamma \rightharpoonup$} +\UnaryInfC{$S \times (\Gamma \times \{L,R\}) \times (\Gamma \times \{L,R\})$} \alwaysSingleLine \QuaternaryInfC{$(S,s_0, \Sigma, \Gamma, \delta) \in \text{TM2}$} \end{prooftree}