%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Check whether an element X belongs to the difference
% between two sets, Set1 and Set2 (i.e., X in Set1\Set2)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
in_difference(X,Set1,Set2) :-
set(Set1) & set(Set2) &
X in Set1 &
X nin Set2.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Sample goals:
%
% {log}=> in_difference(X,{1,2},{1,3}).
%
% X = 2
%
% {log}=> in_difference(X,S1,{1,3}).
%
% S1 = {X/N}
% Constraint: set(N), X neq 1, X neq 3