[mercury-users] Superclasses and "solutions"
Kerry Raymond
kerry at dstc.edu.au
Wed Feb 27 09:49:22 AEDT 2002
> > foo(_) :- solutions((pred(X::out) is nondet:- f_x(X)),_List).
> If you add an explicit type qualifier, e.g. change "X" to "X `with_type` a",
> then the error will go away; the call to solutions will then
> find all the solutions to f_x(X) where X has type `a'.
If I wanted to find all the solutions where X has type 'a', then I could have
just called the predicate f_a to begin with.
What I am wanting to do is to get all the solutions for both types 'a' and 'b'
(i.e. all instance classes of the type class super). How do I do that?
> Note that `solutions' only finds solutions to a predicate;
> it can't be used to find all the types which are instances
> of a particular type class.
No problem, I am only wanting to find solutions to predicates.
Kerry
--------------------------------------------------------------------------
mercury-users mailing list
post: mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the users
mailing list