Unification in append rule
append([],Ys,Ys).
append([X|Xs],Ys,[X|Zs]) :-
append(Xs,Ys,Zs).
append([1,2,3],A,[1,2,3,4]). results in[X|Xs] = [1,2,3], A=Ys, [X|Zs] = [1,2,3,4]
and thus:X=1, Xs=[2,3], Zs=[2,3,4]
so must prove: append([2,3],A,[2,3,4])
Previous slide
Next slide
Back to first slide
View graphic version