3 ms·
The halting problem asks, "Is it possible to write a program which correctly outputs YES or NO to the halting question for every possible input which is the cod
by jlokier 3y ago
The halting problem asks, "Is it possible to write a program which correctly outputs YES or NO to the halting question for every possible input which is the code of a program?"
The binary requirement comes from the question, not a failure to think differently. The consequences of binary requirement with completeness (correct output for every input) is the point.
If you modify the question as you suggest, to output UNRESOLVABLE in exactly the cases where the input is a paradox, that doesn't work either. It is not possible to reliably detect every self-referential paradox, for reasons analogous to (but more complicated than) it not being possible to reliably say for every program if it will eventually halt.
Even so, it is possible to write a program which outputs UNRESOLVABLE in cases where that particular implementation of a halt-test program gets stumped and gives up despite there being another correct answer it hasn't found, or when it detects specific patterns. But that's more about hitting arbitrary limits of a particular implementation, so not as interesting theoretically. It is what you'd do in practice, if someone asked you to write a halting detector in the real world.
The halting problem computation model has unlimited memory. Sometimes people say this means you can "solve" the halting problem in practice because real machines have bounded memory, therefore finite states, which must eventually repeat if a program does not halt. But this isn't really a solution, because the halt-test program needs exponentially more memory than the input program would be allowed if run. However you look at it, that is not "in practice", it is prevented by computational inaccessibility, and it also doesn't satisfy the principle of the halting problem, which is to ask if halt-test can be written in the same kind of universal programming system as the programs it analyses. (Besides, you can run programs with unlimited memory, by always being willing to pause, upgrade machine, and resume, whenever current memory is filled.)
When analysed with denotational semantics, there actually is a third output called "bottom" (⊥) which means "mathematical value representing doesn't terminate". But even using mathematical approaches, there is no way to calculate when that's the output for all possible inputs to a correct halt-test function.