Skip Menu |

This queue is for tickets about the Acme-HaltingProblem CPAN distribution.

Report information
The Basics
Id: 46398
Status: new
Priority: 0/
Queue: Acme-HaltingProblem

People
Owner: Nobody in particular
Requestors: KENTNL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.00
Fixed in: (no value)



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";