text
stringlengths
0
8.13M
it in the next section.
If the Church-Turing thesis is correct, the general halting problem is there-
fore unsolvable.
2.3.7 Universal Turing machines
The Turing machines consideredso far arespecialpurpose machines. Eachand
everymachineisconstructedtosolveaparticularalgorithmicproblem,thepro-
gram being encoded in the list of instructions. We will now argue that there
exist universal Turing machines U, which act like general purpose computers.
They are programmable in the sense that, given a description of a certain Tur-
ing machine M, and its input x, it mimics the computation of M. Leaving
open the details for the moment, by a description of M, we mean a symbolic
representation of the set of instructions for M in the alphabet of the universal
machine. In order not to clutter the notation, the description of M will also be
denoted by M since any machine is essentially defined by its set of instructions
anyway. So, if the result of running M with input x is M(x), i.e. the function
f (x), then we write M(x) = U(M;x) to denote that the universal machine
M
computesthe sameresultwhengivenasinput, the descriptionM aswellasthe
’data’ x.
As a preliminary step, note that the Turing machines can be enumerated
and collected into an infinite list [M ] . The alphabets are fixed and the
i ∞i=1
programs can written as strings by concatenating the instructions. Thus, the
enumeration can be performed using a lexicographic ordering starting by first
ordering all one-state machine programs, then all two-state machine programs
and then continuing in this way.
The actual construction of universal machines is quite complicated if it is
to be carriedout in full detail. One complication is that the different machines
M could very well have different alphabets Γ and Σ, and consequently, the
universal machine must be able to accommodate a potentially infinite set of
symbols. However,sinceforanyparticularmachine,thesetofsymbolsisfinite,
34
it is possible to map this set of symbols one-to-one onto a standard set, say
Γ = 0,1 and Σ = 0,1,#, using some binary coding. This will be our
{ } { ⊔}
strategy.
Furthermore, U must be able to accommodate a potentially infinite set of
labels for internal configurations of the simulated machines. This we also stan-
dardize by encoding the configuration labels using the very same alphabet Σ.
In this way, both the input data and the program for the simulated machines
are encoded using the same alphabet. This is useful, since it then makes sense
to provide the programof a Turing machine as input to the universal machine.
The internal configurations of U itself may be labeled by any suitable set.
The construction of U is simplified if it is built as a two-tape machine. The
first tape can then be dedicated to storing the program for the machine being
simulated. The secondtape ofU is usedto storethe instantaneousdescriptions
ofthe simulatedmachine M . The specific setofinstructionsfor U itself, which
i
in accordance to the Turing machine model, is not stored on any tape, but
instead is part of its finite state control, can be thought of as an operating
system.
Wecannowinformallydescribetheworkingsoftheuniversalmachine. Upon
being set in motion, it scans the leftmost symbol on the second tape (this is
the starting configuration of M ), then it scans the next symbol to the right
i
(the symbol that M itself would have scanned). Having done this it knows the
i
both the internal configuration and scanned symbol of M . Then it scans the
i
first tape, looking for a matching instruction. If such an instruction is found,
it is performed on the second tape. Thus the first step in simulating M is
i
performed. Next it scans the second tape looking for a symbol corresponding
to a configuration of M , then it scans the symbol to right (which again is
i
the symbol scanned by M ). Then it scans the first tape again looking for a
i
matching instruction. Having found it, it is performed. Continuing in this way
itis clearthatthe workingsofM is simulated. Whatremainsto be done if the
i
construction is to be carried out in detail is to code these operations in terms
the primitives of U.
2.3.8 The halting problem is undecidable
We are now in a position to state the halting problem and prove that it is
undecidable. In order to use the formalism set up so far we will phrase the
problem in terms of decision problem.
Let H be a language defined by
H= M;x:M(x) ⊲ , (2.13)
{ 6≻ }
which is read out as ”The language consisting of all strings that encode a
Turing machine M and an input x such that the machine halts on the input.”.
Theorem
H is recursively enumerable.
35
Proof
WhatisneededisaTuringmachineH thatacceptsthe languageH. According
to the definition recursively enumerable languages (2.12)
H(M;x) q if M;x H
≻ y ∈ . (2.14)
(cid:26)H(M;x) ⊲ if M;x / H
≻ ∈
But then H is precisely a universal machine programmedso that it halts in
the accepting configuration q whenever the machine M halts on input x.
y
Theorem
H is not recursive.
Proof
Suppose contrary to the proposition that there exist a Turing machine H that
decides H. This means, according to (2.11), that we have
H(M;x) q if M;x H