0 Problems with the Halting Problem Eric C.R. Hehner Department of Computer Science, University of Toronto hehner@cs.utoronto.ca Abstract Either we leave the definition of the halting function incomplete, not saying its result when applied to its own program, or we suffer inconsistency. If we choose incompleteness, we cannot require a halting program to apply to programs that invoke the halting program, and we cannot conclude that it is incomputable. If we choose inconsistency, then it makes no sense to propose a halting program. Either way, the incomputability argument is lost. Keywords halting problem, computability Introduction In 1936 Alan Turing wrote a paper [6] introducing a computing machine that we now call a “Turing Machine”. He showed how it can be programmed, and how different programs give the machine different behaviors, or in his terminology, create different machines. He showed how one such machine, a “Universal Turing Machine”, can be given a description of any Turing Machine (a program), and then simulate the operation of that Turing Machine (execute the program). That work remains an important part of the foundation of computer science. Page 247 of that paper is a proof that a certain problem that we now call the “Halting Problem” cannot be solved by computation. I want to re-examine that proof. The halting function is defined to say whether a program's execution terminates. In this paper I will use the word “function” to mean a mathematical total function, mapping every element of its domain to an element of its range. To apply a function to the domain of programs, Turing encoded programs as numbers. His programs were sequences of Turing Machine operations; each operation was encoded as a sequence of decimal digits, and each program was encoded by joining together the digit sequences representing the operations. In this paper I use programming notations that are typical of modern programming languages, rather than Turing Machine operations. Today, when programs are presented as input data to a compiler or interpreter, they are represented as texts (character strings), and that's the encoding I will use. These changes modernize and simplify the presentation without changing anything essential in the proof of incomputability. In some formulations of the Halting Problem, the halting function is applied to two operands: a representation of a program, and the initial state of the program variables (the input). The function tells whether the program's execution terminates when started in the initial state. The presentation of the Halting Problem can be simplified by eliminating the initial state (input) operand. One way to do that is to start execution of every program in the same initial state; if you wanted some other initial state, just begin the program with some initializing assignments to create the state you wanted. In other words, creation of the initial state you wanted is the initial part of the program. Turing did not distinguish the initial state of program variables from program, and I will follow Turing on that point. The proof is a “diagonal argument”, famously used by Georg Cantor [1] in 1890, and by Kurt Gödel [2] in 1930. In Turing's proof, the diagonalization is implicit in the self- referential definition of a program code to which he applies the halting function.