Reputation: 2236
diverso([X|L1],L2) :- nonp(X,L2), diverso(L1,L2).
nonp(X,[]).
nonp(X,[A|B]) :- X\=A, nonp(X,B).
this is my code, it doesn't work and I don't know why. Error is
Diverso/2 unknown predicate
My query is:
?-diverso([3,4],[1,2]).
Upvotes: 1
Views: 64
Reputation: 4352
Adding the recursive base case for the diverso
predicate solves the problem!
Upvotes: 1