[m-dev.] subtypes discussion

Fergus Henderson fjh at cs.mu.OZ.AU
Sat Dec 28 16:59:36 AEDT 2002


On 27-Dec-2002, Mark Brown <dougl at cs.mu.OZ.AU> wrote:
> I think the subtypes of fbb (with the default func inst) should include
> at least the following:
> 
> 	func(bool) = bool
> 	func(bool) = y
> 	func(bool) = n			% n is analogous to y
> 	func(y) = bool
> 	func(y) = y
> 	func(y) = n
> 	func(n) = bool
> 	func(n) = y
> 	func(n) = n
> 
> But if you disallow fyy, it seems to me you would have to disallow all but
> the first three of these.  So, what subtypes of fbb (with the default func
> inst) do you think should be legal?

Of the ones above, just the first three.

> Well, the default mode for g is
> 
> 	:- mode g(in(func(in) = out is det)) = out is det.
> 
> so the mode after propagation should be equivalent to
> 
> 	:- mode g(in(func(in(y)) = out(y) is det)) = out is det.
> 
> but I think that is what you mean.

Yes, that is what I meant.

> At this stage of the discussion, there seem to be three partial orders
> of interest: the "matches" partial order (from David Overton's thesis
> draft), the "propagation" partial order (determined from the rules for
> propagation), and the "subtype" partial order (which reflects the rules
> we impose on subtype declarations).  There is no disagreement on either
> the matches partial order, which supports subsumption, or the propagation
> partial order, which supports specialization.  There are two views on the
> subtype partial order:
> 
> 	1) it should be the same as the matches partial order, or
> 
> 	2) it should be the same as the propagation partial order.

This is a good summary of the discussion.

I still favour position (1), because that's the one which matches my
mental model of types as sets of values and representations and
subtypes as subsets of values and representations.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list