[m-dev.] diff: fix bug with simplify.m & existential types

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Aug 5 17:40:43 AEST 1998


On 05-Aug-1998, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> On 05-Aug-1998, David Glen JEFFERY <dgj at cs.mu.OZ.AU> wrote:
> > On 04-Aug-1998, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > > compiler/simplify.m:
> > > 	Fix a bug: it was incorrectly optimizing away calls to
> > > 	existentially typed predicates if the call had no output
> > > 	variables.
> > 
> > Could you supply a test case, please? I'm struggling to imagine what such a
> > test case would look like.
> 
> At a guess, I would say:
> 
> 	% The predicate has_type/2 is basically an existentially typed
> 	% inverse to the function type_of/1.  It constrains the type
> 	% of the first argument to be the type represented by the
> 	% second argument.
> 	%
> 	% Warning: support for existential types is still experimental.
> 	%
> :- some [T] pred has_type(T::unused, type_info::in) is det.

Yes, the test case will be code in the standard library that calls has_type/2.
Unfortunately for bootstrapping reasons I can't commit that code now.

I had a brief go at writing a test case, but I couldn't easily duplicate
the bug in a smaller section of code, so I thought it best just to use
the standard library code for the test case.

-- 
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.



More information about the developers mailing list