in reply to Re: Equivalency of Code
in thread Equivalency of Code
In the general case though, proving the functional identity of two pieces of code is equivalent to solving the halting problem, and thus infeasible (I think).
Indeed. If same($code1, $code2) could find out whether the $code1 and $code2 functions behave identically, then
would be a contradiction.sub f1 { "different"; } sub f2 { same(\&f1, \&f2) ? "same" : "different"; } f2();
In Section
Seekers of Perl Wisdom