Design decisions

63. One name per tree traversal: t.Pre (2026-11-21)

Dreams spelled preorder five ways (t.Pre, t.preorder, t.postorder, tree.post_order, t.preorder.rev). The canonical form is the preorder index space t.Pre: for v in t.Pre visits parents first, for v in t.Pre.rev visits children first, and t.sub(v) is a range of t.Pre. preorder and postorder go away, with a cpl fix codemod. A true postorder (siblings in order) is rarely needed in contest code; it stays t.Pre.rev until a port shows it matters. Reverse by restoring postorder as an alias.

Amended: t.Pre yields positions, so vertex loops iterate the stored preorder array instead: for v in t.at (parents first), for v in t.at.rev (children first) and for (p, v) in t.at.items when the position matters too; for p in t.Pre stays the position loop. Each is one line built from general mechanisms (an array is iterable, .rev is the decision 61 view, .items is decision 60's enumerate), so there is no new rule and no core work, and the loop reads at in place where preorder built a list. Lint L0511 (cpl fix) rewrites .preorder to .at and .postorder / .post_order to .at.rev. Reverse by making t.Pre yield vertices (a core iteration rule) or by restoring the two getters.