This commit is contained in:
2025-12-09 15:43:08 +01:00
parent df5c80b5df
commit c7928ec703
2 changed files with 9 additions and 3 deletions

View File

@ -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$.

5
5.org
View File

@ -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}