[mercury-users] [petdr at miscrit.be: Report on the ICFP 2000 prog contest]
Peter Ross
peter.ross at miscrit.be
Wed Sep 6 18:49:54 AEDT 2000
On Wed, Sep 06, 2000 at 09:26:13AM +1100, Thomas Conway wrote:
> On Tue, Sep 05, 2000 at 08:48:19PM EST, Peter Ross wrote:
> > The distrubuted nature of the entry and the lack of problems encountered
> > due to the distrubution of team members is a feather in the cap of the
> > Mercury language. The strong type and mode system ensured that if an
> > interface between distinct parts of the ray tracer changed, the spots
> > which were impacted by the change were reported by the Mercury compiler,
> > and could quickly be corrected. It also meant that different team
> > members could work on different solutions to the same problem, as long
> > as both solutions agreed on a common interface, and the best one could
> > be chosen.
>
> It is instructive to note that one of the bugs that took the longest to
> find was in the following code:
>
> 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.
Pete
--------------------------------------------------------------------------
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