Hand ins
This commit is contained in:
@ -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
5
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}
|
||||
|
||||
Reference in New Issue
Block a user