collectedAttribute
fun <Node : TreeNode<Node>, T> collectedAttribute(tree: Tree<Node, Node>, f: (Node) -> Iterable<Pair<Node, T>>): Attribute<Node, Set<T>>
Defines an Attribute where the value of each Node is determined by the contributions from the other nodes. For every node, f specifies the contribution of that node to the other nodes. All nodes in tree are traversed to collect the attributes for each node.
The tree is traversed lazily—only when the value of any node is demanded. Note that it is safe for f to use other attributes, but f should not depend on the attribute being defined.