Subject: | Accuracy Improving Enhancement |
In cases where it returns true its not always accurate ( of course ).
Of course, we can't realistically divine a false value that is correct,
so we can do the inverse: guarantee the program halts :)
Of course, its preferable that we return the truth value stating it
halts before it actually halts, so the following structure or similar
could be implemented.
use strict;
use warnings;
sub halts {
use Time::HiRes qw( ualarm );
$SIG{ALRM} = sub { print "\nThis program halts\n"; exit 0; };
ualarm( int( rand(20_000) ) );
return 1;
}
eval { halts };
eval {
while (1) { # Infinite loops become finite!
print ".\n";
}
};
print "This cant happen";