A system of data-manipulation rules, such as a Programmiersprache, is Turing complete if it can simulate any single-taped Turing machine. This means it is computationally universal and can be used to solve any computable problem, given enough time and memory. Most general-purpose programming languages are Turing complete, forming the theoretical foundation for their expressive power.
Turing completeness is a concept from computability theory that defines the power of a computational system. It originates from Alan Turing’s 1936 paper describing a theoretical device known as the Turing machine. This machine consists of an infinitely long tape, a head that can read, write, and move along the tape, and a set of states and transition rules. Despite its simplicity, a Turing machine can perform any computation that can be described algorithmically. A programming language or any other formal system is deemed ‘Turing complete’ if it has the capability to simulate a universal Turing machine. This implies that the language can compute anything that is computable.
The core requirements for a system to be Turing complete are conditional branching (e.g., if-then-else statements) and the ability to loop indefinitely or recursively (e.g., while, for loops). These constructs allow the system to make decisions and repeat operations, which is sufficient to model the behavior of a Turing machine’s state transitions and tape manipulation. The Church-Turing thesis, a fundamental principle in computer science, posits that any function that is naturally considered ‘computable’ can be computed by a Turing machine. Therefore, a Turing-complete language is, in theory, capable of expressing any algorithm.
Diese theoretische Leistungsfähigkeit bringt jedoch eine bedeutende Konsequenz mit sich: das Halteproblem. Turing bewies, dass es unmöglich ist, einen allgemeinen Algorithmus zu entwickeln, der für alle möglichen Eingaben bestimmen kann, ob ein bestimmtes Programm beendet wird oder für immer weiterläuft. Diese Unentscheidbarkeit ist eine inhärente Eigenschaft aller Turing-vollständigen Systeme. Aus diesem Grund werden einige domänenspezifische Sprachen absichtlich so konzipiert, dass sie nicht Turing-vollständig sind. Beispielsweise sind Standard-SQL und HTML nicht Turing-vollständig, was garantiert, dass ihre Skripte oder Definitionen beendet werden und verhindert, dass sie versehentlich in Endlosschleifen geraten – eine wünschenswerte Eigenschaft für Datenbankabfragen und die Dokumentdarstellung.