summaryrefslogtreecommitdiff
path: root/prolog/problems/trees/membert_2/common.py
blob: c91371e196725260cc5373c5615511e58e1957a0 (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 = True
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).
'''