Sujet : Can D simulated by any H possibly reach its own line 06 and halt?
De : polcott333 (at) *nospam* gmail.com (olcott)
Groupes : comp.lang.c comp.lang.c++Date : 21. May 2024, 05:22:17
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v2h7hp$e6nb$1@dont-email.me>
References : 1 2 3 4 5 6 7 8
User-Agent : Mozilla Thunderbird
On 5/20/2024 11:00 PM, Chris M. Thomasson wrote:
What is his point?
Keith Thompson verified it does compile and is c17
standard compliant.
*I renamed this thread to focus on the key point*
*I renamed this thread to focus on the key point*
*I renamed this thread to focus on the key point*
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 }
The above template specifies and infinite set of H/D pairs where
*pure function* H correctly simulates N steps of D with an x86 emulator.
https://en.wikipedia.org/wiki/Pure_function#*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.
I need to verify that D correctly simulated by any *pure function*
H cannot possibly reach its own line 06 and halt.
Richard just found a loophole using static local data, so I added
the *pure function* requirement.
-- Copyright 2024 Olcott "Talent hits a target no one else can hit; Geniushits a target no one else can see." Arthur Schopenhauer