Third rule contained implicit assumption
delete_all([Head|Tail], E, [Head|Res]) :- delete_all(Tail, E, Res).
Want above rule to apply only when Head is not E
That is exactly the complement of rule 2
So we can make the algorithm only try rule 3 if rule 2 did not succeed