Fringe subtrees and replacement #
Lookup uses zero-based addresses. Replacing the subtree at a valid address identifies the old and new roots; replacement at a leaf is leaf grafting. Replacement at an invalid address leaves the tree unchanged.
@[simp]
Children form an initial segment, with no gaps.
Replace the fringe subtree at an address, preserving the ordered context. At a leaf this is the grafting operation used in cut-and-graft arguments.
Equations
Instances For
Remove strict descendants of an address, retaining that vertex as a leaf.
Equations
- t.cut u = t.graft u BGW.PlaneTree.leaf