http://www.perlmonks.org?node_id=428614


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

sub f1 { "different"; } sub f2 { same(\&f1, \&f2) ? "same" : "different"; } f2();
would be a contradiction.