Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: olcott Newsgroups: comp.lang.c Subject: Re: Can you see that D correctly simulated by H remains stuck in recursive simulation? Date: Sat, 25 May 2024 06:42:59 -0500 Organization: A noiseless patient Spider Lines: 88 Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 25 May 2024 13:43:01 +0200 (CEST) Injection-Info: dont-email.me; posting-host="010db72b80f31f696ef17c51994f71bb"; logging-data="3015373"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+LVOuo8mFxCj4+0WFx7p3B" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:cyu+fDXoFYH1mbEBkfjryECr5B0= In-Reply-To: Content-Language: en-US Bytes: 4340 On 5/25/2024 4:59 AM, Mikko wrote: > On 2024-05-24 16:57:36 +0000, olcott said: > >> On 5/24/2024 10:01 AM, Fred. Zwarts wrote: >>> Op 23.mei.2024 om 18:52 schreef olcott: >>>> typedef int (*ptr)();  // ptr is pointer to int function in C >>>> 00       int H(ptr p, ptr i); >>>> 01       int D(ptr p) >>>> 02       { >>>> 03         int Halt_Status = H(p, p); >>>> 04         if (Halt_Status) >>>> 05           HERE: goto HERE; >>>> 06         return Halt_Status; >>>> 07       } >>>> 08 >>>> 09       int main() >>>> 10       { >>>> 11         H(D,D); >>>> 12         return 0; >>>> 13       } >>>> >>>> The above template refers to an infinite set of H/D pairs where D is >>>> correctly simulated by pure function H. This was done because many >>>> reviewers used the shell game ploy to endlessly switch which H/D was >>>> being referred to. >>>> >>>> *Correct Simulation Defined* >>>> This is provided because every reviewer had a different notion of >>>> correct simulation that diverges from this notion. >>>> >>>> In the above case a simulator is an x86 emulator that correctly >>>> emulates >>>> at least one of the x86 instructions of D in the order specified by the >>>> x86 instructions of D. >>>> >>>> This may include correctly emulating the x86 instructions of H in the >>>> order specified by the x86 instructions of H thus calling H(D,D) in >>>> recursive simulation. >>>> >>>> *Execution Trace* >>>> Line 11: main() invokes H(D,D); H(D,D) simulates lines 01, 02, and >>>> 03 of >>>> D. This invokes H(D,D) again to repeat the process in endless recursive >>>> simulation. >>> >>> The case can be simplified even more (D is not needed): >>> >> >> We are ONLY asking about whether D correctly simulated by pure >> function H can possibly reach its own final state at line 06 and halt. >> >> Because H is a pure function we know that H halts. > > We don't know that H halts. The OP said the opposite: > The above references *pure function* H thus we do know that the spec *requires* H to halt. https://en.wikipedia.org/wiki/Pure_function > On 2024-05-23 16:52:21 +0000, olcott said: >> *Execution Trace* >> Line 11: main() invokes H(D,D); H(D,D) simulates lines 01, 02, and 03 of >> D. This invokes H(D,D) again to repeat the process in endless recursive >> simulation. > > To repeat in endless recursve simulation makes halting impossible. > Apparently OP's interpretation of "pure function" does not imply > halting. > Every H is required to halt and return a value. To make things simple every H returns the meaningless 56. It is endless recursive simulation until H halts. I had to refer to endless recursive simulation so that people could get the gist of what is going on while hardly paying any attention at all. The reason that I had to add that H is a pure function is that Richard tried to cheat using static local data. Prior to that there was no requirement that H halt. -- Copyright 2024 Olcott "Talent hits a target no one else can hit; Genius hits a target no one else can see." Arthur Schopenhauer