I would like to remove from the list of lists all lists containing [['One', _], _]. I created the following sentence delete_all, which always works, except in my case:
delete_all(_,[],[]) :- !.
delete_all(X,[X|Tail],List) :-
!,
delete_all(X,Tail,List).
delete_all(X,[A|Tail],[A|List]) :-
delete_all(X,Tail,List).
Example: (this works well)
?- delete_all(3,[3,4,3,5,3],K).
K = [4, 5] .
but this works poorly:
delete_all([['One', _], _], [[['One', 'Six'], 94],
[['One', 'Ten'], 13], [['Two', 'Nine'], 35]], Y).
Y = [[['One', 'Ten'], 13], [['Two', 'Nine'], 35]].
Why does it delete only the first element? What could be wrong?