[m-dev.] polymorphic modes
David Overton
dmo at hydra.cs.mu.oz.au
Wed Feb 9 14:08:32 AEDT 2000
On Wed, 09 Feb, 2000 at 02:03:21PM EST, Fergus Henderson wrote:
> 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?
>
The former.
--
David Overton Department of Computer Science & Software Engineering
PhD Student The University of Melbourne, Australia
+61 3 9344 9159 http://www.cs.mu.oz.au/~dmo
--------------------------------------------------------------------------
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