Liste des Groupes | Revenir à theory |
On 11/03/2025 18:33, wij wrote:On Tue, 2025-03-11 at 18:23 +0000, Richard Heathfield wrote:On 11/03/2025 17:42, Mike Terry wrote:Finally, if you really want to see the actual HHH code, its in
the halt7.c file (along with DDD) that PO provides links to from
time to time. However it's not very illuminating due to
bugs/design errors/misunderstandings which only serve to
obfuscate PO's errors in thinking.
[I've now seen the code. Oh deary deary me.]
Thank you for a spirited attempt to be cogent - or at least as
cogent as it is possible to be in the circumstances!
I think PO's first step must be to demonstrate that HHH()
correctly diagnoses some easy functions, such as these:
int rha(unsigned int i)
{
while(--i > 0)while(--i > 0);
return 0;
}
int rhb(unsigned int i)
{
if(i > 0)
{
rhb(i/10);
}
return putchar(i + '0');
}
int rhc(unsigned int i)
{
typedef int(*pf)(unsigned int);
pf arr[3] = {rha, rhb, rhc};
return arr[i % 3];
}
and other such obvious tests.
HHH(), the procedure that decides whether a program halts, is
required to work for all programs and all inputs. Does it work on
those cited above? I'm guessing it doesn't.
No TM can simulate itself.
It doesn't have to. For a start, it can take source code as input
and analyse it in much the same way that a compiler does.
Proving HP in this way is dead end.
Proving it any way is a dead end, because the answer to the
Halting Problem is already known, and has been known since at
least 1936.
But if the OP is /going/ to write a decision function to attack
the Halting Problem, he either writes a general purpose decision
function or risks tackling the wrong problem.
Les messages affichés proviennent d'usenet.