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

id = 142
number = 49
visible = False
facts = None

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

memberT(X, Tree) :-
  Tree =.. [t, X|_].
memberT(X, Tree) :-
  Tree =.. [t, _|SubTrees],
  memb142(SubTree, SubTrees),
  memberT(X, SubTree).
'''