Existence Universal goto-programm (turing machine)

2k Views Asked by At

May you can help me out with my problems with source codes. Well first of all we proved that for recursive functions $N:\mathbb N^2\rightarrow \mathbb N$ and $A^k: \mathbb N^k\rightarrow \mathbb N$ and for every goto programm (I am not 100% sure, but I think this is identical to a turing machine) there exist a source code $\mathcal{P}=<p_0,...,p_{L-1}>$ where $L$ is the number of lines of the program and $p_i$ is the code of the i-th line.

Question: How to construct a simple universal program $U$? I.e a program which delivers the ouput for the input $(\mathcal{P},n)$, this is what the program $P$ would give for the input $n$

This is nothing more than a goto-interpreter, similar to a java-interpreter, but what about a formal argument, why this program exist?

EDIT: Next to my original question (the construction of $U$), two other questions arises:Let $f(n)$ is the output of the universal program $U$ on the input $(n,n)$. Is $f$ recursiv? Same with $g(n)=f(n)+1$. Is it recursiv?

2

There are 2 best solutions below

7
On BEST ANSWER

You have to be a bit careful with asking "is $f(n)$" recursive, where $f(n) = U(n,n)$ and $U$ is a universal GOTO program (or recursive function or turing machine or whatever).

$f$ isn't total, so if you distinguish between recursive and partially recursive functions, it's obviously not recursive. It's partially recursive though, since every GOTO program (or turing machine or recursive function or whatever) is.

7
On

Quote from Wikipedia: "To show that something is Turing complete, it is enough to show that it can be used to simulate some Turing complete system. For example, an imperative language is Turing complete if it has conditional branching (e.g., "if" and "goto" statements, or a "branch if zero" instruction. See OISC) and the ability to change arbitrary memory locations (e.g., the ability to maintain an arbitrary number of variables). Since this is almost always the case, most if not all imperative languages are Turing complete if we ignore any limitations of finite memory"