Adding Debugging Logic to Formulas