do you need the special cases for isConstant and isSubsort? It seems like it should just be specific instances of what's below...