Prolog

Miscellaneous Forums/General Discussion/Prolog

Can anyone on the forums program in Prolog? If so, reply back ASAP.

(For those that don't know, it's a logic-based language with no while or for loops, no if statements, only recursion. Lots and lots of recursion for the most trival of tasks. I spent all day trying to delete all instances from a list (array) A, from a list B and storing the result in list C and I still can't do it)

Well, there is the well known merge (or append) predicate but I am not sure about deleting the contents of the lists at the same time. In calling merge(A,B,C) you ask the interpreter whether list C is the result of appending list B to list A. (So C should contain all elements from A followed by all elements from B and no other elements.)
merge([],L,L).  
merge([H|T],L,[H|M]) :- merge(T,L,M).

Example:
?- merge([a,b,c],[d,e,f],X).
X = [a, b, c, d, e, f].