Add constraints to pattern variables