6 lines
172 B
Prolog
6 lines
172 B
Prolog
member1(X,[H|_]) :- X==H,!.
|
|
member1(X,[_|T]) :- member1(X,T).
|
|
|
|
distinct([],[]).
|
|
distinct([H|T],C) :- member1(H,T),!, distinct(T,C).
|
|
distinct([H|T],[H|C]) :- distinct(T,C).
|