Tree validation uses udfs

I think you want this to be a set comprehension, not a list comprehension.
Pretty simple, just change the `[` and `]` to `{` and `}`