[m-dev.] polymorphic modes

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Feb 9 14:03:21 AEDT 2000


On 09-Feb-2000, David Overton <dmo at ender.cs.mu.oz.au> wrote:
> What I have currently done is assume that all inst parameters in
> predicate and function mode declarations are implicitly constrained to
> be ground(shared).  E.g.
> 
> 	:- mode p(in(I), out(I)).
> 
> works for all insts, I, that are ground(shared), such as:
> 
> 	:- mode p(in(ground), out(ground)).
> 	:- mode p(in(pred(in, in) is semidet), out(pred(in, in) is semidet)).
> 	:- mode p(in(bound(foo)), out(bound(foo))).
> 
> However, unique insts are not allowed to match inst parameters, so
> 	
> 	:- mode p(in(unique), out(unique)).
> 
> is not an instance of the polymorphic mode.

What happens if you call p/1 with a arguments whose
initial insts are `(unique, free)'?  Does that end
up calling the `p(in(ground), out(ground))' mode,
or is it a mode error?

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