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

id = 129
number = 36
visible = True
facts = None

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

intersect([], _, []).
intersect([H|T], S2, [H|I]) :-
  memb129(H, S2), !,
  intersect(T, S2, I).
intersect([_|T], S2, I):-
  intersect(T, S2, I).
'''