One-Parametric Presburger Arithmetic
Has Quantifier Elimination
Abstract
We give a quantifier elimination procedure for one-parametric Presburger arithmetic, the extension of Presburger arithmetic with the function , where is a fixed free variable ranging over the integers. This resolves an open problem proposed in [Bogart et al., Discrete Analysis, 2017]. As conjectured in [Goodrick, Arch. Math. Logic, 2018], quantifier elimination is obtained for the extended structure featuring all integer division functions , one for each integer polynomial .
Our algorithm works by iteratively eliminating blocks of existential quantifiers. The elimination of a block builds on two sub-procedures, both running in non-deterministic polynomial time. The first one is an adaptation of a recently developed and efficient quantifier elimination procedure for Presburger arithmetic, modified to handle formulae with coefficients over the ring of univariate polynomials. The second is reminiscent of the so-called “base division method” used by Bogart et al. As a result, we deduce that the satisfiability problem for the existential fragment of one-parametric Presburger arithmetic (which encompasses a broad class of non-linear integer programs) is in NP, and that the smallest solution to a satisfiable formula in this fragment is of polynomial bit size.
Keywords and phrases:
decision procedures, quantifier elimination, non-linear integer arithmeticFunding:
Alessio Mansutti: Funded by the Madrid Regional Government (César Nombela grant 2023-T1/COM-29001), and by MCIN/AEI (grant PID2022-138072OB-I00).Copyright and License:
2012 ACM Subject Classification:
Computing methodologies Symbolic and algebraic algorithms ; Theory of computation LogicEditors:
Paweł Gawrychowski, Filip Mazowiecki, and Michał SkrzypczakSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
The first-order theory of the integers with addition and order, which is also known as Presburger arithmetic (PrA) or linear integer arithmetic, has been intensively studied during almost a century [26]. It is a textbook fact that Presburger arithmetic admits quantifier elimination when the structure is extended with the predicates for divisibilities by fixed integers : in the theory of this extended structure, for every quantifier-free formula there is a quantifier-free formula that is equivalent to . The construction of is effective, which implies the decidability of Presburger arithmetic. The algorithm to decide PrA is the canonical example for the notion of quantifier elimination procedure. The computational complexity of the many variants of this procedure has a long history, beginning with Oppen’s proof [25] that Cooper’s procedure [12] runs in triply exponential time, and followed by refinements from Reddy and Loveland [27], and later Weispfenning [30], which enable handling formulae with fixed quantifier alternations in doubly exponential time. Recent research on quantifier elimination aims at narrowing the complexity gap for the existential fragment (only last year it was discovered that quantifier elimination can be performed in exponential time in this case [11, 20]) and on extending the procedure to handle additional predicates and functions [28, 3, 11, 22], or other forms of quantification [10, 21, 4]. The reader can find an extensive bibliography on Presburger arithmetic, and quantifier elimination, in the survey papers by Haase [19] and Chistikov [9].
This paper addresses the open problem raised in the papers [6] and [15] regarding the existence of a quantifier elimination procedure for the theory Th, known as one-parametric Presburger arithmetic (). In this theory, the structure of Presburger arithmetic is extended with the function for multiplication by a single parameter ranging over . Every formula defines a parametric Presburger family , where is the set of (integer) solutions of the Presburger arithmetic formula obtained from by replacing the parameter with the integer .
Example 1.
Consider the statement “for every two successive positive integers and , and for all integers and , there is an integer in the interval that is congruent to modulo , and to modulo ”. The truth of this sentence follows from the Chinese remainder theorem together with the fact that successive positive integers are always coprime. We can encode this statement in with the formula , where
From the validity of the statement, we find for every . That is to say, for every instantiation of , both and are tautologies of PrA. ∎
There are many natural decision problems regarding (all taking a formula as input):
-
satisfiability: Is satisfiable for an instantiation of the parameter (i.e., ) ?
-
universality: Is satisfiable for all instantiations of the parameter (i.e., ) ?
-
finiteness: Is satisfiable for only finitely many instantiations of the parameter ?
In [6], Bogart, Goodrick, and Woods consider a search problem that generalises all the problems above: they show how to compute, from an input formula , a closed expression for the function , where stands for the cardinality of a set . By relying on properties of this function, one can solve satisfiability, universality, and finiteness. In their proof, the first ingredient is given by Goodrick’s bounded quantifier elimination procedure [15]. In contrast to the quantifier elimination procedures for PrA, in this procedure every quantified variable is not completely eliminated from the formula , but acquires instead a bound , for some univariate polynomial . An example of this is given by the variable in Example 1, which is bounded in . Closely related bounded quantifier elimination procedures were also developed in [23, 31]. The second ingredient of the construction is given by a method developed by Chen, Li, and Sam for the study of parametric polytopes [8], and dubbed “base division method” in [6]. This method produces a quantifier-free formula satisfying for every .
The combination of the two ingredients has a drawback: the equivalence of the initial formula with the quantifier-free formula over is not preserved. In [6, p. 13], the authors ask whether this issue can be fixed: “one might try to show that any formula [ of ] is logically equivalent to a quantifier-free formula in a slightly larger language with additional “well-behaved” function and relation symbols [ … ] But we already know that quantifier elimination in the original language [ of the structure ] is impossible, and finding a reasonable language for quantifier elimination seems difficult”. A candidate for the extended structure was suggested by Goodrick in [15, Conjecture 2.6]: must be extended with all integer division functions , one for each integer polynomial (these functions are assumed to occur in a formula only under the proviso that ). This is a rather tight conjecture, as all added functions are trivially definable in : the equality holds if and only if .
We give a positive answer to Goodrick’s conjecture:
Theorem 2.
One-parametric Presburger arithmetic admits effective quantifier elimination in the extended structure .
Above, the adjective “effective” reflects the fact that there is a quantifier elimination procedure for constructing, given an input formula , an equivalent quantifier-free formula . The main contribution towards the proof of Theorem 2 is a procedure for removing bounded quantifiers while preserving formula equivalence; hence obtaining for all , instead of the weaker obtained with the “base division method” from [6].
As mentioned above, an active area of research in quantifier elimination focuses on existential Presburger arithmetic (PrA) and its extensions. This interest is motivated, on the one hand, by the goal of improving both the performance and expressiveness of SMT solvers, mostly targeting existential theories [2, 14]. On the other hand, recent work has revisited the computational complexity of quantifier elimination procedures. For many years, these procedures were regarded as inefficient when applied to PrA. Notably, Weispfenning’s classic approach [30] yields only a NExpTime upper bound for satisfiability, despite fundamental results from integer programming [7, 29] establishing that PrA is in NP. It was not until 2024 that two independent works [11, 20] provided quantifier elimination procedures with matching NP upper bounds. The approach in [20] builds on the geometric ideas from [29], while [11] adapts Bareiss’ fraction-free Gaussian elimination procedure [1] to PrA. Starting from the fact that Bareiss’ algorithm works in any integral domain, we show that the second approach extends naturally to . By analysing the runtime of our procedure, we derive:
Theorem 3.
For the class of all existential formulae of , the following holds:
| Satisfiability | Universality | Finiteness |
| NP-complete | coNExp-complete | coNP-complete |
Our result on the satisfiability problem generalises the feasibility in NP of non-linear integer programs , where is a vector of quotients of integer polynomials in , proved by Gurari and Ibarra [17]. We remark that both problems are NP-hard in fixed dimension: solvability of systems is a well-known NP-complete problem [24].
Future work.
This paper does not provide a complexity analysis for full . A back-of-the-envelope calculation of the runtime of the procedures in [6] and [15] suggests that the satisfiability problem for is in elementary time (potentially in 3ExpTime). However, these procedures do not yield an NP upper bound for the existential fragment. In contrast, the procedure we introduce shows in NP, but it may in principle run in non-elementary time on arbitrary formulae. Unifying these procedures into a single “optimal” one seems possible and will be addressed in a forthcoming extended version of this paper. This would also provide an extension to the 3ExpTime quantifier-elimination procedure for almost linear arithmetic proposed by Weispfenning in [30].
Most of the literature on focuses on computing the function , as introduced in [6]. Not much is known regarding the complexity of computing this function. To our knowledge, the most significant result in this direction is the one in [5], where Bogart, Goodrick, Nguyen, and Woods show that can be computed in polynomial time (in the bit-length of given as part of the input) whenever is a fixed -formula. We believe Theorem 3 to be a good starting point for further research in this direction.
While our work shows that the feasibility problem for integer programs in which a single variable occurs non-linearly is in NP, the paper does not discuss related optimisation problems of minimisation/maximisation. From our quantifier elimination procedure, we can show that if there are optimal solutions to a linear polynomial with coefficients in subject to a formula in , then one is of polynomial bit size. Generalising this result to other non-convex objectives is an interesting avenue for future research.
2 Preliminaries
We write for the non-negative integers, and for the set of univariate polynomials , where the coefficients and the constant are over the integers . The height , degree and bit size of are defined as , , and , respectively. For example, has degree , height and bit size . Vectors of variables are denoted by , etc.; we write for the floor function.
On extending the structure of .
As discussed in Section 1, the paper concerns the extension of the first-order theory of by all integer division functions , where . However, in the context of our quantifier elimination procedure, it is more natural to work within the (equivalent) first-order theory of the structure:
where:
-
The integer division is only defined for , with the obvious interpretation.
-
The integer remainder function is defined following the equivalence
We remark that whenever the result of belongs to .
(Also note that the absolute value function is easily definable in Presburger arithmetic.)
-
The divisibility relation is a unary relation, and is defined following the equivalence
We remark that the divisibility relations and integer remainder functions are defined to satisfy the equivalence also when evaluates to .
For simplicity, we still denote this first-order theory with . Observe that we have ultimately defined and in terms of . As a result, every formula in this first-order theory can be translated into a formula from the theory in Theorem 2. This translation can be performed in polynomial time by introducing new existential quantifiers, or in exponential time without adding quantifiers (the blow-up is only due to the disjunctions in the definitions of and ).
The terms of are built from the constants , integer variables, and the functions of the structure. Without loss of generality, we restrict ourselves to (finite) terms of the form
| (1) |
where all and belong to , all belong to , and each is another term of this form. The term is said to be linear, if for (i.e., it does not contain integer division, nor integer remainder functions), and non-shifted whenever . Above, the terms and are linear occurrences of the integer division functions and integer remainder functions, and are said to occur linearly in . When every is an integer (a degree polynomial), we define -norm of as .
Moving to the atomic formulae of the theory, it is easy to see that equalities, inequalities and divisibility relations can be rewritten (in polynomial time) to be of the form , and , respectively, where is a term of the form given in Equation 1. Syntactically, we will only work with atomic formulae of these forms, which we call constraints. However, for readability, we will still sometimes write (in)equalities featuring non-zero terms on both sides (i.e., ), and strict inequalities and ; both are short for . A constraint is said to be linear if the term featured in it is linear.
We restrict ourselves to formulae in prenex normal form where is a positive Boolean combination of constraints; that is, the only Boolean connectives featured in are conjunctions and disjunctions . This restriction is without loss of generality, as De Morgan’s laws allow to push all negations at the level of literals, which can then be removed with the equivalences , and .
For two terms and , we write for a term substitution. We see these substitutions as functions from terms to terms or from formulae to formulae: is the term obtained by replacing, in the term , every occurrence of with . Analogously, is the formula obtained from by replacing the term with in every atomic formula , , or . In Section 4 we will also need a stronger notion of substitution, called vigorous substitution in [11]; we defer its definition to that section.
3 Outline of the quantifier elimination procedure
In this section, we provide a high-level overview of our quantifier elimination procedure, highlighting the interactions among its various components. A detailed analysis of the two main components will be provided in the subsequent sections of the paper.
Let us consider a formula , where is a positive Boolean combination of constraints. Our quantifier elimination procedure will work under the assumption that the parameter is greater than or equal to . This simplifying assumption is without loss of generality, as the general problem is then solved as follows:
-
For every , call a quantifier elimination procedure for Presburger arithmetic (e.g., the one in [30]) on the formula , obtaining . Let .
-
Call our procedure on , obtaining a formula . Let .
-
Call our procedure on , obtaining . Let .
Then, the formula is quantifier-free, and equivalent to .
As a second assumption, we only consider the case where has a single block of existential quantifiers: . A procedure for this type of formulae can be iterated bottom-up to eliminate arbitrarily many blocks of quantifiers (rewriting as ).
The pseudocode of our procedure is given in Algorithm 1 (-QE). It describes a non-deterministic algorithm: for an input , each non-deterministic execution of -QE returns a positive Boolean combination of constraints . The disjunction obtained by aggregating all output formulae is equivalent to ; so it is this disjunction that must ultimately be used to perform quantifier elimination. The choice to present the procedure in this manner is not merely stylistic: it automatically implements Reddy and Loveland’s optimisation for Presburger arithmetic [27]. In quantifier elimination procedures for PrA, eliminating a single variable from an existential block produces a formula with a DNF-like structure. Reddy and Loveland observed that pushing the remaining existential quantifiers inside the scope of the disjunctions, i.e., rewriting into , and then performing quantifier elimination locally to each disjunct leads to a faster procedure. By keeping variables local to a non-deterministic branch, one achieves the same effect.
We now describe the four components that make up -QE, which can be summarized under the following titles: pre-processing (lines 1–11), bounded quantifier elimination (call to BoundedQE), elimination of divisibility constraints (call to ElimDiv), and elimination of all bounded quantifiers (call to ElimBounded). For the rest of the section, let be the input to -QE, where is a positive Boolean combination of constraints.
Pre-processing (lines 1–11).
These lines remove all occurrences of the integer division functions and of the integer remainder functions , at the expense of adding new existentially quantified variables that are later eliminated. After this step, the formula is a positive Boolean combination of linear constraints. For the integer division function, the algorithm simply adds to the sequence of variables to be eliminated a fresh variable to proxy a term (line 2). It then relies on the equivalence to replace with (line 3). The removal of integer remainder functions is performed differently. First, let us observe that the following equivalence holds:
The formula on the right-hand side of the equivalence is considered in line 8. This line is executed conditionally to a non-deterministic branching (line 6). If it is not executed, then lines 9–11 are executed instead; these correspond to the formula . The interesting property of this formula is that the variable appears bounded by from below, and by either or from above (following the sign of ). Instead of quantifying using standard existential quantifiers (as done for the variables replacing ), in line 10 we use a bounded quantifier:
Definition 4.
A block of bounded quantifiers is given by a sequence of variables and a map assigning to each variable in a polynomial in . Its semantics is given by the equivalence .
Let us write and for the values taken by , , and in the non-deterministic branch , when the control flow of the program reaches line 12. The following equivalence holds, where the disjunction ranges across all non-deterministic branches:
| (2) |
Bounded quantifier elimination.
Once reaching line 12, the algorithm proceeds by calling the procedure BoundedQE. We will discuss this procedure in Section 4. In a nutshell, its role is to replace the quantifiers on the right-hand side of Equation 2 with bounded quantifiers, that are merged with the already existing block of bounded quantifiers . The formal specification of BoundedQE is given in the next lemma.
Lemma 5.
There is a non-deterministic procedure with the following specification:
The algorithm ensures that the disjunction of output formulae ranging over all non-deterministic branches is equivalent to .
As stated, the lemma above is also proved by Goodrick in [15], who introduced the first bounded quantifier elimination procedure specifically for . When applied to existential formulae, that procedure requires doubly-exponential time, making it unsuitable for establishing Theorem 3. In contrast, BoundedQE runs in non-deterministic polynomial time. Due to this difference, we cannot rely directly on [15] and must thus re-establish Lemma 5.
Removing divisibility constraints: more bounded quantifiers.
BoundedQE introduces divisibility constraints . The next step, detailed in Algorithm 2 (ElimDiv), eliminates all divisibility constraints in favour, once more, of bounded quantifiers.
The idea behind Algorithm 2 is as follows. Let be a constraint from the input formula, where are the variables in the block of bounded quantifiers (these correspond to the variables from Equation 2 and those introduced by BoundedQE), and are the free variables. Notice that this constraint is equivalent to , which is in turn equivalent to the existential formula , where is a fresh variable ranging over . Since is constrained by bounded quantifiers, we can upper-bound the number of digits in the base encoding of the linear term (recall: ). When , the same applies to , which ranges between and ; and this in turn imposes a bound on the base representation of . When instead, the truth of only depends on whether , and we can thus restrict to any non-empty interval. This allows us to replace the quantifier with a bounded quantifier (lines 3 and 4). Since ranges over , whereas bounded quantifiers use non-negative ranges, the algorithm explicitly guesses the sign of in line 5, allowing to only range over instead. Formalising these arguments yields the following lemma.
Lemma 6.
Algorithm 2 (ElimDiv) complies with its specification.
Elimination of all bounded quantifiers.
From the output of ElimDiv, the final operation by -QE is a call to ElimBounded, which removes all bounded quantifiers. This algorithm is detailed in Section 5. Its specification is given in the next lemma.
Lemma 7.
There is a non-deterministic procedure with the following specification:
The algorithm ensures that the disjunction of output formulae ranging over all non-deterministic branches is equivalent to .
Together, Equation 2 and Lemmas 5, 6, and 7 show that -QE meets its specification; thus showing Theorem 2 conditionally to the correctness of BoundedQE and ElimBounded.
4 Efficient bounded quantifier elimination in
This section outlines the arguments leading to the procedure BoundedQE. Its pseudocode is given in Algorithm 3. We start with an example demonstrating the key idea used to develop a version of bounded quantifier elimination in . These arguments are sufficient for establishing Lemma 5; although they do not result in an optimal procedure complexity-wise. We will then recall the main arguments used in [11] to obtain an optimal procedure, which, when implemented, yield BoundedQE.
Let us consider a formula where, for simplicity, is of the form:
where , , and are polynomials from , and , and are linear terms. For the time being, we invite the reader to pick some values for and the free variables , so that the formula becomes a formula from Presburger arithmetic in a single variable . The standard argument for eliminating in PrA goes as follows (see, e.g., [30]). We first update the inequalities to ensure that all coefficients of are equal; this results in the inequalities and . The quantification expresses that there is such that (i) is a multiple of that belongs to the interval ; and (ii) divides . The key observation is that such an integer (if it exists) can be found by only looking at elements of that are “close” to . More precisely, the properties (i) and (ii) must be simultaneously satisfied by , for some . We can thus restrict to satisfy an additional constraint . A small refinement: since this equality is unsatisfiable when the shift is not a multiple of , we can rewrite it as , where the shift now ranges in . Observe that lies in an interval that is independent of the values picked for ; as and were originally polynomials in .
Let us keep assigning a value to the parameter (so, and are still integers), but reinstate the variables . From the above argument, the formula is equivalent to . It is now straightforward to eliminate from each disjunct : we simply “apply” the equality , substituting for , and add a divisibility constraint forcing to be a multiple of . After this substitution, both and become . The resulting disjunct is
and is equivalent to . (For PrA, this concludes the quantifier elimination procedure.) When restoring the parameter , these two formulae are still equivalent, but the number of disjunctions now depends on . We replace them with a bounded quantifier, rewriting as , where . This is, in a nutshell, the bounded quantifier elimination procedure from [15, 31].
When the signs of , , and are unknown (i.e., does not feature the constraints , and ), we must perform a “sign analysis”: we write a disjunction (or guess) over all possible signs of the three polynomials. In Algorithm 3, the lines marked in yellow are related to this analysis; e.g., line 16 guesses the sign of the (non-zero) coefficient of .
Taming the complexity of the procedure.
Problems arise when looking at the complexity of the procedure outlined above. To understand this point, consider the inequality , which was derived by substituting for in , and suppose and , for some variable . This inequality can be rewritten as . When looking at the coefficient of one deduces that, if quantifier elimination is performed carelessly on a block of multiple existential quantifiers, the coefficients of the variables in the formula will grow quadratically with each eliminated variable. Then, by the end of the procedure, their binary bit size will be exponential in the number of variables in . However, this explosion can be avoided by noticing that coefficients are updated following the same pattern as in Bareiss’ polynomial-time Gaussian elimination procedure [1]. This insight was highlighted in [11], building upon an earlier observation from [31]. In Bareiss’ algorithm, the key to keeping coefficients polynomially bounded is given by the Desnanot–Jacobi identity. Consider an matrix . Let us write for the sub-matrix of made of the rows with indices and columns with indices . For with , and , we define .
Proposition 8 (Desnanot–Jacobi identity).
For every with , and , we have .
The Desnanot–Jacobi identity is true for all matrices with entries over an integral domain (a non-zero commutative ring in which the product of non-zero elements is non-zero), and therefore we can take the entries of to be polynomials in .
Returning to our informal discussion, we now see that the coefficient of is oddly similar to the left-hand side of the Desnanot–Jacobi identity. Suppose that the elements are the coefficients of the variables in the formula currently being processed by the quantifier elimination procedure, and we are eliminating the -th quantifier. Proposition 8 tells us that all coefficients produced by the naïve elimination (left-hand side of the identity) have as a common factor. By dividing through by this common factor, we obtain smaller coefficients for the next step of variable elimination – namely, . When eliminating the first variable (), the common factor is . Otherwise, it is the coefficient that the -th eliminated variable has in the equality used for the elimination. In Algorithm 3, the lines marked in blue implement Bareiss’ optimisation: line 8 initialises the common factor and its sign, line 15 updates it, and line 22 performs the division.
Some details on BoundedQE.
Lines 1–4 handle the divisibility constraints with the divisor equal to . Such constraints are equalities in disguise, and the procedure replaces them with . When the procedure reaches line 5, all divisors in the divisibility constraints are assumed non-zero. Following the example from the previous paragraph, recall that the shifts belong to intervals that depend on these divisors; when multiple divisors occur, the procedure for PrA takes their (instead of just as in our example). For simplicity, instead of , BoundedQE considers the absolute value of their product (line 6). After guessing the sign of this product, the procedure enforces in line 7. This information is stored in the formula , which accumulates all sign guesses made by the algorithm; these are conjoined to when the procedure returns.
Line 9 replaces all inequalities with equalities by introducing slack variables ranging over . (This step is inherited from [11].) Slack variables represent the shifts from the quantifier elimination procedure for PrA. Line 12 covers the corner cases of not appearing in equalities, or being such that all the coefficients of evaluate to zero. After guessing an equality to perform the substitution (line 14), line 19 checks whether features a slack variable (i.e., the equality was originally an inequality). If so, the procedure generates a bounded quantifier for . The elimination of (line 21) is performed with the vigorous substitution which works as follows: 1: Replace every equality with , and every divisibility with ; this is done also for constraints where does not occur. 2: Replace every occurrence of with (from step 1, each coefficient of in the system can be factored as for some ).
After applying the vigorous substitution, the procedure divides all coefficients of the inequalities and divisibility constraints in by the common factor of the Bareiss’ optimisation (line 22). In the case of divisibility constraints, divisors are also affected. Proposition 8 ensures that these divisions are all without remainder. In practice, the traditional Euclidean algorithm for polynomial division can be used to construct the quotient in polynomial time. As a result of these divisions, throughout the procedure all polynomials guessed in line 14 have polynomial bit sizes in the size of the input formula.
After the foreach loop of line 10 completes, all variables from have been eliminated (line 21) or bounded (line 12). A benefit of translating inequalities into equalities in line 9 is that can be eliminated independently of the sign of its coefficient ; inequalities would need to flip for negative instead. The final step (lines 24 and 25) drops all slack variables for which no bound was assigned in line 20, reintroducing the inequalities (the sign stored in tells us the direction of these inequalities). This step is also inherited from [11].
By fully developing the arguments above, one shows that BoundedQE is correct:
Lemma 9.
Algorithm 3 (BoundedQE) complies with its specification.
This lemma implies Lemma 5. In the sequel we will also need the next lemma, discussing properties of the outputs of BoundedQE for “Presburger-arithmetic-like” inputs.
Lemma 10.
Let be a formula input of Algorithm 3, in which all coefficients of the variables in , and all divisors in relations , are integers. The map in the output of each non-deterministic branch ranges over the integers.
5 Elimination of polynomially bounded quantifiers
We move to Algorithm 4 (ElimBounded), which eliminates the bounded quantifiers in three steps: replacement of bounded variables by their -ary expansions; “divisions by ” until all -digits have integer coefficients; elimination of -digits via BoundedQE.
Base expansion (lines 1–6).
Following the semantics of bounded quantifiers, line 1 adds to the bounds , for each bounded variable . The subsequent lines “bit blast” into its -ary expansion , where is the largest bit size of the bounds in (line 2). All added variables are -digits, i.e., they range in .
Example 11.
Let us see this step in action on a bounded version of the formula in Example 1:
where , and . By “bit blasting” the bounded variables into -digits , , and , we obtain the formula
Lemma 12.
Let be the formula obtained from by performing lines 1–6 of Algorithm 4. Then, the input formula is equivalent to and every (-digit) variable in has only linear occurrences in .
The coefficients of the -digits become integers (lines 7–17).
This step is defined by the while loop of line 7, whose goal is to transform the formula into an equivalent positive Boolean combination of equalities and inequalities in which all coefficients of are integers.
Example 13.
Before delving into the details, let us illustrate the transformation on the equality from Example 11. Grouping terms according to powers of , we obtain:
We symbolically perform a division with remainder on the sub-term concerning the free variables, rewriting it as . In the resulting equality, we notice that must be divisible by . Since both and belong to , only two multiples of are possible: and . Consider the latter case: we can rewrite the equality as the conjunction of and . By dividing the second equality by , the variables , and end up appearing with integer coefficients only. Repeating this process guarantees that all quantified variables satisfy this property: the second iteration “frees” and , and the third iteration handles the variable . ∎
The while loop guesses some integers in line 11. Let be the (finite) set of all sequences of guesses from the first iterations of the loop (so, has length ), and let be the unique formula obtained from after iterating the loop times, using as the sequence of guesses. (The subscript corresponds to the empty sequence of guesses; the only element in .)
Together with proving that the while loop preserves formula equivalence (across non-deterministic branches), the critical parameter to track during the execution of the loop is the degrees of all coefficients of the -digits . Showing that this parameter reaches implies loop termination, and correctness of this step of the procedure. More formally, we inductively define the -degree of a positive Boolean combination of constraints , where the variables occur only linearly, as follows (below, ):
-
if is an (in)equality ;
-
if is either or .
Then, the defining property of the while loop of line 7 can be stated as follows:
Lemma 14.
Consider with , and the set . Then, (i) is equivalent to , and (ii) for every .
Proof sketch..
The while loop considers an (in)equality from (line 7); inequalities are transformed into strict inequalities in line 8, as in this case the latter are easier to work with. Line 9 represents the term of the (in)equality as , where is linear, is a linear term with coefficients in , and is non-shifted.
Remark.
Observe that line 17 will later replace with . If the latter (in)equality is considered again by the while loop at a later iteration, this replacement will produce the term , which can be rewritten as . We assume the algorithm to implicitly perform this rewriting, so that the term above can in fact be written as
| (3) |
Let us define and
, so that the term in Equation 3
is then equal to .
(Note: is exactly the term in line 10.)
We are now ready to perform the symbolic division by .
Indeed, since all variables in , as well as the term , belong to ,
we conclude that where .
Line 11 guesses an integer from the
segment , which stands for the quotient
of the division of by .
Each guess corresponds to a disjunct from the following two equivalences:
These equivalences “perform” the symbolic division by .
In line 17,
the algorithm substitutes the constraint
with the result of the division,
that is, the conjunction of the quotient
and the remaining part that is stored the formula
(lines 12–16).
Observe a key property of : in it, all the
coefficients of the -digits only have integer coefficients,
i.e., .
Elimination of -digits (lines 18–26).
By inductively applying Lemma 14, we deduce that the while loop performs at most iterations, and that the disjunction (over all non-deterministic branches) of formulae obtained at the end of this loop is equivalent to . The constraints in each are (in)equalities , where , , all are -digits, and is a non-shifted term of .
The last step is to remove the -digits by appealing to BoundedQE (line 22). Recall that this algorithm requires all constraints in the input to be linear, while terms in may contain (nested) occurrences of the functions and . In order to respect this specification, ElimBounded first replaces each non-shifted term in with a fresh variable , storing the substitution in the map (line 20). These terms are restored at the end of the procedure (line 26). Since the variables occur free in the formula in input to BoundedQE, and this procedure preserves formula equivalence (Lemma 9), the overall process remains sound.
The formula in input of BoundedQE has no divisibility constraints, and the eliminated variables have integer coefficients. By Lemma 10 the output of each non-deterministic branch is a formula where, for every variable in , the bound is an integer. We can thus replace with a (guessed) integer (lines 23–25). After restoring the terms stored in , the resulting formula is quantifier-free and the disjunction over all outputs of ElimBounded is equivalent to the input formula.
Lemma 15.
Algorithm 4 (ElimBounded) complies with its specification.
This lemma implies Lemma 7, which was the last missing piece required to complete the proof of Theorem 2. To simplify the complexity arguments in the next section, we make use of the two observations in the following lemma, concerning the output of ElimBounded.
Lemma 16.
In every output of ElimBounded, all functions and are applied to non-shifted terms. In divisibility relations , the divisor is an integer.
6 Solving satisfiability, universality and finiteness
Now that we have established that admits quantifier elimination, let us discuss the decision problems of satisfiability, universality and finiteness defined in Section 1. Without loss of generality, we add to the formula in input to these problems a prefix of existential quantifiers over all its free variables; thus assuming that is a sentence.
Applying our quantifier elimination procedure to the sentence results in a variable-free formula whose truth only depends on the value taken by the parameter . Furthermore, from Lemma 16, all occurrences of the functions and are applied to the constant (the only variable-free non-shifted term) and can thus be replaced with ; and all divisibility relations are such that is an integer. That is to say, is a positive Boolean combination of univariate polynomial inequalities , equalities and divisibility constraints , where and .
We study the solutions to such a univariate formula . First, recall that computing the set of all integer roots of a polynomial in can be done in polynomial time:
Theorem 17 ([13, Theorem 1]).
There is a polynomial time algorithm that returns the set of integer roots of an input polynomial .
This theorem implies that the every integer root of has bit size polynomial in . Let be the roots of all the polynomials occurring in (in)equalities of . These roots partition in regions . The truth of all (in)equalities in remains invariant for integers within the same region. Furthermore, the solutions to the divisibility constraints in are periodic with period , i.e., setting satisfies the same divisibility constraints as , for every integer . Then, a solution to (if it exists) can be found in the interval . Moreover, has infinitely many solutions if and only if one solution lies in intervals or . To recap:
Lemma 18.
Let be a positive Boolean combination of polynomial inequalities , equalities and divisibility constraints , where and . Then,
-
1.
If has a solution, then it has one of bit size polynomial in the size of .
-
2.
If has a polynomial bit size solution that is either larger or smaller than all roots of the polynomials in (in)equalities of , then has infinitely many solutions, and vice versa.
The complexity of the existential fragment.
Lemma 18 implies decidability of all the decision problems of satisfiability, universality and finiteness. We now analyse their complexity for the existential fragment of , establishing Theorem 3. For simplicity of the exposition, we keep assuming . Our reasoning can be extended in a straightforward way to all , following the discussion given at the beginning of Section 3.
First and foremost, we study the complexity of our quantifier elimination procedure.
Lemma 19.
Algorithm 1 (-QE) runs in non-deterministic polynomial time.
Proof idea..
For the proof we track the evolution of the following parameters as Algorithm 1 executes, where is a formula, and is a map used for the bounded quantification:
-
,
-
,
-
,
-
,
-
.
For example, for the formula , we have , , (two occurrences of ), . The bit size of is polynomial in the values of these parameters.
One can show that throughout the procedure each of these parameters remain polynomially bounded with respect to all the parameters of the input formula. For instance, during the first two steps of ElimBounded, the number of variables in the manipulated formulae ( and ) increases at most polynomially in , due to the bit blasting of the bounded variables. However, by the end of the procedure, it reduces to the number of free variables – as expected by a quantifier elimination procedure.
While tedious, this proof is not dissimilar to the other complexity analyses of quantifier elimination procedures for PrA; see, e.g., [30]. Once the evolution of the parameters is known, it is simple to show that Algorithm 1 runs in non-deterministic polynomial time.
Our results on decision problems for existential formulae of follow.
Proof of Theorem 3.
- Satisfiability.
-
By Lemma 19 and Lemma 18.1, if the input sentence is satisfiable (equivalently, valid), then for some of bit size polynomial in the size of . Observe that replacing for in yields an existential sentence of Presburger arithmetic of size polynomial in the size of . Checking satisfiability for PrA is a well-known NP-complete problem [29]. We conclude that the satisfiability problem for existential formulae of is also NP-complete.
- Universality.
-
By Lemma 19, Algorithm 1 can be implemented by a deterministic exponential time Turing machine : given an input sentence , computes an equivalent disjunction of exponentially many polynomial-size formulae . By Lemma 16, each is a positive Boolean combination of (in)equalities and divisibility constraints , with and . From Theorem 17, all roots of polynomials in (in)equalities of are of bit size polynomial in the size of . However, the period may be of exponential bit size.
As a certificate asserting that is a negative instance, we can take , the sequence of configurations reached by when computing from , and a number . The certificate is verified in polynomial time (in its size) by checking that the sequence of configurations is a valid run of computing from , and that is not a solution to . Since the certificate has exponential size, universality is in coNExp. (coNExp-hardness follows from the coNExp-hardness of the fragment of PrA [16, 18].)
- Finiteness.
-
Equivalently, we show that the problem of checking whether a sentence is satisfiable for infinitely many instantiations of is NP-complete. The proof of NP-hardness is trivial: for sentences without , this problem is equivalent to the satisfiability problem for . For the NP membership, let us consider the formula computed from an input sentence via Algorithm 1. If is satisfied by infinitely many values of , then the same holds for least one of the formulae . By Lemma 18.2, has infinitely many solutions if and only if it has a solution of bit size polynomial in the size of , such that is either larger or smaller than all roots of polynomials appearing in (in)equalities of . Then, as a certificate asserting that has infinitely many solutions we can provide , the sequence of non-deterministic guesses made by Algorithm 1 to compute from , and the value . This certificate can be verified in polynomial time: first, run Algorithm 1 using the provided sequence of guesses, and check that the output is . Then, compute (in polynomial time) all roots of the polynomials appearing in the (in)equalities of , and verify that is a solution to that is either larger or smaller than all of them.
References
- [1] Erwin H. Bareiss. Sylvester’s identity and multistep integer-preserving Gaussian elimination. Math. Comput., 1968. doi:10.1090/S0025-5718-1968-0226829-0.
- [2] Clark W. Barrett and Cesare Tinelli. Satisfiability modulo theories. In Handbook of Model Checking. 2018. doi:10.1007/978-3-319-10575-8_11.
- [3] Michael Benedikt, Dmitry Chistikov, and Alessio Mansutti. The complexity of Presburger arithmetic with power or powers. In ICALP, 2023. doi:10.4230/LIPICS.ICALP.2023.112.
- [4] Pascal Bergsträßer, Moses Ganardi, Anthony W. Lin, and Georg Zetzsche. Ramsey quantifiers in linear arithmetics. In POPL, 2024. doi:10.1145/3632843.
- [5] Tristram Bogart, John Goodrick, Danny Nguyen, and Kevin Woods. Parametric Presburger arithmetic: complexity of counting and quantifier elimination. Math. Logic Quart., 2019. doi:10.1002/malq.201800068.
- [6] Tristram Bogart, John Goodrick, and Kevin Woods. Parametric Presburger arithmetic: logic, combinatorics, and quasi-polynomial behavior. Discrete Analysis, 2017. doi:10.19086/da.1254.
- [7] Itshak Borosh and Leon B. Treybig. Bounds on positive integral solutions of linear Diophantine equations. Proc. Am. Math. Soc., 55(2):299–304, 1976. doi:10.2307/2041711.
- [8] Sheng Chen, Nan Li, and Steven V. Sam. Generalized Ehrhart polynomials. Trans. Amer. Math. Soc., 2012. doi:10.1090/S0002-9947-2011-05494-2.
- [9] Dmitry Chistikov. An introduction to the theory of linear integer arithmetic. In FSTTCS, 2024. doi:10.4230/LIPIcs.FSTTCS.2024.1.
- [10] Dmitry Chistikov, Christoph Haase, and Alessio Mansutti. Quantifier elimination for counting extensions of Presburger arithmetic. In FoSSaCS, 2022. doi:10.1007/978-3-030-99253-8_12.
- [11] Dmitry Chistikov, Alessio Mansutti, and Mikhail R. Starchak. Integer linear-exponential programming in NP by quantifier elimination. In ICALP, 2024. (Full version of this paper: arXiv:2407.07083). doi:10.4230/LIPICS.ICALP.2024.132.
- [12] David C. Cooper. Theorem proving in arithmetic without multiplication. Machine Intelligence, 1972.
- [13] Felipe Cucker, Pascal Koiran, and Steve Smale. A polynomial time algorithm for diophantine equations in one variable. J. Symb. Comput., 1999. doi:10.1006/jsco.1998.0242.
- [14] Florian Frohn and Jürgen Giesl. Satisfiability modulo exponential integer arithmetic. In IJCAR, 2024. doi:10.1007/978-3-031-63498-7_21.
- [15] John Goodrick. Bounding quantification in parametric expansions of Presburger arithmetic. Arch. Math. Logic, 2018. doi:10.1007/s00153-017-0593-0.
- [16] Erich Grädel. Dominoes and the complexity of subclasses of logical theories. Ann. Pure Appl. Log., 1989. doi:10.1016/0168-0072(89)90023-7.
- [17] Eitan M. Gurari and Oscar H. Ibarra. An NP-complete number-theoretic problem. J. ACM, 26(3):567–581, 1979. doi:10.1145/322139.322152.
- [18] Christoph Haase. Subclasses of Presburger arithmetic and the weak EXP hierarchy. In CSL-LICS, pages 47:1–47:10, 2014. doi:10.1145/2603088.2603092.
- [19] Christoph Haase. A survival guide to Presburger arithmetic. ACM SIGLOG News, 2018. doi:10.1145/3242953.3242964.
- [20] Christoph Haase, Shankara Narayanan Krishna, Khushraj Madnani, Om Swostik Mishra, and Georg Zetzsche. An efficient quantifier elimination procedure for Presburger arithmetic. In ICALP, 2024. doi:10.4230/LIPIcs.ICALP.2024.142.
- [21] Peter Habermehl and Dietrich Kuske. On Presburger arithmetic extended with non-unary counting quantifiers. Log. Methods Comput. Sci., 2023. doi:10.46298/lmcs-19(3:4)2023.
- [22] Toghrul Karimov, Florian Luca, Joris Nieuwveld, Joël Ouaknine, and James Worrell. On the decidability of presburger arithmetic expanded with powers. In SODA, 2025. doi:10.1137/1.9781611978322.89.
- [23] Aless Lasaruk and Thomas Sturm. Effective quantifier elimination for Presburger arithmetic with infinity. In CASC, 2009. doi:10.1007/978-3-642-04103-7_18.
- [24] Kenneth L. Manders and Leonard Adleman. NP-complete decision problems for binary quadratics. Journal of Computer and System Sciences, 16(2):168–184, 1978. doi:10.1016/0022-0000(78)90044-2.
- [25] Derek C. Oppen. A upper bound on the complexity of Presburger arithmetic. J. Comput. Syst. Sci., 1978. doi:10.1016/0022-0000(78)90021-1.
- [26] Mojżesz Presburger. Über die Vollständigkeit eines gewissen Systems der Arithmetik ganzer Zahlen, in welchem die Addition als einzige Operation hervortritt. In Comptes Rendus du I Congrès des Mathématiciens des Pays Slaves, pages 92–101. 1929.
- [27] Cattamanchi R. Reddy and Donald W. Loveland. Presburger arithmetic with bounded quantifier alternation. In STOC, 1978. doi:10.1145/800133.804361.
- [28] Mikhail R. Starchak. Positive existential definability with unit, addition and coprimeness. In ISSAC, 2021. doi:10.1145/3452143.3465515.
- [29] Joachim von zur Gathen and Malte Sieveking. A bound on solutions of linear integer equalities and inequalities. Proc. Am. Math. Soc., 1978. doi:10.1090/S0002-9939-1978-0500555-0.
- [30] Volker Weispfenning. The complexity of almost linear Diophantine problems. J. Symb. Comput., 1990. doi:10.1016/S0747-7171(08)80051-X.
- [31] Volker Weispfenning. Complexity and uniformity of elimination in Presburger arithmetic. In ISSAC, pages 48–53, 1997. doi:10.1145/258726.258746.
