http://qs321.pair.com?node_id=428891


in reply to Re^2: Equivalency of Code
in thread Equivalency of Code

That's a pretty big "in the general case".

One can EASILY prove that the two following pieces of code are equivalent.
my $foo = 1; my $foo = 1;
So while you may not be able to work out if _any_ two pieces of code are equivalent, you can work out if _some_ two pieces of code are equivalent.

As for the above example, it isn't really fair for the comparison function to have to compare itself.

Generally most observes are given at least the countesy of being outside the situation being examined...

So to summarise, there are ways to prove _some_ sorts of code are equivalent, just not _any_ code. And if you bias that process towards false negatives you stay pretty safe. (Accept false readings of "not equal" in exchange for certain results of "is equal")