Jump to content

Turing completeness

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Dataphile (talk | contribs) at 21:09, 5 September 2004 (wikify declarative programming language). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

In the theory of computers both imagined and real, of programming languages, and of other logical systems, a Turing-complete system is one which has computational power equivalent to a universal Turing machine (named for Alan Turing). In other words, the system and the universal Turing machine can emulate each other.

While such machines may be physically impossible as they require unlimited storage and zero crashing probability, the attribute Turing-complete is often used in a lax sense for physical machines or programming languages that would be universal if they had indefinitely enlargeable storage and were absolutely reliable. The first such machine appeared in 1941: the program-controlled Z3 of Konrad Zuse. Its universality, however, was shown only much later, namely, by Raúl Rojas in 1998. All modern computers are also Turing-complete in this lax sense.

Turing-completeness is significant in that every plausible design for a computing device so far advanced (even quantum computers) can be emulated by a universal Turing machine. Thus, a machine that can act as a universal Turing machine can, in principle, perform any calculation that any other computer is capable of. Note, however, that this says nothing about the effort to write a program for the machine or the time it may take to do the calculation.

It is hypothesized by some that the universe is Turing-complete (see Philosophical Implications in the Church-Turing thesis).

See the article on computability theory for a long list of systems that are Turing-complete, as well as several systems that are less powerful, and several theoretical systems that are even more powerful than a universal Turing machine.

Examples

As an example, HTML (Hypertext Markup Language) is not a Turing-complete language because we cannot implement any well-defined algorithm in it. To make it Turing-complete, one could add loops, variables, and conditional (IF) statements to the language. However, that is not the only way to make a language Turing-complete, for there are Turing-complete languages that don't resemble typical programming languages in the least. See the above-mentioned list under computability theory.

One potential advantage of non-Turing-complete languages is added security. It is much harder to write a computer virus in non-Turing-complete languages, for example. Thus, one will probably have more security problems using JavaScript than "plain" HTML because a virus writer can implement a wide variety of algorithms in JavaScript. The "Macro" ability in Microsoft Word documents gives Word documents the ability to be Turing-complete. Although this makes them potentially more powerful, it is also a source of viruses and unwanted computer security exploits.

Non-Turing complete languages often consist largely of attributes (data) rather than direct commands, and are then called "declarative" languages. (But note that "declarative" is sometimes used to comprise logic programming and functional programming languages.)

The untyped lambda calculus is Turing-complete, but many typed lambda calculi, including System F, are not.

See also