Hi,
I need to write a prolog predicate for diff/3 without using the built-in predicate subtract/3. The diff/3 predicate for example gives as follows:
?-diff([1,3,3,4],[4,5,8],X)
X=[1,3]
The diff(List1,List2,X) predicate takes List 1 and List 2 and unifies a new list X with all elements in List1 that do not appear in List 2. List1 is assumed to contain no duplicate elements.