/* ************************************************ */
/* */
/* delete_all_eq/3 */
/* Arg 1: */
/* Arg 2: List */
/* Arg 3: List */
/* Summary: true if Arg 3 is Arg 2 with all */
/* instances of Arg 1 deleted. */
/* Author: P J Hancox */
/* Date: 28 October 1994 */
/* */
/* ************************************************ */
% 1 terminating condition
delete_all_eq(_, [], []).
% 2 recursive - Elem matches head
delete_all_eq(Elem, [Head|Tail1], Tail2) :-
Elem == Head,
delete_all_eq(Elem, Tail1, Tail2).
% 3 recursive - Elem doesn't match head
delete_all_eq(Elem, [Head|Tail1], [Head|Tail2]) :-
Elem \== Head,
delete_all_eq(Elem, Tail1, Tail2).
|