Implement rooted-tree? predicate