note
ambrus
<blockquote>
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).
</blockquote>
<p>
Indeed.
If <code>same($code1, $code2)</code> could
find out whether the <code>$code1</code> and <code>$code2</code> functions behave identically,
then
<code>
sub f1 { "different"; }
sub f2 { same(\&f1, \&f2) ? "same" : "different"; }
f2();
</code>
would be a contradiction.
428610
428611