Adding formulas to constraints