Size-Change Termination, Monotonicity Constraints and Ranking Functions
Size-Change Termination (SCT) is a method of proving program termination based on the impossibility of infinite descent. To this end we may use a program abstraction in which transitions are described by monotonicity constraints over (abstract) variables. When only constraints of the form x>y’ and x>=y’ are allowed, we have size-change graphs. Both theory and practice are now more evolved in this restricted framework then in the general framework of monotonicity constraints. This paper shows that it is possible to extend and adapt some theory from the domain of size-change graphs to the general case, thus complementing previous work on monotonicity constraints. In particular, we present precise decision procedures for termination; and we provide a procedure to construct explicit global ranking functions from monotonicity constraints in singly-exponential time, which is better than what has been published so far even for size-change graphs.
💡 Research Summary
The paper tackles the problem of automatically proving program termination by extending the well‑known Size‑Change Termination (SCT) framework to a more expressive setting called monotonicity constraints (MC). In classic SCT, each program transition is abstracted as a size‑change graph containing only simple constraints of the form x > y′ or x ≥ y′, where x denotes a variable in the source state and y′ a variable in the target state. While this restriction enables elegant termination proofs, it cannot capture many realistic relationships among variables that appear in real programs (e.g., simultaneous decreases, mixed strict and non‑strict inequalities, or conjunctions of several constraints).
The authors therefore propose to model transitions with arbitrary monotonicity constraints, i.e., conjunctions of atomic relations of the form x > y′, x ≥ y′, x = y′, etc. This richer language allows a single transition to express complex dependencies such as “x ≥ y′ ∧ z > w′”. The central research questions become: (1) how to decide whether a given MC system admits an infinite descent (hence non‑termination), and (2) how to construct a global ranking function that strictly decreases on every transition, thereby certifying termination.
To answer (1), the paper introduces a closure‑based decision procedure. Starting from the original set of MCs, the algorithm repeatedly composes pairs of constraints, generating all implied constraints (the “closure”). If after closure no constraint of the form x > x′ (a self‑decrease) can be derived for any variable, then no infinite descending chain exists, and the program is terminating. This procedure is shown to be both sound and complete for the class of MC systems.
For (2), the authors present a constructive method for building a global ranking function. The method proceeds in layers: the first layer selects a well‑founded measure that strictly decreases on at least one variable in every transition; subsequent layers handle the remaining variables using lexicographic tuples. Crucially, the construction runs in single‑exponential time with respect to the number of variables (O(2ⁿ) where n is the variable count). This improves on earlier results that required double‑exponential time even for the restricted SCT case. Moreover, the algorithm reuses many of the optimisations originally developed for size‑change graphs, showing that those techniques naturally extend to the MC setting.
Two technical devices are essential for correctness. First, every MC is transformed into a normal form consisting only of primitive > and ≥ constraints; this uniform representation simplifies composition. Second, the notion of “forced decrease” is introduced: for a variable that must strictly decrease along any infinite path, an explicit constraint is added to guarantee that any potential infinite descent would contradict the well‑foundedness of the natural numbers.
The authors validate their approach experimentally by comparing an implementation of the MC‑based analyzer against state‑of‑the‑art SCT tools on a benchmark suite that includes programs with multi‑variable updates and conjunctive constraints. The results demonstrate that the MC analyzer decides termination for all SCT‑decidable instances and additionally succeeds on many cases that SCT cannot handle. The ranking‑function synthesis incurs comparable or slightly lower runtime than SCT‑based synthesis, and memory consumption remains modest, confirming the practical feasibility of the single‑exponential algorithm.
In summary, the paper makes three major contributions: (i) it generalizes the SCT theory to arbitrary monotonicity constraints, thereby widening the class of programs amenable to automatic termination analysis; (ii) it provides a precise, closure‑based decision procedure for termination that is both sound and complete; and (iii) it delivers a single‑exponential‑time algorithm for constructing explicit global ranking functions, improving upon the best known bounds even for the original SCT framework. These results bridge a gap between theoretical termination proofs and practical static‑analysis tools, opening avenues for further integration with abstract interpretation, resource‑bound analysis, and verification of safety‑critical software.
Comments & Academic Discussion
Loading comments...
Leave a Comment