| Next | You can't get there from here | 24 |
For concreteness, let's say we have the source code for a function:
$CODE = "sub {
my $arg = shift;
... do something with $arg ...
... return some result ...
... (or not) ...
}";
And we have some input value:
$INPUT = "carrots";
We want to know whether the function will ever return, when given argument $INPUT
So we want a function like this:
sub halts {
my ($source_code, $input) = @_;
... do something clever ...
... return true if the function finishes when given '$input'
... return false if not
}
| Next | ![]() |
Copyright © 2005 M. J. Dominus |