==/2
. , , . ==/2
:
2 ?- X == X
| .
true.
3 ?- X == Y.
false.
4 ?- X = Y, Z = Y, X == Z, write('yes'), nl.
yes
X = Y, Y = Z.
5 ?- X = Y, Z = W, X == Z.
false.
6 ?-
nu_member/2
:
nu_member(X, [Y|_]) :- X == Y.
nu_member(X, [_|T]) :- nu_member(X, T).
f_in_list/2
:
f_in_list(L, 1) :-
member(X, L),
nu_member(f(X), L),
!.
f_in_list(_, 0).
:
2 ?- f_in_list([X,f(X), Z], B).
B = 1.
3 ?- f_in_list([X,f(Y), Z], B).
B = 0.
4 ?- f_in_list([X,f(Y), f(Z)], B).
B = 0.
5 ?- f_in_list([X,f(Y), f(Z),Z], B).
B = 1.