First of all, congratulations to one of the most declarative and justified comments that I saw in the questions of newcomers!
, , . , Prolog , , (\+)/1
, . , - , , Prolog. , , -, Prolog.
, , (\+)/1
:
?- X = d, \+ member(X, [a,b,c]).
X = d.
, :
?- \+ member(X, [a,b,c]), X = d.
false.
, (\+)/1
: , :
?- \+ member(X, [a,b,c]).
false.
?- \+ member(d, [a,b,c]).
true.
, . , , , , , , , .
, , , dif/2
. dif/2
, . :
not_member(X, Ls) :- maplist(dif(X), Ls).
, :
?- not_member(X, [a,b,c]), X = d.
X = d.
?- X = d, not_member(X, [a,b,c]).
X = d.
not_member/2
, — — .
, , Prolog. . logical-purity prolog-dif .