Update TheoremSet

Revised the validTheorem method to use expressions as if they were a tree