summaryrefslogtreecommitdiff
path: root/prolog/problems/sets/diff_3/common.py
blob: 82a6fe9b8d35144f856469cebdd3773b533beee9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# coding=utf-8

id = 130
group = 'sets'
number = 37
visible = True
facts = None

solution = '''\
memb130(X, [X|_]).
memb130(X, [_|T]) :-
  memb130(X, T).

diff([], _, []).
diff([H|T], S2, [H|D]) :-
  \+ memb130(H, S2),
  diff(T, S2, D).
diff([H|T], S2, D) :-
  memb130(H, S2),
  diff(T, S2, D).
'''