5

Possible Duplicate:
Are there minimum criteria for a programming language being Turing complete?

I overheard a conversation on the topic and the conclusion that one gent came to was that in order to be Turing complete, given one has infinite storage, all one needs is a conditional control structure and a jump instruction.

Is this true?

If it is true, and Turing completeness requires that the language that is Turing complete be able to simulate every instruction available in another Turing complete language, how do those two simple elements achieve that?

3 Answers3

4

The machine you describe would be turing complete with the addition of an assignment operator (you need this to take advantage of memory), and at least one comparison operator (which could be folded into the jump, like a jump-if-(not)-zero). (Note that an increment operator is necessary - either as a primitive, or appropriate representations need to be available such that one can roll ones own).

However, there are many turing-complete models of computation with completely different primitive operations, such as lambda calculus, or petri nets.

Marcin
  • 141
  • 4
2

The more abstract answer which captures the requirements on both imperative-style programming (suitable for hardware register machines) and functional-style programming (suitable for dataflow and graph reduction machines) is that your language must be able to

  1. represent bit strings of arbitrary lengths

  2. express a partial recursive function (to simplify, a partial recursive function is a computation where the number of steps in a repetition may not be known before an arbitrary number of iterations have been run already)

Theoretical Turing machines have #1 by means of the tape, and #2 by means of the states and conditional state transitions. Pure Lambda calculus has #1 by means of lambda-terms of arbitrary lengths, and #2 by means of partial evaluation of fixed point combinators and the truth functions.

In general, if your execution platform "looks like" a Turing machine in that it has a memory for strings and instructions for state transitions, it intuitively satisfies #1 so that does not need discussion. The main question that remains is how to deal with partial recursive functions. A conditional branch and a stack pointer are a way to do it, but other ways are possible as well.

kena
  • 141
  • 3
1

Yep, it's true. I can describe Turing machine made of endless paper, alphabet and instructions, but in Russian language only, so I can only give you this link to Wiki page about Turing machine - complete language you are talking about.