When a simulating halt decider rejects all inputs as non-halting
whenever it correctly detects (in a finite number of steps) that its
correct and complete simulation of its input would never reach the final
state of this input that all [these] inputs (including pathological
inputs) are decided correctly.
*computation that halts* … the Turing machine will halt whenever it
enters a final state. (Linz:1990:234)
Linz, Peter 1990. An Introduction to Formal Languages and Automata.
Lexington/Toronto: D. C. Heath and Company. (317-320)
void P(u32 x)
{
if (H(x, x))
HERE: goto HERE;
return;
}
int main()
{
Output("Input_Halts = ", H((u32)P, (u32)P));
}
_P()
[0000127e](01) 55 push ebp
[0000127f](02) 8bec mov ebp,esp
[00001281](03) 8b4508 mov eax,[ebp+08]
[00001284](01) 50 push eax
[00001285](03) 8b4d08 mov ecx,[ebp+08]
[00001288](01) 51 push ecx
[00001289](05) e820feffff call 000010ae
[0000128e](03) 83c408 add esp,+08
[00001291](02) 85c0 test eax,eax
[00001293](02) 7402 jz 00001297
[00001295](02) ebfe jmp 00001295
[00001297](01) 5d pop ebp
[00001298](01) c3 ret
Size in bytes:(0027) [00001298]
_main()
[0000129e](01) 55 push ebp
[0000129f](02) 8bec mov ebp,esp
[000012a1](05) 687e120000 push 0000127e
[000012a6](05) 687e120000 push 0000127e
[000012ab](05) e8fefdffff call 000010ae
[000012b0](03) 83c408 add esp,+08
[000012b3](01) 50 push eax
[000012b4](05) 680f040000 push 0000040f
[000012b9](05) e8a0f1ffff call 0000045e
[000012be](03) 83c408 add esp,+08
[000012c1](02) 33c0 xor eax,eax
[000012c3](01) 5d pop ebp
[000012c4](01) c3 ret
Size in bytes:(0039) [000012c4]
machine stack stack machine assembly
address address data code language
======== ======== ======== ========= =============
...[0000129e][0010201f][00000000] 55 push ebp
...[0000129f][0010201f][00000000] 8bec mov ebp,esp
...[000012a1][0010201b][0000127e] 687e120000 push 0000127e // push P
...[000012a6][00102017][0000127e] 687e120000 push 0000127e // push P
...[000012ab][00102013][000012b0] e8fefdffff call 000010ae // call H
*Begin Local Halt Decider Simulation* Execution Trace Stored at:2120d3
...[0000127e][002120bf][002120c3] 55 push ebp
...[0000127f][002120bf][002120c3] 8bec mov ebp,esp
...[00001281][002120bf][002120c3] 8b4508 mov eax,[ebp+08]
...[00001284][002120bb][0000127e] 50 push eax // push P
...[00001285][002120bb][0000127e] 8b4d08 mov ecx,[ebp+08]
...[00001288][002120b7][0000127e] 51 push ecx // push P
...[00001289][002120b3][0000128e] e820feffff call 000010ae // call H
*Infinitely Recursive Simulation Detected Simulation Stopped*
H knows its own machine address and on this basis
H recognizes that P is calling H with its same arguments that it
was called with and there are no instructions preceding this call that
could possibly escape infinitely recursive emulation so H aborts its
emulation of P before P even makes its first call to H.
...[000012b0][0010201f][00000000] 83c408 add esp,+08
...[000012b3][0010201b][00000000] 50 push eax
...[000012b4][00102017][0000040f] 680f040000 push 0000040f
---[000012b9][00102017][0000040f] e8a0f1ffff call 0000045e
Input_Halts = 0
...[000012be][0010201f][00000000] 83c408 add esp,+08
...[000012c1][0010201f][00000000] 33c0 xor eax,eax
...[000012c3][00102023][00100000] 5d pop ebp
...[000012c4][00102027][00000004] c3 ret
Number of Instructions Executed(1134) == 17 pages
Halting problem undecidability and infinitely nested simulation (V5)
https://www.researchgate.net/publication/359984584_Halting_problem_undecidability_and_infinitely_nested_simulation_V5