Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Pathological self-reference(Olcott 2004) decider

0 views
Skip to first unread message

olcott

unread,
Jul 30, 2021, 1:09:42 AM7/30/21
to
int Factorial(int n)
{
Output("Factorial(n)",n);
if (n > 1)
return n * Factorial(n - 1);
else
return 1;
}

void Infinite_Recursion(u32 N)
{
Infinite_Recursion(N);
}

void Infinite_Loop()
{
HERE: goto HERE;
}

int Simulate(u32 P, u32 I)
{
((int(*)(int))P)(I);
return 1;
}

u32 PSR_Decider(u32 P, u32 I)
{
u32 Input_Halts1 = H((u32)P, (u32)I);
u32 Input_Halts2 = H2((u32)Simulate, (u32)P, (u32)I);
Output("Input_Halts1 = ", Input_Halts1);
Output("Input_Halts2 = ", Input_Halts2);
if (Input_Halts1 != Input_Halts2)
return 1;
return 0;
}

void P(u32 x)
{
if (H(x, x))
HERE: goto HERE;
}

int main()
{
Output("PSR_Decider = ", PSR_Decider((u32)P, (u32)P));
Output("PSR_Decider = ", PSR_Decider((u32)Factorial, 3));
Output("PSR_Decider = ", PSR_Decider((u32)Infinite_Recursion, 3));
Output("PSR_Decider = ", PSR_Decider((u32)Infinite_Loop,
(u32)Infinite_Loop));
}




--
Copyright 2021 Pete Olcott

"Great spirits have always encountered violent opposition from mediocre
minds." Einstein
0 new messages