simpler alternative: invariants as in-class methods.