Size-change termination principle explained

The size-change termination principle (SCT) guarantees termination for a computer program by proving that infinite computations always trigger infinite descent in data values that are well-founded.[1] Size-change termination analysis utilizes this principle in order to solve the universal halting problem for a certain class of programs. When applied to general programs, the principle is intended to be used conservatively, which means that if the analysis determines that a program is terminating, the answer is sound, but a negative answer means "don't know". The decision problem for SCT is PSPACE-complete; however, there exists an algorithm that computes an approximation of the decision problem in polynomial time.[2] Size-change analysis is applicable to both first-order and higher-order functional programs,[3] as well as imperative programs[4] and logic programs.[5] The latter application preceded by four years the general formulation of the principle by Lee et al.

Overview

The size-change termination principle was introduced by Chin Soon Lee, Neil D. Jones, and Amir M. Ben-Amram in 2001. It relies on intermediary objects called size-change graphs that describe the relationship between source and destination parameters in a given function call (for a functional program). The method analyzes these graphs to make conclusions about the existence of monotonically decreasing sequences of parameters throughout the execution of a program. The size-change termination principle is stated as such:

If every infinite computation would give rise to an infinitely decreasing value sequence (according to the size-change graphs), then no infinite computation is possible.
Size-change graphs express both the possible presence of a function call as well as whether parameters within function call decrease or do not increase. In order to derive termination from size-change graphs, Lee at al. formulate a sufficient condition in terms of the graphs (with no reference to the underlying program). This condition is decidable by an algorithm that operates solely on the graphs.

Size-change termination analysis is related to abstract interpretation, in particular to a technique called predicate abstraction.[6]

Relationship to the halting problem

The halting problem for Turing-complete computational models states that the decision problem of whether a program will halt on a particular input, or on all inputs, is undecidable. Therefore, a general algorithm for proving any program to halt does not exist. Size-change termination is decidable because it only asks whether termination is provable from given size-change graphs.

External links

Notes and References

  1. Lee. Chin Soon. Jones. Neil D.. Ben-Amram. Amir M.. Lee. Chin Soon. Jones. Neil D.. Ben-Amram. Amir M.. 2001-01-01. The size-change principle for program termination, The size-change principle for program termination. ACM SIGPLAN Notices. 36. 3. 81–92. 10.1145/360204.360210. 12721873 . 0362-1340. free.
  2. Ben-Amram. Amir M.. Lee. Chin Soon. 2007-01-01. Program termination analysis in polynomial time. ACM Transactions on Programming Languages and Systems. 29. 1. 5. 10.1145/1180475.1180480. 9093670 . 0164-0925. free.
  3. Book: 10.1007/11575467_19. Termination Analysis of Higher-Order Functional Programs. Programming Languages and Systems. 3780. 281–297. Lecture Notes in Computer Science. 2005. Sereni. Damien. Jones. Neil D.. 978-3-540-29735-2. 10.1.1.102.4934.
  4. Book: 10.1007/11737414_14. Size-Change Termination and Bound Analysis. Functional and Logic Programming. 3945. 192–207. Lecture Notes in Computer Science. 2006. Avery. James. 978-3-540-33438-5.
  5. Lindenstrauss, Naomi and Sagiv, Yehoshua. Automatic Termination Analysis of Prolog Programs. Proceedings of the Fourteenth International Conference on Logic Programming. MIT Press, 1997.
  6. Book: 10.1007/978-3-642-15769-1_4. Size-Change Termination and Transition Invariants. Static Analysis. 6337. 22–50. Lecture Notes in Computer Science. 2010. Heizmann. Matthias. Jones. Neil D.. Podelski. Andreas. 978-3-642-15768-4. 10.1.1.167.8500.