English

On Deciding Constant Runtime of Linear Loops

Logic in Computer Science 2026-01-14 v1

Abstract

We consider linear single-path loops of the form whileφdoxAx+bend \textbf{while} \quad \varphi \quad \textbf{do} \quad \vec{x} \gets A \vec{x} + \vec{b} \quad \textbf{end} where x\vec{x} is a vector of variables, the loop guard φ\varphi is a conjunction of linear inequations over the variables x\vec{x}, and the update of the loop is represented by the matrix AA and the vector b\vec{b}. It is already known that termination of such loops is decidable. In this work, we consider loops where AA has real eigenvalues, and prove that it is decidable whether the loop's runtime (for all inputs) is bounded by a constant if the variables range over R\mathbb R or Q\mathbb Q. This is an important problem in automatic program verification, since safety of linear while-programs is decidable if all loops have constant runtime, and it is closely connected to the existence of multiphase-linear ranking functions, which are often used for termination and complexity analysis. To evaluate its practical applicability, we also present an implementation of our decision procedure.

Cite

@article{arxiv.2601.08492,
  title  = {On Deciding Constant Runtime of Linear Loops},
  author = {Florian Frohn and Jürgen Giesl and Peter Giesl and Nils Lommen},
  journal= {arXiv preprint arXiv:2601.08492},
  year   = {2026}
}

Comments

TACAS 2026

R2 v1 2026-07-01T09:02:39.745Z