I want to delete all predicates named a from the list. The result must be as shown below:
?- delete_all(a(_), [a(1),a(2),a(3),b(1)], R).
R = [b(1)]
Please, do not offer me built in solutions of SWI or others, because the code must be in Amzi-Prolog.
Thanks.
Edit: I have tried the following code but it is working properly only for atoms:
remove_all(X,[],[]).
remove_all(X,[X|L],R):-remove_all(X,L,R).
remove_all(X,[Y|L],R):-not(X=Y), remove_all(X,L,M), R=[Y|M].
?-remove_all(a(_), [a(1),a(2),a(3),b(1)], R).
R=[a(2),a(3),b(1)]
which is not true 🙁
use findall