Foundations of Collision Repair