The size-change principle for program termination

Citation
Cs. Lee et al., The size-change principle for program termination, ACM SIGPL N, 36(3), 2001, pp. 81-92
Citations number
20
Categorie Soggetti
Computer Science & Engineering
Journal title
ACM SIGPLAN NOTICES
ISSN journal
15232867 → ACNP
Volume
36
Issue
3
Year of publication
2001
Pages
81 - 92
Database
ISI
SICI code
1523-2867(200103)36:3<81:TSPFPT>2.0.ZU;2-#
Abstract
The "size-change termination" principle for a first-order functional langua ge with well-founded data is: a program terminates on all inputs if every i nfinite call sequences (following program control flow) would cause an infi nite descent in some data values. Size-change analysis is based only on local approximations to parameter siz e changes derivable from program syntax. The set of infinite call sequences that follow program flow and can be recognized as causing infinite descent is an w-regular set, representable by a Buchi automaton. Algorithms for su ch automata can be used to decide size-change termination. We also give a d irect algorithm operating on "size-change graphs" (without the passage to a utomata). Compared to other results in the literature, termination analysis based on the size-change principle is surprisingly simple and general: lexical order s (also called lexicographic orders), indirect function calls and permuted arguments (descent that is not in-situ) are all handled automatically and w ithout special treatment, with no need for manually supplied argument order s, or theorem-proving methods not certain to terminate at analysis time. We establish the problem's intrinsic complexity. This turns out to be surpr isingly high, complete for PSPACE, in spite of the simplicity of the princi ple. PSPACE hardness is proved by a reduction from Boolean program terminat ion. An interesting consequence: the same hardness result applies to many o ther analyses found in the termination and quasi-termination literature.