[mercury-users] mixing function rules and predicate rules

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Oct 1 01:16:31 AEST 2010


Hi,

On Thu, 30 Sep 2010, Mike Burrell wrote:

> This might be a silly question, but is there a way to use predicates
> within a function or vice versa? E.g., let's say p1 and p2 are
> predicates and f is a function. I'd like to do something like:
>
> f(X) = A ++ B where p1(X, Z, A), p2(Z, B).

	f(X) = A ++ B :-
		p1(X, Z, A),
		p2(Z, B).

is probably what you are after.

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