The size-change principle for program termination

  • Authors:
  • Chin Soon Lee;Neil D. Jones;Amir M. Ben-Amram

  • Affiliations:
  • Department of Computer Science and Software Engineering, The University of Western Australia, Nedlands 6907;Datalogisk Institut, University of Copenhagen, Universitetsparken, DK-2100 Copenhagen, Denmark;Academic College of Tel-Aviv-Yaffo, 4 Antokolsky Steet, Tel-Aviv 64044, Israel

  • Venue:
  • POPL '01 Proceedings of the 28th ACM SIGPLAN-SIGACT symposium on Principles of programming languages
  • Year:
  • 2001

Quantified Score

Hi-index 0.02

Visualization

Abstract

The "size-change termination" principle for a first-order functional language with well-founded data is: a program terminates on all inputs if every infinite call sequence (following program control flow) would cause an infinite descent in some data values.Size-change analysis is based only on local approximations to parameter size 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 ω-regular set, representable by a Büchi automaton. Algorithms for such automata can be used to decide size-change termination. We also give a direct algorithm operating on "size-change graphs" (without the passage to automata).Compared to other results in the literature, termination analysis based on the size-change principle is surprisingly simple and general: lexical orders (also called lexicographic orders), indirect function calls and permuted arguments (descent that is not in-situ) are all handled automatically and without special treatment, with no need for manually supplied argument orders, or theorem-proving methods not certain to terminate at analysis time.We establish the problem's intrinsic complexity. This turns out to be surprisingly high, complete for PSPACE, in spite of the simplicity of the principle. PSPACE hardness is proved by a reduction from Boolean program termination. An ineresting consequence: the same hardness result applies to many other analyses found in the termination and quasitermination literature.