Re: Is the Halting Problem merely an ill-formed question?
- From: "george" <greeneg@xxxxxxxxxx>
- Date: 25 Oct 2006 15:19:31 -0700
Peter Olcott wrote:
int WillHalt(string SourceCode, string InputData) {
if ( TheProgramWillHalt(SourceCode, InputData) )
return TRUE;
else
return FALSE;
}
You haven't written "TheProgramWillHalt".
That's because "TheProgramWillHalt" is not writeABLE.
IT DOESN'T EXIST. More to the point, if I were still TAing
introductory C++ and you handed me this piece of crap,
it would get half-off just for not knowing what "if()" means in C.
You NEVER write
if(something) then return TRUE;else return FALSE;
You ALWAYS INSTEAD write
return(something);
ANYthing that can go inside if() is ALREADY boolean
and therefore can ALREADY be returned, ITSELF.
In other words, the body of what you just wrote is exactly equivalent
to {
return(TheProgramWillHalt(SourceCode,InputData));
}
which means that WillHalt IS TheProgramWillHalt.
In other words, since you couldn't begin to write any actual code for
TheProgramWillHalt, you just wrapped some vaporware around it
and tried to make it look like you were doing something.
void LoopIfHalts(string SourceCode) {
if ( WillHalt(SourceCode, SourceCode) == TRUE )
while (TRUE) // loop forever
;
else
return;
}
LoopIfHalts(LoopIfHalts);
Which of the two possible values (TRUE or FALSE) can
WillHalt() correctly return
in this case?
Since WillHalt() can't exist (since "TheProgramWillHalt" can't exist),
this is an entirely moot question.
If, on the other hand, you would actually like to provide a written
stab at
"TheProgramWillHalt", then you won't have to ask US this question:
you can just RUN IT AND SEE.
.
- Prev by Date: Question about Quine's New Foundations
- Next by Date: Re: The Modified Halting Problem, Take ??? .
- Previous by thread: Re: Is the Halting Problem merely an ill-formed question?
- Next by thread: Re: Is the Halting Problem merely an ill-formed question?
- Index(es):
Relevant Pages
|