1

To what extent is the abstract model of computation specified by the x86 language Turing complete?

The above question is related to this question:
Is C actually Turing-complete?

In theoretical computer science the random-access stored-program (RASP) machine model is an abstract machine used for the purposes of algorithm development and algorithm complexity theory.

The RASP is a random-access machine (RAM) model that, unlike the RAM, has its program in its "registers" together with its input. The registers are unbounded (infinite in capacity); whether the number of registers is finite is model-specific. Thus the RASP is to the RAM as the Universal Turing machine is to the Turing machine. The RASP is an example of the von Neumann architecture whereas the RAM is an example of the Harvard architecture. https://en.wikipedia.org/wiki/Random-access_stored-program_machine

polcott
  • 99
  • 1
  • 1
  • 14

4 Answers4

6

The difference is: since x86 machines are finite, Turing machines can decide languages (decision problems) that cannot be decided by any x86 machine.


As I explained before, the idea of 'the set of decidable computations' is a category error. Decidability is a property of formal languages (or equivalently, of decision problems), not of computations. So, no, the statement in the second paragraph of your question is not correct. It's not even wrong -- it is neither true nor false.

I suspect that perhaps you have found a statement of the Church-Turing thesis that is worded in a way that is confusing. I suggest reading a standard reference on the Church-Turing thesis, and don't rely solely on the wording you have bolded.

It is true that every decision problem that can be solved by an x86 machine can be solved by a Turing machine (or, equivalently, every language that can be decided by an x86 machine can be decided by a Turing machine). This is true because you can program a Turing machine to simulate the behavior of an x86 machine. However, the converse is not the case: any real x86 machine has a fixed and finite amount of memory, while a Turing machine can use an unlimited amount of storage on its tape, so there are decision problems that can be solved by a Turing machine, but not by an x86 machine. (Even if we take into account the amount of storage provided by disks, disks use fixed-length addresses, so there is a fixed and finite upper bound on the maximum amount of disk storage that can be addressed from a standard x86 machine.)

If you wanted an x86 machine to be equivalent in power to a Turing machine, you'd have to provide some way to extend its amount of storage without limits. If you had a way to do that, then yes, any decision problem that can be decided by one could be decided by the other: each one could simulate the other.

D.W.
  • 167,959
  • 22
  • 232
  • 500
4

For a real computer, everything is decidable. There is a (far bigger than astronomically but) finite number of possible states, so any program will eventually halt or enter the exact same state a second time, in which case it will never halt.

Of course that is purely theoretical. It is (based on quantum physics and the total energy in the universe) physically impossible to run a 256 bit counter from zero to $2^{256}-1$.

(Deleted my comments responding to someone who is unwilling to understand).

gnasher729
  • 32,238
  • 36
  • 56
0

RIP relative addressing of the x86 language provides access to unlimited memory

An abstract machine having a tape head that can be advanced in 0 to 0x7FFFFFFF increments an unlimited number of times specifies a model of computation that has access to unlimited memory. The technical name for memory addressing based on displacement from the current memory address is relative addressing.

I am focusing on building a precise bridge between conventional high level concrete programming models (none of which can possibly be Turing Complete) and the closest abstract model that is Turing complete. To do this we must necessarily make at least minimal adaptations to the concrete model.

One concrete model of computation requiring very little change to adapt it to become a Turing complete abstract model of computation is the 32-bit signed RIP relative addressing of the x86-64.

If we take this machine language and get rid of all absolute addressing modes, leave the size of memory and the width of the instruction pointer unspecified then with these minimal changes the abstract model based on the x86-64 becomes Turing complete.

polcott
  • 99
  • 1
  • 1
  • 14
0

Mapping x86 programs to a Turing equivalent abstract model

The following abstract machine maps the x86 language to machines with a fixed pointer size of the largest unlimited integer address that is actually needed by the computation.

Instruction
     : INTEGER ":" OpCode
     | INTEGER ":" OpCode Integer
     | INTEGER ":" OpCode Integer "," Integer

HEXDIGIT [a-fA-F0-9] INTEGER {HEXDIGIT}+ OPCODE HEXDIGIT{4}

Address:OpCode Address:OpCode Param Address:OpCode Param, Param

Computational equivalence means that two machines will always produce equivalent output for equivalent input or fail to halt on equivalent input for a set of computations.

The set of computations not requiring more memory than is available for x86/x64/C computations will always have corresponding output for corresponding input or fail to halt on corresponding input exactly corresponding to the behavior of a Turing machine on equivalent input.

polcott
  • 99
  • 1
  • 1
  • 14