Abstract
A size-change termination algorithm takes as input abstract information about a program in the form of size-change graphs and uses it to determine whether any infinite computation would imply that some data decrease in size infinitely. Since such an infinite descent is presumed impossible, this proves program termination. The property of the graphs that implies program termination is called SCT. There are many examples of practical programs whose termination can be verified by creating size-change graphs and testing them for SCT.The size-change graph abstraction is useful because the graphs often carry sufficient information to deduce termination, and at the same time are simple enough to be analyzed automatically. However, there is a tradeoff between the completeness and efficiency of this analysis, and complete algorithms in the literature can easily be pushed to an exponential combinatorial search by certain patterns in the graph structures.We therefore propose a novel algorithm to detect common forms of parameter-descent behavior efficiently. Specifically, we target lexicographic descent, multiset descent, and min- and max-descent. Our algorithm makes it possible to verify practical instances of SCT while guarding against unwarranted combinatorial search. It has worst-case time complexity cubic in the input size, and its effectiveness is demonstrated empirically using a test suite of over 90 programs.
- Anderson, H. and Khoo, S. C. 2003. Affine-Based size-change termination. In Proceedings of the 1st Asian Symposium on Programming Languages and Systems (APLAS), A. Ohori, Ed. Lecture Notes in Computer Science, vol. 2895. Springer Verlag, 122--140.Google Scholar
- Anderson, H. and Khoo, S. C. 2005. Bounded size-change termination. Tech. Rep. TRB6/05, National University of Singapore, Singapore.Google Scholar
- Apt, K. R. and Pedreschi, D. 1994. Modular termination proofs for logic and pure Prolog programs. In Advances in Logic Programming Theory. Oxford University Press, 183--229. Google Scholar
Digital Library
- Arts, T. 2001. Automatically proving termination and innermost normalisation of term rewriting systems. Ph.D. thesis, Universiteit Utrecht, The Netherlands. Google Scholar
Digital Library
- Avery, J. 2005. The size-change termination principle on non well founded data types. Tech. Rep., Datalogisk Institut Københavns Universitet, Denmark.Google Scholar
- Ben-Amram, A. 2002. General size-change termination and lexicographic descent. In The Essence of Computation: Complexity, Analysis, Transformation. Essays Dedicated to Neil D. Jones, T. Mogensen et al. Eds. Lecture Notes in Computer Science, vol. 2566. Springer Verlag, 3--17. Google Scholar
Digital Library
- Bueno, F., García de la Banda, M., and Hermenegildo, M. 1994. Effectiveness of global analysis in strict independence-based automatic program parallelization. In Proceedings of the International Logic Programming Symposium (ILPS). MIT Press, Cambridge, MA. 320--336. Google Scholar
Digital Library
- Codish, M., Lagoon, V., and Stuckey, P. 2005. Testing for termination with monotonicity constraints. In Proceedings of the 21st International Conference on Logic Programming (ICLP). To appear. Google Scholar
Digital Library
- Codish, M., Mariott, K., and Taboch, C. 2000. Improving program analyses by structure untupling. J. Logic Program. 43, 3, 251--263.Google Scholar
Cross Ref
- Codish, M. and Taboch, C. 1997. A semantic basis for termination analysis of logic programs and its realization using symbolic norm constraints. In Proceedings of the 6th International Conference on Algebraic and Logic Programming (ALP), M. Hanus et al., Eds. Lecture Notes in Computer Science, vol. 1298. Springer Verlag, 31--45. Google Scholar
Digital Library
- Cormen, T. H., Leiserson, C. E., and Rivest, R. L. 2001. Introduction to Algorithms. MIT Press Cambridge, MA. Google Scholar
Digital Library
- Dershowitz, N. and Manna, Z. 1979. Proving termination with multiset orderings. Commun. ACM 22, 8 (Aug.), 465--476. Google Scholar
Digital Library
- De Schreye, D. and Decorte, S. 1994. Termination of logic programs: The never-ending story. J. Logic Program. 19--20, 199--260.Google Scholar
- Floyd, R. W. 1967. Assigning meanings to programs. Proceedings of Symposia in Applied Mathematics XIX, 19--32.Google Scholar
Cross Ref
- Frederiksen, C. C. 2001. A simple implementation of the size-change principle. Tech. Rep. D-442, Datalogisk Institut Københavns Universitet, Denmark.Google Scholar
- Genaim, S. and Codish, M. 2002. Combining norms to prove termination. In Proceedings of the International Workshop on Verification, Model Checking and Abstract Interpretation (VMCAI). Springer Verlag. Google Scholar
Digital Library
- Giesl, J., Thiemann, R., Schneider-Kamp, P., and Falke, S. 2004. Automated termination proofs with AProVE. In Proceedings of the 15th International Conference on Rewriting Techniques and Applications (RTA). Lecture Notes in Computer Science, vol. 3091. Springer Verlag, 210--220. Google Scholar
Digital Library
- Glenstrup, A. and Jones, N. 2004. Termination analysis and specialization-point insertion in off-line partial evaluation. Tech. Rep. D-498, Datalogisk Institut Københavns Universitet, Denmark.Google Scholar
- Jones, N. D. and Bohr, N. 2004. Termination analysis of the untyped lambda calculus. In Proceedings of the 15th International Conference on Rewriting Techniques and Applications (RTA). Lecture Notes in Computer Science, vol. 3091. Springer Verlag, 1--23.Google Scholar
- Lee, C. S. 1999. Partial evaluation of the Euclidean algorithm, revisited. Higher-Order Symb. Comput. 12, 2 (Sept.), 203--212. Google Scholar
Digital Library
- Lee, C. S. 2001. Program termination analysis and termination of offline partial evaluation. Ph.D. thesis, UWA, Australia. Google Scholar
Digital Library
- Lee, C. S., Jones, N. D., and Ben-Amram, A. 2001. The size-change principle for program termination. In Proceedings of the 28th ACM Symposium on Principles of Programming Languages (POPL). Google Scholar
Digital Library
- Lee, C. S. 2002. Program termination analysis in polynomial time. In Proceedings of the 1st International Conference on Generative Programming and Component Engineering (GPCE). Lecture Notes in Computer Science, vol. 2487. Sringer Verlag, 218--235. Google Scholar
Digital Library
- Lindenstrauss, N. and Sagiv, Y. 1997a. Automatic termination analysis of logic programs (with detailed experimental results). http://www.cs.huji.ac.il/~naomil/.Google Scholar
- Lindenstrauss, N. and Sagiv, Y. 1997b. Automatic termination analysis of Prolog programs. In Proceedings of the 14th International Conference on Logic Programming (ICLP), L. Naish, Ed. MIT Press, Cambridge, MA. 64--77.Google Scholar
- Paige, R. and Yang, Z. 1997. High level reading and structure compilation. In Proceedings of the 24th ACM Symposium on Principles of Programming Languages (POPL). 456--469. Google Scholar
Digital Library
- Péter, R. 1967. Recursive Functions. Academic Press.Google Scholar
- Plümer, L. 1990. Termination Proofs for Logic Programs. Lecture Notes in Artificial Intelligence, vol. 446. Springer Verlag. Google Scholar
Digital Library
- Podelski, A. and Rybalchenko, A. 2005. Transition predicate abstraction and fair termination. In Proceedings of the 32nd ACM Symposium on Principles of Programming Languages (POPL). Google Scholar
Digital Library
- Sagiv, Y. 1991. A termination test for logic programs. In Proceedings of the International Logic Programming Symposium (ILPS), V. Saraswat and K. Ueda, Eds. MIT Press, Cambridge, MA. 518--532.Google Scholar
- Thiemann, R. and Giesl, J. 2003. Size-Change termination for term rewriting. In Proceedings of the 14th International Conference on Rewriting Techniques and Applications (RTA). Lecture Notes in Computer Science, vol. 2706. Springer Verlag, 264--278. Google Scholar
Digital Library
- Thiemann, R. and Giesl, J. 2005. The size-change principle and dependency pairs for termination of term rewriting. In Applicable Algebra in Engineering, Communication and Computing. To appear. doi 10.1007/s00200-005-0179-7. Google Scholar
Cross Ref
- Turing, A. M. 1948. Checking a large routine. In Report of a Conference on High Speed Automatic Calculating Machines. 67--69. Reprinted in The Early British Computer Conferences, vol. 14 of Charles Babbage Institute Reprint Series For The History Of Computing, MIT Press, Cambridge, MA. 1989. Google Scholar
Digital Library
- Wahlstedt, D. 2000. Detecting termination using size-change in parameter values. Master's thesis, Göteborgs Universitet, Sweden.Google Scholar
- Xi, H. 1999. Dependent types for program termination verification. Higher-Order Symb. Comput. 15, 1 (Mar.), 91--131. Google Scholar
Digital Library
Index Terms
Program termination analysis in polynomial time
Recommendations
Size-change termination with difference constraints
This article considers an algorithmic problem related to the termination analysis of programs. More specifically, we are given bounds on differences in sizes of data values before and after every transition in the program's control-flow graph. Our goal ...
Proving termination of context-sensitive rewriting by transformation
Context-sensitive rewriting (CSR) is a restriction of rewriting that forbids reductions on selected arguments of functions. With CSR, we can achieve a terminating behavior with non-terminating term rewriting systems, by pruning (all) infinite rewrite ...
Ranking functions for size-change termination
This article explains how to construct a ranking function for any program that is proved terminating by size-change analysis.
The “principle of size-change termination” for a first-order functional language with well-ordered data is intuitive: A program ...






Comments