Software engineers competent in C and the x86 language will verify that when H(P,P) correctly emulates its input with an x86 emulator that this emulation would never stop running. This provides the basis for H(P,P) to correctly reject its input as non-halting.
For any program H that might determine if programs halt, a "pathological" program P, called with some input, can pass its own source and its input to H and then specifically do the opposite of what H predicts P will do. No H can exist that handles this case. https://en.wikipedia.org/wiki/Halting_problem
H determines the halt status of its input by watching the behavior of this input when it is correctly simulated by H using an x86 emulator. When H correctly matches an infinite behavior pattern it aborts the emulation of this input and returns 0.
#include <stdint.h>
#define u32 uint32_t
void P(u32 x)
{
if (H(x, x))
HERE: goto HERE;
return;
}
int main()
{
Output("Input_Halts = ", H((u32)P, (u32)P));
}
_P()
[00001352](01) 55 push ebp
[00001353](02) 8bec mov ebp,esp
[00001355](03) 8b4508 mov eax,[ebp+08]
[00001358](01) 50 push eax // push P
[00001359](03) 8b4d08 mov ecx,[ebp+08]
[0000135c](01) 51 push ecx // push P
[0000135d](05) e840feffff call 000011a2 // call H
[00001362](03) 83c408 add esp,+08
[00001365](02) 85c0 test eax,eax
[00001367](02) 7402 jz 0000136b
[00001369](02) ebfe jmp 00001369
[0000136b](01) 5d pop ebp
[0000136c](01) c3 ret
Size in bytes:(0027) [0000136c]
It is completely obvious that when H(P,P) correctly emulates its input that it must emulate the first seven instructions of P. Because the seventh instruction repeats this process we can know with complete certainty that the emulated P never reaches its final “ret” instruction, thus never halts.
You say that H(P,P) = 0. But then P(P) will never enter the infinite loop and will in fact halt, so that H(P,P) should return 1 @amon
(1) Deciders(computer science) compute the mapping from their inputs to an accept or reject state.
(2) The actual behavior of the actual input to H(P,P) is proven to never halt.
(3) P(P) is not an input to H, thus out-of-scope for H.
The actual behavior of the correctly simulated input to H(P,P) is not the same as the actual behavior of P(P) because the specified sequence of instructions is not the same.
Because halt deciders must report on the actual behavior of their actual inputs H(P,P)==0 is correct even though P(P) halts.
int sum(int x, int y)
{
return x + y;
}
Expecting H(P,P) to report on the behavior of an entirely different sequence of instructions than its input actually specifies is exactly the same as expecting sum(3,4) to return the sum of 5 + 7, quite nuts.