name = 'memberT/2' slug = 'find elements in a tree' description = '''\
memberT(X, T)
: X
is an element of the tree T
. A tree node is represented with the structure t(E, T1, T2...)
, where E
is the node's value, followed by any number of subtrees. An empty tree is denoted by nil
.
?- memberT(X, t(3, t(1), t(2))). X = 3 ; X = 1 ; X = 2.''' hint = {}