Download PDFOpen PDF in browser

Cycle Detection for Affine Integer Linear Loops

9 pages•Published: October 24, 2026

Abstract

We study the cycle-detection problem for affine single-path linear-constrained loops over the integers. A cycle is a finite execution that returns to its initial state. Cycle detection is a natural relaxation of termination: every cycle witnesses non-termination, while an infinite execution need not contain a cycle.
We prove that cycle detection for affine integer loops belongs to Σ^P_2. The proof relies on the algebraic structure of periodic vectors of the update matrix. Using the cyclotomic factors of its characteristic polynomial, we obtain a polynomial representation of the periodic subspace and of exponentially distant states along a periodic orbit. We then apply a small-integer-solution theorem to show that, whenever a cyclic state exists, one exists with polynomial bit-length. Consequently, cycle existence can be expressed by existentially guessing such a state and universally quantifying over a polynomial-size binary encoding of a position in its orbit, with the resulting predicate decidable in polynomial time.

In: Stephan Schulz, Konstantin Korovin and Michael Rawson (editors). Proceedings of 16th International Workshop on the Implementation on Logics. Proceedings of the 26th Conference on Logic for Programming, Artificial Intelligence, and Reasoning (short papers), vol 23, pages 1-9.

BibTeX entry
@inproceedings{IWIL-2026:Cycle_Detection_Affine_Integer,
  author    = {Mishel Carelli and Bernd Finkbeiner},
  title     = {Cycle Detection for Affine Integer Linear Loops},
  booktitle = {Proceedings of 16th International Workshop on the Implementation on Logics. Proceedings of the 26th Conference on Logic for Programming, Artificial Intelligence, and Reasoning (short papers)},
  editor    = {Stephan Schulz and Konstantin Korovin and Michael Rawson},
  series    = {Kalpa Publications in Computing},
  volume    = {23},
  publisher = {EasyChair},
  bibsource = {EasyChair, https://easychair.org},
  issn      = {2515-1762},
  url       = {/publications/paper/1RZb},
  doi       = {10.29007/js2s},
  pages     = {1-9},
  year      = {2026}}
Download PDFOpen PDF in browser