olcott
unread,Jul 30, 2021, 1:09:42 AM7/30/21You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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