Generic system to overcome the halting problem proofs
We can ask the halt deciding question in a way that allows the input
program to do the opposite of whatever the halt decider decides:
"Does this input program halt on its input (yes or no)?"
Or we can ask the halt deciding question in such a way where it is
impossible for the input program to do the opposite of what the halt
decider decides:
Did the UTM halt decider have to stop executing its subordinate UTM to
prevent its own infinite execution?
The UTM halt decider executes its subordinate UTM one state transition
at a time until it decides that it must stop the execution of its
subordinate UTM or its subordinate UTM has terminated normally.
The halt decider UTM transitions to one of two final states
((qn)) or ((qy)) indicating its decision.
Here is the same thing as a conventional software function:
bool Aborted_Because_Non_Halting_Behavior_Detected(u32 P, u32 I)
Specific details of overcoming the Peter Linz Halting problem proof
The following code is based on the Peter Linz H and Ĥ
http://www.liarparadox.org/Peter_Linz_HP(Pages_315-320).pdf
I created the x86utm operating system on the basis of a very excellent
x86 emulator. The x86 emulator is written in "C" and has been adapted to
run on Linux and Windows.
x86 language ≡ von Neumann architecture ≡ UTM
x86utm operating system is written in C++ and provides a way to
functions written in "C" to be converted into virtual machines that are
executed in their own process context. The x86 machine language is the
the description language of these UTM equivalents and can be directly
executed in x86utm.
main() executes H() and
Aborted_Because_Non_Halting_Behavior_Detected(M, M)) in the process
context of x86utm. Aborted_Because_Non_Halting_Behavior_Detected(M, M))
creates a whole new process context to execute H_Hat() in a DebugTrace()
DebugStep() mode. All of this is fully operational.
// M has the machine address of H_Hat()
void H_Hat(u32 M)
{
if (Aborted_Because_Non_Halting_Behavior_Detected(M, M))
MOV_EAX_0 // Execution of M(N) has been aborted
else
{
MOV_EAX_1 // M(N) has halted
HERE: goto HERE;
}
HALT
}
// M and N have the machine address of H_Hat()
void H(u32 M, u32 N)
{
if (Aborted_Because_Non_Halting_Behavior_Detected(M, M))
MOV_EAX_0 // Execution of M(N) has been aborted
else
MOV_EAX_1 // M(N) has halted
HALT
}
int main()
{
u32 M = (u32)H_Hat;
H(M, M); // MOV_EAX_0
HALT
}
Continuing from above: H_Hat() executes another instance of
Aborted_Because_Non_Halting_Behavior_Detected(M, M) in its own process
context which creates another process context to execute a second
instance of H_Hat().
As soon as the second H_Hat() would execute
Aborted_Because_Non_Halting_Behavior_Detected(M, M) a second time from
the same machine address the first instance of
Aborted_Because_Non_Halting_Behavior_Detected(M, M) recognizes that
H_Hat() is infinitely recursive. // 2018-12-13 @7:00 PM solution
This first instance stops executing H_Hat() which has invoked the second
instance of Aborted_Because_Non_Halting_Behavior_Detected(M, M) which is
executing the second instance of H_Hat().
The outer Aborted_Because_Non_Halting_Behavior_Detected(M, M) has
terminated the whole process tree (or hierarchy of UTMs executing other
UTMs) before the second instance has returned a value.
Although I have this complete detailed description of exactly how H()
correctly decides halting on H_Hat() the code for this has not been
written. It will be written shortly. Creating the x86utm operating
system took about a man-year working almost all the time. I am reducing
my coding time to less the 40 hours per week.
--
Copyright 2020 Pete Olcott