[mercury-users] [petdr at miscrit.be: Report on the ICFP 2000 prog contest]

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Sep 6 23:50:42 AEDT 2000


On 06-Sep-2000, Peter Ross <peter.ross at miscrit.be> wrote:
> On Wed, Sep 06, 2000 at 09:26:13AM +1100, Thomas Conway wrote:
> >     inside_sphere(Point, Trans) :-
> > 	Point = point_to_object_space(Trans, Point),
> > 	mag2(Point) =< 1.0.
> > 
> > Several people (fjh, dmo, conway, ...) all looked at the code and
> > failed to notice the "variable numbering" bug - 'Point' was being
> > used to represent the original point and the transformed point.
> > The bug failed to trigger a warning because the predicate was semidet.
> > Thanks to rejj who spotted the problem eventually!
>
> Which is why I think we should add a warning to the compiler that points
> out implicit unifications in semidet code, because I have been bitten by
> this `feature' before.

I agree.  Bart Demoen has argued this in the past -- that the compiler ought
to issue warnings for calls to implied modes (or at least have an option to do
so).  Up until now I have not really been convinced by his arguments, since
I had not found it to be much of a problem in practice.  But now I'm convinced.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list