/// down from the root each time. Subtree replacement preserves the replaced node's id and appends
/// the replacement descendants; descendants of the old subtree become unreachable from the root.
pub fn add_root_children(&mut self, children: Vec<Expression>) -> Vec<ExpressionNodeId> {
/// the parent in O(1). Falls back to a full rebuild if the child is missing or in-place replace
fn increment_direct_child_discriminant(&mut self, id: ExpressionNodeId, discriminant: usize) {