[mercury-users] partial instantiation?

Tomas By tomas at basun.net
Wed Apr 14 13:03:02 AEST 2010


On Wed, April 14, 2010 04:48, Paul Bone wrote:
> You might find that the modes.
>
> :- mode cmd(in, in, out) is semidet.
> :- mode cmd(out, out, in) is det.
>
> do work, because N and P are bound as one of cmd's inputs.

Well, I only want out/out/out as the cmd/3 predicate is just a list of
all my command line commands, all nicely collected in one place.

> Alternatively, if you did want partial instantiation, and I don't think
> you do,
> you would have to use a different mode rather than out, out, out that
> describes
> the partial instantiation.

Ok... This is the bit I could use some help with then, if it is possible.

I tried this:

|:- type cmdarg ---> str(string) ; int(int).
|:- inst cmdarg ---> str(free) ; int(free).
|:- mode calist == free >> cmdarg.

but just got a bunch of new errors.

I suspect I would also need complicated mode declarations for the third
parameter (cmdproc), as that also has free variables?

/Tomas


--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list