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