[mercury-users] Why is

Jeff Thompson jeff at thefirst.org
Mon Mar 5 06:40:56 AEDT 2012


Hello.  I would like to check my understanding here.  List member is 
defined as:

member(X, [X | _]).
member(X, [_ | Xs]) :- member(X, Xs).

It is counter-intuitive to me why mode member(in, in) is semidet.  If 
you call member(1, [1, 1]), why doesn't the code above match twice which 
would make this mode nondet?

Thanks for any help,
- Jeff

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