I have a predicate which checks for duplicates in a list and returns true if there are no duplicates and false if there are duplicates present:
removeDups([], []).
removeDups([H|T], [H|T1]) :- subtract(T, [H], T2), removeDups(T2, T1).
I want to write another predicate that will basically check if removeDups successfully removes duplicates from a list whilst leaving the other list items present still. So for example a predicate testRemoveDuplicates/1 where the input is a list. I'm not sure how to go about doing this though.
Thanks in advance.