check purity of subtree