Convenience functions and TH for working with constraints.