Sujet : Re: Can someone please verify the execution trace of this?
De : polcott333 (at) *nospam* gmail.com (olcott)
Groupes : comp.lang.c comp.lang.c++Date : 20. May 2024, 16:10:11
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v2fp4j$1pfh$2@dont-email.me>
References : 1 2
User-Agent : Mozilla Thunderbird
On 5/20/2024 8:14 AM, Marcel Mueller wrote:
Am 18.05.24 um 23:40 schrieb olcott:
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.
There is no recursion.
H is an undefined reference. There is nothing to simulate.
And even if H would be defined, the implementation of H might never call *x or *y.
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.
So this is proven not to be true in general.
Marcel
https://en.wikipedia.org/wiki/Pure_function#*Try to find any way that*
For every H/D pair of the template below where D correctly simulated
by pure function (thus computable function) H can possibly reach its
own final state at line 06 and halt.
typedef int (*ptr)(); // ptr is pointer to int function
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 }
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.
For every H/D pair of the above template D correctly simulated by pure
function (thus computable function) H cannot possibly reach its own
final state at line 06 and halt.
-- Copyright 2024 Olcott "Talent hits a target no one else can hit; Geniushits a target no one else can see." Arthur Schopenhauer