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

id = 142
name = 'memberT/2'
slug = 'find elements in a tree'

description = '''\
<p><code>memberT(X, T)</code>: <code>X</code> is an element of the tree <code>T</code>. A tree node is represented with the structure <code>t(E, T1, T2...)</code>, where <code>E</code> is the node's value, followed by any number of subtrees. An empty tree is denoted by <code>nil</code>.</p>
<pre>
  ?- memberT(X, t(3, t(1), t(2))).
    X = 3 ;
    X = 1 ;
    X = 2.
</pre>'''

hint = {}