Tiwari proved that termination of linear programs (loops with linear loop conditions and updates) over the reals is decidable through Jordan forms and eigenvectors computation. Braverman proved that it is also decidable over the integers. In this paper, we consider the termination of loops with polynomial loop conditions and linear updates over the reals and integers. First, we prove that the termination of such loops over the integers is undecidable. Second, with an assumption, we provide an complete algorithm to decide the termination of a class of such programs over the reals. Our method is similar to that of Tiwari in spirit but uses different techniques. Finally, we conjecture that the termination of linear programs with polynomial loop conditions over the reals is undecidable in general by %constructing a loop and reducing the problem to another decision problem related to number theory and ergodic theory, which we guess undecidable.
Deep Dive into Termination of Linear Programs with Nonlinear Constraints.
Tiwari proved that termination of linear programs (loops with linear loop conditions and updates) over the reals is decidable through Jordan forms and eigenvectors computation. Braverman proved that it is also decidable over the integers. In this paper, we consider the termination of loops with polynomial loop conditions and linear updates over the reals and integers. First, we prove that the termination of such loops over the integers is undecidable. Second, with an assumption, we provide an complete algorithm to decide the termination of a class of such programs over the reals. Our method is similar to that of Tiwari in spirit but uses different techniques. Finally, we conjecture that the termination of linear programs with polynomial loop conditions over the reals is undecidable in general by %constructing a loop and reducing the problem to another decision problem related to number theory and ergodic theory, which we guess undecidable.
Termination analysis is an important aspect of program verification. Guaranteed termination of program loops is necessary for many applications, especially those for which unexpected behavior can be catastrophic. For a generic loop while (conditions) {updates}, it is well known that the termination problem is undecidable in general, even for a simple class of polynomial programs [3]. In [2] Blondel et al. proved that, even when all the conditions and updates are given as piecewise linear functions, the termination of the loop remains undecidable.
In [16] Tiwari proved that termination of the following programs is decidable over R (the real numbers)
where A and B are respectively n × n and m × n matrices, BX > b represents a conjunction of linear inequalities over the state variables X and X := AX represents a (deterministic) linear update of each variable. Subsequently in [4] Braverman proved that the termination of P 0 is decidable over Z (the integers).
In this paper, we consider the problem of termination of the following loop:
while (P (X) > 0) {X := AX}, where X = [x 1 . . . x N ] T is the vector of state variables of the program, P (X) = [P 1 (X) P 2 (X) . . . P m (X)] T are polynomial constraints, each
and A is an N ×N matrix over Q (the rational numbers).
That is to say, we replace the linear constraints in P 0 with polynomial constraints and keep linear updates unchanged.
There are some well known techniques for deciding termination of some special kinds of programs. Ranking functions are most often used for this purpose. A ranking function for a loop maps the values of the loop variables to a wellfounded domain; further, the values of the map decrease on each iteration. A linear ranking function is a ranking function that is a linear combination of the loop variables and constants. Recently, the synthesis of ranking functions draws increasing attention, and some heuristics concerning how to automatically generate linear ranking functions for linear programs have been proposed in [8,9,12]. In [12] Podelski et al. provided an efficient and complete synthesis method based on linear programming to construct linear ranking functions. In [5] Chen et al. proposed a method to generate non-linear ranking functions based on semi-algebraic system solving. However, existence of ranking function is only a sufficient condition on the termination of a program. It is not difficult to construct programs that terminate, but do not have ranking functions.
To solve the problem of termination of P 1 , we do not use the technique of ranking functions. Our method is similar to that of Tiwari in spirit. Our main contributions in this paper are as follows. First, we prove that the termination of P 1 over Z is undecidable. Then it is easy to prove that, if “>” is replaced with “≥” in P 1 , termination of the resulted P 1 over Z is undecidable either. Second, with an assumption, we provide an algorithm to decide the termination of P 1 over R. Finally, we conjecture that the termination of P 1 over R is undecidable in general by constructing a loop and reducing the problem to another decision problem related to number theory and ergodic theory, which we guess undecidable.
The rest of the paper is organized as follows. Section 2 proves the undecidability of P 1 and its variation over Z. Section 3 introduces our main algorithm. The main steps of the algorithm are outlined first and some details of the steps are introduced separately in several subsections. With an assumption, we prove the correctness of our algorithm at the end of Section 3. After presenting our conjecture that the termination of P 1 is generally undecidable in Section 4, we conclude the paper in Section 5.
2 Undecidability of P 1 over Z Definition 1. A loop with N variables is called terminating over a ring R if for all the inputs X ∈ R N , it is terminating; otherwise it is called nonterminating.
The undecidability of P 1 is obtained by a reduction to Hilbert’s 10 th problem. Consider the following loop: Proof. Because the existence of an integer root of an arbitrary Diophantine equation is undecidable, the termination of P 1 over Z is undecidable according to Lemma 1.
If “>” is substituted with “≥” in P 1 , the loop becomes
Analogously, we denote by P ′ 2 the loop obtained by substituting “≥” for “>” in P 2 . It is easy to see that Lemma 1 still holds for P ′ 2 . Then we get the following theorem.
1 over Z is undecidable.
3 Relatively Complete Algorithm for Termination of P 1 over R
To decide whether P 1 terminates on a given input X ∈ R N , it is natural to consider a general expression of A n X, for instance, a unified formula expressing A n X for any n. If one has such unified formula of A n X, one can express the values of P (X) after n iterations. Then, for each element of P (X) (each constraint), i.e., P i (X), one may try to determine whether P i (X) > 0 as n → +∞ by guessing the dominant term of P i (X) and deciding the sign of the t
…(Full text truncated)…
This content is AI-processed based on ArXiv data.