Page 1 of 1

Define diff(A,B,C) to hold exactly when C is the difference between lists A and B so that for example ? diff([a,b],[b],C

Posted: Sat Feb 19, 2022 3:23 pm
by answerhappygod
Define diff(A,B,C) to hold exactly when C is the difference
between lists A and
B so that for example
? diff([a,b],,C).
C = [a] ;
false.
?- diff(A,B,C).
A = B, C = [] ;
A = [_1|B], C = [_1] ;
A = [_1,_2|B], C = [_1,_2] ;
...