On Proving the Termination of Algorithms by Machine

Proving the termination of a recursively defined algorithm requires a certain creativity of the (human or automated) reasoner for inventing a hypothesis whose truth implies that the algorithm terminates. We present a reasoning method for simulating this kind of creativity by machine. The proposed method works automatically, i.e. without any human support. We show, (1) how a termination hypothesis for an algorithm is synthesized by machine, (2) which knowledge about algorithms is required for an automated synthesis, and (3) how this knowledge is computed. Our method solves the problem for a relevant class of algorithms, including classical sorting algorithms and algorithms for standard arithmetical operations, which are given in a pure functional notation. The soundness of the method is proved and several examples are presented for illustrating the performance of the proposal. The method has been implemented and proved successful in practice.

[1]  Rod M. Burstall,et al.  Program Proving as Hand Simulation with a Little Induction , 1974, IFIP Congress.

[2]  Robert S. Boyer,et al.  Computational Logic , 1990, ESPRIT Basic Research Series.

[3]  Marianne Baudinet,et al.  Proving termination properties of Prolog programs: a semantic approach , 1988, [1988] Proceedings. Third Annual Information Symposium on Logic in Computer Science.

[4]  C. A. R. Hoare,et al.  Algorithm 64: Quicksort , 1961, Commun. ACM.

[5]  Robert W. Floyd,et al.  Assigning meaning to programs , 1967 .

[6]  Martin Protzen,et al.  Disproving Conjectures , 1992, CADE.

[7]  Guy L. Steele,et al.  Common Lisp the Language , 1984 .

[8]  Zohar Manna,et al.  Proving termination with multiset orderings , 1979, CACM.

[9]  J. Strother Moore,et al.  A Mechanical Proof of the Termination of Takeuchi's Function , 1979, Inf. Process. Lett..

[10]  Zohar Manna,et al.  Is “sometime” sometimes better than “always”?: Intermittent assertions in proving program correctness , 1976, ICSE '76.

[11]  Christoph Walther,et al.  Mathematical induction , 1994, Handbook of Logic in Artificial Intelligence and Logic Programming.

[12]  Jeffrey D. Ullman,et al.  Efficient tests for top-down termination of logical rules , 1988, JACM.

[13]  Lutz Plümer Termination Proofs for Logic Programs , 1990, Lecture Notes in Computer Science.

[14]  Jürgen Giesl Automated Termination Proofs with Measure Functions , 1995, KI.

[15]  Z. Manna Termination of algorithms , 1968 .

[16]  C. A. R. Hoare,et al.  Algorithm 65: find , 1961, Commun. ACM.

[17]  MannaZohar,et al.  Is sometime sometimes better than always , 1978 .