Gets the child positions that appear in this tree.
Gets the child positions that appear in this tree.
the position of interest
the child positions that appear in this tree
Gets the value of the specified label for the node at the specified position.
Gets the value of the specified label for the node at the specified position.
the position of interest
the label of interest
the value of the specified label
The leaf positions of the tree, sorted in depth-first left-to-right order.
The leaf positions of the tree, sorted in depth-first left-to-right order.
a sequence of (position, node) pairs
a sequence of (position, node) pairs
A map from positions to nodes.
A map from positions to nodes.
The positions in the tree.
The positions in the tree.
Substitutes the subtree at the specified position with a new subtree.
Substitutes the subtree at the specified position with a new subtree.
the desired substitution point
the new subtree
a new PositionTree, in which the subtree at the specified position has been replaced
Swaps the subtrees at two different positions.
Swaps the subtrees at two different positions.
This requires that the specified positions are both valid, and are not descendants of one another.
the first position
the second position
a new PositionTree, in which the two specified subtrees have been swapped