Can you see that halt decider H(P,P)==0 is correct? (simplified)

What is the basis for reason? And mathematics?

Moderators: AMod, iMod

Post Reply
PeteOlcott
Posts: 1514
Joined: Mon Jul 25, 2016 6:55 pm

Can you see that halt decider H(P,P)==0 is correct? (simplified)

Post by PeteOlcott »

When a simulating halt decider rejects all inputs as non-halting whenever it correctly detects 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)

Code: Select all

#include <stdint.h>
typedef void (*ptr)();

void P(ptr x) 
{
  if (H(x, x)) 
    HERE: goto HERE; 
  return; 
} 

int main() 
{ 
  Output("Input_Halts = ", H(P, 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]
(1) It is an easily verified fact that when we assume that H is only an x86 emulator that the correctly emulated P never reaches its "ret" instruction it remains stuck in repeated cycles of emulation.

(2) It is an easily verified fact that if H has been adapted to correctly detect (in a finite number of steps) that the correct and complete x86 emulation of its input would never each its "ret" instruction that H could abort its emulation and return 0 to report this.

(3) When the halt status criteria is defined as correctly determining whether or not an x86 emulated input would ever reach its "ret" instruction then it becomes an easily verified fact H(P,P) could correctly reject its input as non-halting.

Correct deductive inference proves that all of these things are true without any need what-so-ever to see either the source-code or the execution trace of H.

The one thing that is not proved is whether or not an actual encoded H(P,P) does indeed correctly determine that its input would never reach its "ret" instruction as a pure function of its inputs.
Post Reply