Diagonal language

from Wikipedia, the free encyclopedia

The diagonal language is a formal language from theoretical computer science from the area of decision problems . It is constructed as a set in such a way that it is not semi-decidable , i.e. that elements (words) of the language cannot be recognized algorithmically as belonging to the language. So there can be no Turing machine that can give a yes answer to the question whether an element belongs to the language.

The diagonal language is the central construction in the proof of the undecidability of the holding problem .

The construction of language is based on the principle of diagonalization . The diagonal language is the set of all Turing machines that do not accept when they receive their own coding as input. A Turing machine that could semi-decide this language should be neither in the set nor not in the set, which leads to the contradiction of assumed semi-decidability.

However, the complement of the diagonal language is semi-decidable. It is also known as the special halting problem and is the classic example that there are semi-decidable languages ​​that are not decidable, so the class of decidable languages ​​is a true subset of the class of semi-decidable languages.

definition

Let be the Turing machine belonging to a coding . Then the diagonal language is defined as:

D is not semi-decidable

The diagonal language is not semi-decidable, so it is not recursively enumerable.

If it were semi-decidable, there would be a Turing machine that semi-decides so that all elements of are accepted and holds for elements without accepting or not. Be the coding of this Turing machine , so . If you start with input (i.e. should decide your own coding), you have the following options:

  • Suppose :
    • would have to accept, because semi-decides .
    • However, according to the definition of is .
    • Contradiction
  • Suppose :
    • must not accept, because semi-decides .
    • But again according to the definition of is .
    • Contradiction

Thus there can not be such a Turing machine that semi-decides.

The complement of D is semi-decidable

However, the complement of , the so-called special holding problem , is semi-decidable. If we define this as , the following Turing machine accepts the set :

  • When entered , it is simulated when entered .
  • As soon as it stops in an accepting configuration, it stops and accepts.

So it is clear that every input is accepted by if and only if the input is accepted. For positive entries, that is , accept the entry. For negative inputs, that is , it does not hold in an accepting configuration, i.e. holds without reaching an end state or does not hold at all. So the language semi-decides .

However, the language does not decide , because there can be negative inputs on which the Turing machine does not stop. There cannot even be a decisive Turing machine, because this would also decide the complement of (namely precisely the diagonal language ), which, according to the above, cannot be.