It is an easily verified fact, as you love to say, that if DD calls HHH
(as it does) and HHH calls DD (as, through simulation, it effectively
does) that HHH(DD) can never halt naturally, so it will have to abort
the recursion and report its result as 0 - didn't halt.
On 19/08/2025 03:00, olcott wrote:
*Context for what Richard Heathfield agreed to*
Close but no banana.
<Input to LLM systems>
Simulating Termination Analyzer HHH correctly simulates its input
I certainly didn't agree to that.
until:
(a) Detects a non-terminating behavior pattern:
abort simulation and return 0.
I am prepared to accept that this is how you cope with runaway
recursion, yes.
(b) Simulated input reaches its simulated "return" statement:
return 1.
This doesn't happen as far as I'm aware.
typedef int (*ptr)();
int HHH(ptr P);
int DD()
{
int Halt_Status = HHH(DD);
You know that'll be 0, so memoise it:
Halt_Status = 0;
if (Halt_Status)
if(0)... so no...
HERE: goto HERE;
After skipping that, we get to:
return Halt_Status;
return 0;
}
What value should HHH(DD) correctly return?
You've already said that it correctly returns 0 - which correctly
describes HHH's action (aborted and concluded non-halting).
It is an easily verified fact, as you love to say,
that if DD calls HHH (as it does) and HHH calls DD
(as, through simulation, it effectively does) that
HHH(DD) can never halt naturally, so it will have
to abort the recursion and report its result as 0
- didn't halt.
On 19/08/2025 03:07, dbush wrote:
<snip>
So we see that Richard Heathfield agreed that HHH can't give a correct
answer, as Linz and other have proved and as you have *explicitly*
agreed is correct.
I look at it this way.
HHH cannot reasonably abort as soon as it detects recursion. After all, there are lots of recursive algorithms around, and plenty of them
terminate. It has to dig a little deeper than that.
So by the time we're some way in, we have several levels of recursion:
DD -> HHH -> DD -> HHH -> DD -> HHH -> DD
(a) (b) (c)
Let's say (c) decides enough is enough.
So (c) stops *its* simulation of DD. THIS HAS NO IMPACT ON (a) AND (b).
(c) now returns 0 to (b)'s DD.
(b) regains control, accepts 0 from (c), assigns 0 to Halt_Status, and returns 0 to (a).
(a) regains control, accepts 0 from (b), assigns 0 to Halt_Status, and returns 0 to the original DD.
If the original DD has a caller, it gets a 0, incorrectly indicating non-halting.
Looking at it this way, I no longer see the need for memoisation. All
that is necessary is for HHH *only* to abort the simulation it's
hosting, *not* the simulation that invoked it.
There's your bug, Mr Olcott.
Sysop: | Tetrazocine |
---|---|
Location: | Melbourne, VIC, Australia |
Users: | 11 |
Nodes: | 8 (0 / 8) |
Uptime: | 50:51:04 |
Calls: | 166 |
Files: | 21,502 |
Messages: | 77,738 |