I know of the subtract predicate which removes which removes a list of items from a list
subtract([a,b,c,a,b], [a,c], X).
but is there anything like
remove([a,b,c,a,b], a, X).
I know I can modify the above in
subtract([a,b,c,a,b], [a], X).
To achieve the desired result.
But I want to know if there is another way?
EDIT:
@user27815
you did provide a very detailed answer but i'm still very much new to prolog. And perhaps I didn't ask the question correctly(My bad). If there is another way to achieve this.Is it Pre-defined or do I have to define it myself. And can I have an example?