Deutsch English Français Italiano |
<v2bach$1ecja$1@i2pn2.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.misty.com!weretis.net!feeder9.news.weretis.net!i2pn.org!i2pn2.org!.POSTED!not-for-mail From: Richard Damon <richard@damon-family.org> Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: Can someone please verify the execution trace of this? Date: Sat, 18 May 2024 18:33:53 -0400 Organization: i2pn2 (i2pn.org) Message-ID: <v2bach$1ecja$1@i2pn2.org> References: <v2b78t$2vima$1@dont-email.me> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Sat, 18 May 2024 22:33:53 -0000 (UTC) Injection-Info: i2pn2.org; logging-data="1520234"; mail-complaints-to="usenet@i2pn2.org"; posting-account="diqKR1lalukngNWEqoq9/uFtbkm5U+w3w6FQ0yesrXg"; User-Agent: Mozilla Thunderbird In-Reply-To: <v2b78t$2vima$1@dont-email.me> Content-Language: en-US X-Spam-Checker-Version: SpamAssassin 4.0.0 Bytes: 2461 Lines: 49 On 5/18/24 5:40 PM, olcott wrote: > People are saying that they have no idea what this code does > because they do not believe it conforms to c11 or c17. > > typedef int (*ptr)(); // ptr is pointer to int function > 00 int H(ptr x, ptr y); > 01 int D(ptr x) > 02 { > 03 int Halt_Status = H(x, x); > 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 } > > 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); > > *keeps repeating* (unless aborted) But since you have defined that H WILL abort, that is irrelevant. > Line 01: > Line 02: > Line 03: simulated D(D) invokes simulated H(D,D) that simulates D(D) > > *Simulation invariant* > D correctly simulated by H cannot possibly reach past its own line 03. > > The key thing to note is that no D correctly simulated by any H of every > H/D pair specified by the above template ever reaches its own line 06 > and halts. > Without defining what H is, you can't define what the simulation is. You are just showing that you don't understand what you are talking about.