Put semantic constraints in class definition