Constraint-Based Error Localization