patternMinor
Can a language be Turing Complete if its only provision for unlimited code/memory is through recursion?
Viewed 0 times
canrecursionprovisionthroughlanguagecodeitscompleteforunlimited
Problem
We've developed an esoteric language. In this language, a program contains a static amount of code, and a static amount of storage space. However, parts of the program can recurse, so the interpreter will spawn another copy of a subset of the code and additional storage space to match. Can this language be Turing Complete?
Solution
Given your very strict interpretation of limited memory size, limiting
also the size of integers, one consequence is that it is not possible
to play encoding games with integers (such as Gödel enumerations or
encodings).
Another consequence is that you cannot have a way of retrieving the
address of a memory location in order to make pointers. The reason is
that unbounded recursion implies that memory addresses will have
unbounded size (which is a bit inconsistent on the implementation
side, but I guess I have to ignore it). If there was an instruction to
retrieve the address of a variable, the space needed to store this
address could well exceed all of the memory available for a given
recursive call. Hence there is no hope of manipulating addresses.
Hence, each recursive call can only access a finite amount of
information, say $n$ bits, which may be seen also a one of $2^n$
symbols. There is as much information, i.e. one of those symbols,
memorized for each of the previous calls, but not accessible on the
recursion stack.
Of course a little bit of information is passed as parameter at each
recursive call, and some is returned when it terminates.
So all this pretty well describes a pushdown automaton.
Hence all you can do is recognize or generate context-free languages,
or some equivalent computation. You are pretty far from Turing
completeness.
But if your model allowed storing pointers to local variables, then,
even without Gödel encodings in integers, you could have Turing
completeness.
also the size of integers, one consequence is that it is not possible
to play encoding games with integers (such as Gödel enumerations or
encodings).
Another consequence is that you cannot have a way of retrieving the
address of a memory location in order to make pointers. The reason is
that unbounded recursion implies that memory addresses will have
unbounded size (which is a bit inconsistent on the implementation
side, but I guess I have to ignore it). If there was an instruction to
retrieve the address of a variable, the space needed to store this
address could well exceed all of the memory available for a given
recursive call. Hence there is no hope of manipulating addresses.
Hence, each recursive call can only access a finite amount of
information, say $n$ bits, which may be seen also a one of $2^n$
symbols. There is as much information, i.e. one of those symbols,
memorized for each of the previous calls, but not accessible on the
recursion stack.
Of course a little bit of information is passed as parameter at each
recursive call, and some is returned when it terminates.
So all this pretty well describes a pushdown automaton.
Hence all you can do is recognize or generate context-free languages,
or some equivalent computation. You are pretty far from Turing
completeness.
But if your model allowed storing pointers to local variables, then,
even without Gödel encodings in integers, you could have Turing
completeness.
Context
StackExchange Computer Science Q#43433, answer score: 7
Revisions (0)
No revisions yet.