A mutable pool of CSS rules in cascade order, supporting near-constant merging and O(1) precedence queries.
This is the working representation for the incremental rule merger (after Hague, Lin & Hong, "CSS Minification via Constraint Solving", TOPLAS 2019):
order is kept by Order_maintenance, so "does rule A come before rule B?" stays O(1) as rules are inserted and removed;
merge classes are kept by a small in-tree union-find (path-compressed, union-by-rank, in pool.ml), so combining two rules is near-constant and a handle to an original rule still resolves to its current merged representative.
Loop drives the greedy, priority-ordered merging over this pool; its interface documents that design and the simpler batch-fixpoint alternative.
A node is a stable handle to one live rule. Combining or removing a node invalidates it; the surviving node keeps the merged rule.
combine t a b f merges b into a: the union-find classes are unioned, the surviving rule is f (rule a) (rule b) kept at a's position, and b is removed from the order. Returns the surviving node (a's identity). a must precede b.