Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re^3: Equivalency of Code

by adamk (Chaplain)
on Feb 08, 2005 at 03:05 UTC ( #428891=note: print w/replies, xml ) Need Help??

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")

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://428891]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2022-05-26 15:40 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (93 votes). Check out past polls.