member(X,[X|_]).
member(X,[_|L]) :-
    member(X,L).

union([], Union, Union).
union([Head|Tail], Set2, Union):-
    member(Head, Set2),
    !,
    union(Tail, Set2, Union).
union([Head|Tail], Set2, [Head|Union]):-
   /* \+(member(Head, Set2))*/
    union(Tail, Set2, Union).
