102. PermTree is a binary permutation tree over a fresh node domain (2026-11-21)
- Decision. Add
PermTree.of(p: [I]V)andPermKindtostd.tree: the binary interval-decomposition tree in O(n), nodes in a fresh domain of 2n - 1 members, kindsLeaf,Incr,Decr,Partial,Full(aPartialleft child closed by its right one), withleft/right(trap on a leaf),span(positions) andvals(value interval, exact unlessPartial). The tree stays binary rather than ecnerwala's n-aryFULLnodes: a chain ofDecrnodes is the n-ary decreasing node read in order, and both corpus folds walk exactly that chain.cf2187f1/f2drop their two copies of the construction (634 -> 200 and 750 -> 314 tokens). - Reverse. Remove
PermTree/PermKindfromstdlib/tree.cpand restore the hand-built trees in the two ports from history.