🤖 AI Summary
This study addresses the termination problem for single-variable linear constrained loops over the integers. By establishing a bidirectional correspondence between this problem and generalized Collatz sequences, it reveals a profound connection between the two for the first time. The paper proves that if a non-terminating trajectory exists, then there must exist a cyclic trajectory of length at most two. Building on this insight, the authors propose a polynomial-time decision procedure for loop termination under the assumption that the generalized Collatz conjecture holds. This work not only offers a novel perspective on program termination but also fosters deeper integration between program verification and number-theoretic conjectures.
📝 Abstract
Linear-constraint loops are programs whose transition relation is specified by a system of linear inequalities. The termination problem asks, given a loop, whether it admits an infinite computation. Decidability of termination remains open for linear-constraint loops over integers, rationals, and reals. We focus on loops over integers and show that they are tightly connected to generalized Collatz sequences - integer sequences generated by maps that are linear on each residue class modulo a fixed natural number. We prove that termination of one-variable linear-constraint loops is decidable in polynomial time, provided a long-standing conjecture about generalized Collatz sequences holds. Conversely, we show that any decision procedure for one-variable loops would prove or refute specific instances of this conjecture, which remain open. Moreover, we show that if a one-variable loop has a cyclic trace, then it also has a cyclic trace of length at most two.