delete_all has multiple matching rules
delete_all([E|Tail], E, Res) :- delete_all(Tail, E, Res).
delete_all([Head|Tail], E, [Head|Res]) :- delete_all(Tail, E, Res).
delete_all([2,3],2,R).
Can be proven using either of the above!
R=[3], or R=[2,3]
Previous slide
Next slide
Back to first slide
View graphic version