Deutsch English Français Italiano |
<v2df79$3ghfd$1@raubtier-asyl.eternal-september.org> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!news.mixmin.net!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!raubtier-asyl.eternal-september.org!.POSTED!not-for-mail From: Bonita Montero <Bonita.Montero@gmail.com> Newsgroups: comp.lang.c,comp.lang.c++ Subject: Re: Can someone please verify the execution trace of this? Date: Sun, 19 May 2024 20:08:46 +0200 Organization: A noiseless patient Spider Lines: 46 Message-ID: <v2df79$3ghfd$1@raubtier-asyl.eternal-september.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: Sun, 19 May 2024 20:08:42 +0200 (CEST) Injection-Info: raubtier-asyl.eternal-september.org; posting-host="2b7ac12b1239cd563de65ce83385f259"; logging-data="3687917"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+lSno4vWlPcxKMZaTZRbI0LjtRF9IJfvg=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:iYjcp3NtHH1mENIPvb0qVJlxBBw= Content-Language: de-DE In-Reply-To: <v2b78t$2vima$1@dont-email.me> Bytes: 2510 Am 18.05.2024 um 23:40 schrieb olcott: > 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) > 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. > Other people think 30s about this, you think years about that.