Liste des Groupes | Revenir à c theory |
olcott <polcott333@gmail.com> writes:HHH can only simulate a function that take no argumentsOn 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.
Exactly. None of these people on comp.theory couldWe 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;
}
Then the return statement (which is unnecessary anyway) will never beIt is only there to mark a final halt state.
reached.
In practice, the program will likely crash due to a stackYes you totally have this correctly.
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.
This conclusion relies on my understanding of what you've said aboutI am not even talking about my code. I am
your code, which I consider to be unreliable.
No doubt you believe that there is some significance to theI will tell you that later after you understand
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.
--Microsoft Visual Studio 2017 is not a conforming C compiler. It hasThe return statement is harmless but unnecessary.>
"void DDD()" should be "void DDD(void)" (unless you're using C23,
but
we've established that your not). Why did you choose to use empty
parentheses? (If you answer nothing else, please answer that.)
I am using Microsoft Visual Studio 2017.
It compiled cleanly.
options that cause it to attempt to be one. You are feeding it
incorrect code, and it's failing to diagnose it. Your code would
also compile cleanly if you fixed the errors. *Correct* C code
might be part of a more valid argument for your claims than the
one you're making. *Incorrect* C code hurts your credibility,
something I thought you cared about. (Using C at all is an odd
choice, but I won't get into that.)
If there were a refutation of the proof of the insolubility of the
Halting Problem, I do not believe it would really depend on the
vagaries of the 2017 version of Microsoft Visual Studio.
Oh, and I'm very likely to tire of this discussion very soon, so
think carefully if you want to make a point that you'd like me to
pay attention to. Among other things, your repeated insults against
people who dare to disagree with you do not motivate me to engage
with you. I probably shouldn't have jumped into this discussion,
but the noise level here is already so high I don't feel very bad
about it.
Les messages affichés proviennent d'usenet.