Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
% in_A_but_not_in_B(+LstA, +LstB, +Lst_in_Construction, -Lst_Final)
% when A is finished, we unify Lst_in_Construction and Lst_Final
in_A_but_not_in_B([], _, L, L).
% we check if the first element of A is in B
in_A_but_not_in_B([H|T], B, LC, LF) :-
member(H, B),
% yes, it's in, we don't memorize it
% and we carry on with the rest of liste A
in_A_but_not_in_B(T, B, LC, LF).
% we check if the first element of A is in B
in_A_but_not_in_B([H|T], B, LC, LF) :-
\+member(H, B),
% no, it's not in it, we memorize it
% and we carry on with the rest of liste A
in_A_but_not_in_B(T, B, [H| LC], LF).
test(R) :-
% when we start, List_in_Construction is empty
in_A_but_not_in_B([1,2,3, 5], [2,3,4], [], R).