このディレクトリの索引

#  Compute the non-intersection of the two lists and return the third containing no duplicates. Thus the non-intersection of the list [a,b,p,l,a,f] and [q,a,z,x,l] should return the list [b,p,f,q,z,x,l].
#  
#  I currently have this code:
#  
#  join([],List,List).
#  
#  join([H|T],List,[H|Result]):-   
#           not(member(H,List)),
#      join(T,List,Result).
#  
#  join([H|T],Y,Z):-
#      join(T,Y,Z).
#  It can find all the elements that do not repeat, but it places them
#   all as the head on the second list. How can I make it so the second list
#   is also checked for elements that are repeated and only output those
#   which are not?

join(L1,L2,L) :-
        append(L1,L2,L3),
        findall(A,unique(L3,A),L).

unique(L3,A) :-
        append(L0,[A|R],L3),
        \+(append(_,[A|_],L0)).