Towards automatic debugging of programs

We present the germ of an idea for automatically correcting logical errors in programs by manipulating the invariants of the program. An invariant tree is defined, and we show how it can be used to change the program in order to guarantee correctness. Debugging could be incorporated into a verification system which would first try to prove the correctness of the program. If the attempt is unsuccessful, two alternative approaches are suggested and compared. In the first, we try directly to correct the invariants and - through these - the statements, taking the calculated risk of modifying an already correct program. In the second approach, we initially prove incorrectness, and only then try to correct the program, by invalidating this proof.