TL;DR
This paper introduces a new, more efficient method for deciding the satisfiability of quantifier-free Presburger arithmetic formulas, particularly those arising in software verification. By exploiting the "sparse, mainly difference constraint" structure common in these formulas, they derive tighter bounds on solution sizes, leading to significantly smaller Boolean encodings and faster decision procedures.
What Problem Does This Paper Address?
Quantifier-free Presburger arithmetic (QFP) is a powerful theory used in areas like program analysis and hardware verification. While its satisfiability problem is decidable, it's known to be NP-complete, and existing decision procedures can struggle with the complexity of formulas generated in practice. A common approach is "finite instantiation," where integer variables are encoded as bit-vectors and the problem is translated to a Boolean satisfiability (SAT) problem. However, the theoretical bounds on the required bit-vector length (solution size) are often too large for practical use, especially when formulas have many constraints. This paper addresses the challenge of making finite instantiation practical for QFP formulas common in software verification, which often exhibit a specific structure: most constraints are simple "difference constraints" (e.g., $x_i - x_j \le b$), and the few non-difference constraints are "sparse" (involving few variables).
Methods
The core of the paper is the derivation of new, parameterized solution bounds for QFP formulas. Instead of relying solely on the total number of constraints ($m$), they introduce parameters that capture the specific structure of software verification formulas:
- $k$: The number of non-difference constraints.
- $w$: The maximum number of variables involved in any non-difference constraint (the "width").
They build upon existing results for integer linear programming (ILP) and adapt them to these specific parameters. The key steps involve:
- Transforming to ILP: QFP formulas are first converted into systems of linear constraints, potentially introducing auxiliary "zero" variables to handle non-negativity.
- Deriving Bounds for Difference Constraints: They first analyze the case where only difference constraints exist ($k=0$), leveraging the totally unimodular (TUM) property of the constraint matrix to derive bounds.
- Deriving Bounds for Sparse Non-Difference Constraints: They then extend this to the general case with $k$ non-difference constraints, showing how the bound depends on $k$ and $w$, but crucially, not on the total number of constraints $m$.
- Finite Instantiation: The derived bounds are used to determine the bit-vector length for encoding integer variables. This leads to a Boolean formula that is then solved by a SAT solver.
- Optimizations: The paper also proposes several practical optimizations to further reduce the solution bound and improve performance, including:
- Variable Classes: Partitioning variables into groups that share constraints to compute separate, tighter bounds.
- Special Constraint Classes: Exploiting known tighter bounds for pure equality or difference logic formulas.
- Handling Large Coefficients/Widths: Techniques to mitigate the impact of large coefficients ($a_{max}$) and widths ($w$) on the bound.
- Shift of Origin: A transformation to reduce the magnitude of constant terms ($b_{max}$).
Datasets
The paper uses benchmarks from two main sources:
- WiSA Project: Formulas generated from checking format string vulnerabilities.
- Blast Software Model Checker: Formulas generated from C programs.
These benchmarks are described as exhibiting the "sparse, mainly difference constraint" structure. The paper also mentions using a specific unsatisfiable formula from the Blast suite with large constants for evaluating the "shift of origin" optimization.
Key Insights and Ideas
- Structure Matters: The key insight is that the specific structure of formulas from software verification (sparse, mainly difference constraints) can be exploited to derive significantly tighter solution bounds than general-purpose bounds.
- Decoupling from $m$: The most impactful finding is that the solution bound can be made largely independent of the total number of constraints ($m$), depending instead on the number of non-difference constraints ($k$) and their width ($w$). This is crucial because $m$ can be very large in practice.
- Parameterized Bounds: The derived bounds are parameterized by $k$ and $w$, allowing for more precise estimations of the required bit-vector size.
- Practical Optimizations: The paper demonstrates that theoretical improvements can be translated into practical gains through techniques like variable class partitioning and handling of large constants.
Key Results
- The paper derives a new solution bound for QFP formulas that is linear in $k$ (number of non-difference constraints) and logarithmic in $w$ (width of non-difference constraints), $a_{max}$ (max coefficient), and $b_{max}$ (max constant term), but independent of $m$ (total constraints).
- This new bound leads to a decision procedure based on finite instantiation that can generate significantly smaller Boolean encodings.
- Experimental results show that their "UCLID" procedure, incorporating optimizations like "Coeff" (handling coefficients) and "Const" (handling constants), significantly reduces the number of bits per variable and often leads to faster SAT solving times compared to a baseline approach.
- For example, on WiSA benchmarks, optimizations reduced bits per variable by 5-10, and the "All" optimization (Coeff + Const) consistently reduced encoding and SAT solving times.
- The "shift of origin" optimization was shown to reduce the largest constant term by up to 600-fold on a specific test case.
- The UCLID procedure generally outperforms ICS on WiSA benchmarks, while ICS performs better on Blast benchmarks where the Boolean structure is simpler and proofs of unsatisfiability are shallow.
Limitations and Future Work
- Conservatism of Bounds: The authors acknowledge that the derived bounds are still conservative. The size of minors in actual problem instances can be much smaller than the theoretical upper bounds.
- Lazy Encoding: They suggest a "lazy encoding" approach where the solution bound is increased incrementally as needed, potentially avoiding the use of overly conservative bounds upfront.
- Other Constraint Classes: They propose finding tighter bounds for other special classes of constraints beyond difference logic.
- Non-SAT-based Procedures: Exploring the use of derived bounds in non-SAT-based decision procedures is suggested.
- Borosh, Treybig, and Flahive Conjecture: The paper mentions an open conjecture by Borosh, Treybig, and Flahive that their bound $\Delta$ could be improved to just $\Delta$.
- Understanding SAT Time Impact: Further research is needed to better understand why reducing the number of bits doesn't always predictably decrease SAT solving time.
- Applications Beyond Software Verification: Applying the work to other domains that share the exploited linear constraint structure is suggested.
Summary updated