/* Consider the following Prolog program: */member(X,[X|Xs]).member(X,[Y|Xs]) :-

/* Consider the following Prolog program: */member(X,[X|Xs]).member(X,[Y|Xs]) :- member(X,Xs).disjoint([],Ys).disjoint([X|Xs], Ys) :- not(member(X, Ys)), disjoint(Xs,Ys)./*Draw the derivation trees for the following queries:(a) ?- disjoint([1,2,3],[4,2]).(b) ?- disjoint([1,2,3],Xs).(c) ?- not(not(disjoint(Xs,[4,2]))).As a short reminder:+ Goalis the same asnot(Goal)*/
Requirements: the program as short as possible, explanation as long as needed to understand

Leave a comment

Your email address will not be published. Required fields are marked *