If a variable (SetVar or Complement) is not yet a set domain variable, it is declared as such, limited by the Universe.
This constraint is usually more efficient (stronger) than posting an equivalent set difference constraint, due to specific inferences.
?- complement([7,8], [1,7,8,9], N). N = [1,9] ?- complement(N, [1,7,8,9], [7,8]). N = [1,9] ?- X `:: [a]+[b,c,d], Y `:: []+[a,b,c,d,e,f], complement(X, [a,b,c,d,e,f,g], Y). no ?- X `:: [a]+[b,c,d], Y `:: []+[a,b,c,d,e,f], complement(X,[a,b,f],Y), domain(X,DX),domain(Y,DY). DX = [[a]:1,[b]:2], DY = [[f]:1,[b]:2] ?- X `:: [a]+[b,c,d], Y `:: []+[a,b,c,d,e,f], complement(X, [a,b,c,d,e,f], Y), domain(Y,DY). DY = [[e,f]:2,[b,c,d]:5]