Liste des Groupes | Revenir à theory |
On 5/8/2025 8:30 PM, Keith Thompson wrote:olcott <polcott333@gmail.com> writes:>On 5/8/2025 6:49 PM, Keith Thompson wrote:Does HHH correctly simulate DDD *and do nothing else*?olcott <polcott333@gmail.com> writes:>
[...]void DDD()"cannot possibly each"?
{
HHH(DDD);
return;
}
>
If you are a competent C programmer then you
know that DDD correctly simulated by HHH cannot
possibly each its own "return" instruction.
I am a competent C programmer (and I don't believe you can make
the same claim). I don't know what HHH is. The name "HHH" tells
me nothing about what it's supposed to do. Without knowing what
HHH is, I can't say much about your code (or is it pseudo-code?).
>
For the purpose of this discussion HHH is exactly
what I said it is. It correctly simulates DDD.
Does HHH correctly simulate *every* function whose address is passed
to it? Must the passed function be one that takes no arguments
and does not return a value?
Can HHH just *call* the function whose address is passed to it?
If it's a correct simulation, there should be no difference between
calling the function and "correctly simulating" it.
My knowledge of C tells me nothing about *how* HHH might simulate
DDD.
HHH can only simulate a function that take no arguments
and has no return value. HHH also simulates the entire
chain of functions that this function calls. These can
take arguments or not and have return values or not.
>
Thus HHH ends up simulating itself (and everything
that HHH calls) simulating DDD in an infinite
sequence of recursive emulation until OOM error.
>>We need not know anything else about HHH toAssuming that HHH(DDD) "correctly simulates" DDD, and assuming it
know that DDD correctly simulated by HHH cannot
possibly REACH its own "return" instruction.
does nothing else, your code would be equivalent to this:
void DDD(void) {
DDD();
return;
}
Exactly. None of these people on comp.theory could
get that even after three years.
Then the return statement (which is unnecessary anyway) will never be>
reached.
It is only there to mark a final halt state.
In practice, the program will likely crash due to a stack>
overflow, unless the compiler implements tail-call optimization, in
which case the program might just run forever -- which also means the
unnecessary return statement will never be reached.
Yes you totally have this correctly.
None of the dozens of comp.theory people could
ever achieve that level of understanding even
after three years. That is why I needed to post
on comp.lang.c.
This conclusion relies on my understanding of what you've said about>
your code, which I consider to be unreliable.
I am not even talking about my code. I am
talking about the purely hypothetical code
that you just agreed to.
No doubt you believe that there is some significance to the>
apparent fact that the return statement will never be reached,
assuming that's a correct and relevant conclusion. I don't know
what that significance might be.
I will tell you that later after you understand
some prerequisite ideas first.
>
int DD()
{
int Halt_Status = HHH(DD);
if (Halt_Status)
HERE: goto HERE;
return Halt_Status;
}
The same thing that applied to DDD equally
applies to the more complicated DD.
>
When 1 or more instructions of DD are correctly
simulated by HHH the correctly simulated DD
cannot possibly get past its call to HHH(DD).
Thus DD also never reaches its "return" instruction.
Les messages affichés proviennent d'usenet.