| ISSUE 397/456 · COMPUTER SCIENCE |
~4 MIN |
FOUNDATION / COMPUTER SCIENCE · READING DATE 2027-11-02 · NOVEMBER 2027 — MATTER AND COMPUTATION LIMITS
Why no program can catch every endless program
START HERE
A computer can keep working without ever producing the answer you are waiting for. The halting problem asks whether a specified program, given a specified input, eventually stops. No checking program can always answer that question correctly for every possible program and input.
|
/ WHY NOW
This is not a complaint about slow processors. It is a limit on what an all-purpose automatic checker can promise, even when there is no fixed deadline for each case, provided it must eventually answer.
|
/ THE IDEA
The reason is a contradiction constructed from the checker itself. Suppose a perfect checker H exists. Programs can be stored as text, so one program can inspect the text of another. Build a new program D that asks H whether its input program stops when given its own text. D then deliberately does the opposite: if H predicts stopping, D runs forever; if H predicts running forever, D stops. There is nothing impossible about implementing this reversal if H really exists. The trouble appears when D receives its own text as input.
THE FORMAL IDEA
D(p): if H(p,p) says stops, loop; otherwise stop
| p = program text; H(p,p) = the supposed prediction for running that text on itself. | | D is the reversing program. These are rules, not physical quantities, so there are no measurement units; loop means continue indefinitely. |
|
RUN THE TINY EXAMPLE
Change one thing. Predict what happens.
Give D the text of a simple program that immediately stops. H must say stops, so D deliberately runs forever. Change the input to a simple program that always loops. H must say loops, so D stops. Now give D its own text: either prediction is contradicted by its next action.
|
If H predicts that D(D) stops, the constructed rule makes it loop. If H predicts that D(D) loops, the rule makes it stop. Both possible answers fail, so the assumption of a universally correct H must be false.
/ SO WHAT?
A real analysis tool can still prove that many particular programs finish. A loop counting down a non-negative integer to zero is a useful restricted case. Tools can also impose timeouts, inspect special languages, or return unknown when they cannot establish an answer. Those are meaningful engineering contracts without the impossible universal guarantee.
ONE CAVEAT |
| The theorem concerns arbitrary programs in a general computation model, not an inability to analyse any individual program. A timeout reports that a deadline passed; it does not prove the program would run forever. |
KEEP THIS
When a checker promises a definite answer for every unrestricted program, expect either mistakes, non-termination, or a hidden restriction.
|
NEXT: How atoms move through a solid without melting it
|