Formal methods for automated debugging