Liste des Groupes | Revenir à theory |
typedef void (*ptr)(); // pointer to void function
01 void HHH(ptr P, ptr I)
02 {
03 P(I);
04 return;
05 }
06 07 void DDD(int (*x)())
08 {
09 HHH(x, x);
10 return;
11 }
12 13 int main()
14 {
15 HHH(DDD,DDD);
16 }
17
In the above Neither DDD nor HHH ever reach their own return statementIf HH aborts the simulation of DD(DD), the call to itself also does, and
thus never halt.
Most of my reviewers incorrectly believe that when HH(DD,DD) aborts its
simulated input that this simulated input halts.
When HHH is a simulating halt decider just like HH then DDD correctlyHHH must be the same as HH. There is no distinction by simulation level.
simulated by HHH cannot possibly terminate normally
and aborts it.When HHH is a simulating halt decider then HHH sees that DDD
cannot possibly reach its return statement, AKA
simulating halt decider HHH simulates its input DDD
until HHH determines that DDD would never
stop running unless aborted
Les messages affichés proviennent d'usenet.