atom- and tree-equal from ch18.