Deutsch English Français Italiano |
<vqrkao$2hn81$1@dont-email.me> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: Mikko <mikko.levanto@iki.fi> Newsgroups: comp.theory Subject: Re: Every sufficiently competent C programmer knows Date: Wed, 12 Mar 2025 11:32:08 +0200 Organization: - Lines: 92 Message-ID: <vqrkao$2hn81$1@dont-email.me> References: <vqntaq$1jut5$1@dont-email.me> <vqotps$1snjg$1@dont-email.me> <vqp1l9$1tful$1@dont-email.me> <vqpdmv$202b2$1@dont-email.me> <vqpfq9$20nrj$1@dont-email.me> <vqq26l$24m6v$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Wed, 12 Mar 2025 10:32:09 +0100 (CET) Injection-Info: dont-email.me; posting-host="4800ed2580b521525ad65aa6595e0d98"; logging-data="2678017"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18gLWpf1EJZA9owU6Jce7cC" User-Agent: Unison/2.2 Cancel-Lock: sha1:ZcLeC4IrR7XtAOAtXGsNNZYdLYk= Bytes: 4089 On 2025-03-11 19:16:35 +0000, olcott said: > On 3/11/2025 9:02 AM, Mikko wrote: >> On 2025-03-11 13:26:55 +0000, olcott said: >> >>> On 3/11/2025 5:01 AM, Richard Heathfield wrote: >>>> On 11/03/2025 08:55, Fred. Zwarts wrote: >>>>> Op 11.mrt.2025 om 00:41 schreef olcott: >>>>>> typedef void (*ptr)(); >>>>>> int HHH(ptr P); >>>>>> >>>>>> void Infinite_Loop() >>>>>> { >>>>>> HERE: goto HERE; >>>>>> return; >>>>>> } >>>>>> >>>>>> void Infinite_Recursion() >>>>>> { >>>>>> Infinite_Recursion(); >>>>>> return; >>>>>> } >>>>>> >>>>>> void DDD() >>>>>> { >>>>>> HHH(DDD); >>>>>> return; >>>>>> } >>>>>> >>>>>> int DD() >>>>>> { >>>>>> int Halt_Status = HHH(DD); >>>>>> if (Halt_Status) >>>>>> HERE: goto HERE; >>>>>> return Halt_Status; >>>>>> } >>>>>> >>>>>> That when HHH correctly emulates N steps of the >>>>>> above functions that none of these functions can >>>>>> possibly reach their own "return" instruction >>>>>> and terminate normally. >>>>>>> >>>>>> >>>>>> Since HHH does see that same pattern that competent >>>>>> C programmers see it correctly aborts its emulation >>>>>> and rejects these inputs as non terminating. >>>>> >>>>> All competent C programmers see that HHH correctly reports that it >>>>> cannot possibly reach the 'return' instruction. >>>> >>>> First, my credentials. I've been programming in C for over 35 years; >>>> I'm told that my book on C has been used on two undergraduate Comp Sci >>>> courses (one in the States and one in the UK); and I have my Knuth >>>> cheque. I don't claim to be any kind of programming guru, but I hope I >>>> do not overstate the case when I suggest that I can be regarded as >>>> competent not just as a programmer but specifically in the C language. >>>> >>>> And yet I can't even /see/ HHH, let alone judge what it does or does >>>> not do correctly. All I see is a call to it. >>> >>> It is stipulated that HHH correctly emulates N >>> steps of the x86 machine code of its input functions. >>> This may or may not include HHH emulating itself >>> emulating an input. >> >> The stipulation does not include the value of N (although a reasonable >> interpretation is that it is finite). Nor does the stipulation specify >> what HHH does after the emulation. >> > > It need not those are totally > irrelevant to the primary point: > > When HHH correctly emulates N steps of the > above functions none of these functions can > possibly reach their own "return" instruction > and terminate normally. That's almost self-evident. Unless some special fieatures of C are used, and none of these are used above, no other function can do anything when one functin does something. > For HHH(DDD) and HHH(DD) it is stipulated that > HHH does correctly emulate itself emulating > these inputs. But not that the emulation is complete, the emulation is discontinued when the total step count is N. -- Mikko