add identical_member/2
This commit is contained in:
parent
f8836ec1b2
commit
ad603a53ed
12
pl/lists.yap
12
pl/lists.yap
@ -38,6 +38,18 @@ lists:member(X,[X|_]).
|
||||
lists:member(X,[_|L]) :-
|
||||
lists:member(X,L).
|
||||
|
||||
%% @pred identical_member(?Element, ?Set) is nondet
|
||||
%
|
||||
% identical_member holds true when Set is a list, and Element is
|
||||
% exactly identical to one of the elements that occurs in it.
|
||||
|
||||
lists:identical_member(X,[Y|M]) :-
|
||||
(
|
||||
X == Y
|
||||
;
|
||||
M \= [], lists:identical_member(X,M)
|
||||
).
|
||||
|
||||
/** @pred append(? _List1_,? _List2_,? _List3_)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user