prolog check if list contains same elements code example
Example: prolog check if element in different lists are same
common_list([X],[X]).
common_list([X|Tail],Y):- member(X,Y).
common_list([X|Tail],Y):- common_list(Tail,Y).
common_list([X],[X]).
common_list([X|Tail],Y):- member(X,Y).
common_list([X|Tail],Y):- common_list(Tail,Y).