Assume that there is a function H(P,d) which takes a Program P and an input data set d. If P halts when give d as input, H returns true, otherwise it returns false. Consider the following program:G(G,d)
If H predicts G will halt, in line 1, it will loop forever in line 2 otherwise it will exit in line 4. Therefore H does not properly predict G's exit status. Thus the assumption that H exists is false.- if (H(G,d)) then
- loop forever
- else
- exit