On 07-Jun-1999, S.D.Mechveliani <[EMAIL PROTECTED]> wrote:
> One more question on the program simplification and `bottom'.
> 
> People say, that the transformations like   x - x -> 0  :: Integer  
> are hardly ever applicable, because  x  may occur `undefined'.

This issue was already resolved -- someone already mentioned the solution.
But obviously you missed it, so let me restate the answer: instead of
using the transformation

        x - x   ==>     0
        
you should use the transformation 

        x - x   ==>     x `seq` 0

> Probably, the compiler can prove "defined" very often.

Indeed.  It can then simplify things further, using the rule

        x `seq` e       ==>     e               if x is not _|_

-- 
Fergus Henderson <[EMAIL PROTECTED]>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED]        |     -- the last words of T. S. Garp.


Reply via email to