[comp.lang.misc] I_halt

utility@quiche.cs.mcgill.ca (Ronald BODKIN) (11/22/90)

In article <8839:Nov2100:33:3990@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:
>> main(argc,argv) {
>> 	int I_halt();
>> 	if (I_halt(argv[0])) {
>> 		while(1);
>> 	} else {
>> 		exit(0);
>> 	}
>> }

>We are all aware that it is impossible for a fixed algorithm *within*
>machine M to solve the halting problem for machine M (provided that M is
>not utterly trivial). But the solution takes advantage of a new machine
>*outside* M...
	This is true, and was similar to my "serious answer" to the
question.  For a humourous(?) one:
int I_halt()
{
	int my_pid();
	FILE *fp;
	fp=fopen("/script", "w");
	fprintf(fp, "sleep 50\nkill -9 %d\n", my_pid());
	system("sh /script &");
	return 1;
}
/* flames about details to /dev/null */