English

Loop Termination and Generalized Collatz Sequences

Logic in Computer Science 2026-05-15 v1

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.

Keywords

Cite

@article{arxiv.2605.15094,
  title  = {Loop Termination and Generalized Collatz Sequences},
  author = {Mishel Carelli},
  journal= {arXiv preprint arXiv:2605.15094},
  year   = {2026}
}

Comments

Accepted to the 53rd International Colloquium on Automata, Languages, and Programming (ICALP 2026)