PPT Slide
mem2(2,[1,2,3])
mem2(2,[2,3])
A
/*A*/ mem2(X,[_|T]) :- mem2(X,T)./*B*/ mem2(X,[X|_]).
*
How Prolog Proceeds - 3
Matches A,
Unify [_|T]
with [2,3]
So T = [3],
and must prove
mem2(X,T).
Previous slide
Next slide
Back to first slide
View graphic version