TL;DR
This paper presents the first complete formalization of a multivariate quantifier elimination (QE) algorithm for real arithmetic within the Isabelle/HOL theorem prover. This breakthrough allows for the automatic transformation of complex quantified real arithmetic formulas into equivalent quantifier-free forms, a crucial step for verifying safety-critical systems.
What Problem Does This Paper Address?
Verifying the correctness of cyber-physical systems (CPS) often involves reasoning about real arithmetic, which frequently includes quantified statements (using "for all" and "there exists"). These quantified formulas pose significant computational challenges. Quantifier elimination (QE) is a technique that transforms such formulas into logically equivalent quantifier-free ones, which are then easier to evaluate. While algorithms for univariate (single-variable) QE have been successfully formalized, tackling multivariate (multiple-variable) QE is considerably more complex due to the nature of multivariate polynomials. This paper addresses the challenge of creating and formally verifying a complete QE algorithm for multivariate real arithmetic within a theorem prover, a task that has seen limited progress.
Methods
The authors present a hybrid QE algorithm that combines elements of Tarski's original algorithm with the Ben-Or, Kozen, and Reif (BKR) algorithm, incorporating insights from Renegar. The core of their approach involves a "sign determination" procedure. This procedure, at its heart, uses a multivariate matrix equation to capture sign information for a set of polynomials under various assumptions about their coefficients.
Key steps include:
- Treating Multivariate as Univariate: For a given formula, polynomials are treated as univariate in one variable (e.g.,
x), with their coefficients being polynomials in the remaining variables (e.g.,y1, ..., yn). - Sign Determination: This involves finding all consistent sign assignments (positive, zero, negative) for a set of polynomials. This is achieved by constructing a polynomial
pwhose roots and critical points help determine the signs of the original polynomials. - Multivariate Matrix Equation: This is the central component that connects possible sign assignments of polynomials to multivariate Tarski queries. It's an adaptation of the univariate matrix equation, generalized to handle multivariate polynomials.
- Quantifier Elimination Function (
elim_forall): This function iteratively eliminates one universal quantifier at a time, leveraging the sign determination and matrix equation machinery. - Top-Level QE Algorithm (
qe): This function orchestrates the elimination of all quantifiers, handling both existential and universal quantifiers, and building upon existing verified libraries for virtual substitution.
The formalization in Isabelle/HOL required rigorous mathematical definitions and proofs, leading to approximately 8500 lines of code.
Datasets
Not discussed in the paper.
Key Insights and Ideas
- Hybrid Approach: Combining Tarski's foundational work with the more efficient BKR algorithm (and Renegar's insights) provides a path towards a complete, yet potentially more manageable, formalization than purely relying on Tarski's original, non-elementary complexity algorithm.
- Matrix Equation as a Bridge: The multivariate matrix equation is a crucial insight, acting as a bridge between the abstract problem of sign determination and the concrete computation of Tarski queries. This structure allows for the systematic handling of sign information across multiple variables.
- Formalization as a Driver of Rigor: The authors emphasize that the formalization process itself forced them to precisely define and prove correctness for each algorithmic component, revealing underspecified details in the original mathematical descriptions.
- Univariate-Multivariate Connection: The strategy of treating multivariate polynomials as univariate (with polynomial coefficients) is key to leveraging existing formalizations of univariate QE and proving correctness. This "universal projection" technique is fundamental to their proof strategy.
Key Results
- First Complete Multivariate QE in Isabelle/HOL: The paper presents the first formally verified complete algorithm for multivariate quantifier elimination in real arithmetic within the Isabelle/HOL theorem prover.
- Soundness and Completeness: The formalized algorithm is proven to be sound (producing logically equivalent quantifier-free formulas) and complete (able to eliminate any quantifier).
- Library Extensions: The formalization led to significant extensions of Isabelle/HOL's libraries for multivariate polynomials, which are expected to benefit future work in this area.
- Code Export: The algorithm has been exported to SML code, enabling testing and integration with other verified components.
Limitations and Future Work
- Inefficiency: The authors acknowledge that their current algorithm is "prohibitively inefficient" on its own, especially when compared to unverified computer algebra systems. This is attributed to the branching strategy in the Tarski query computation and a lack of inherent optimizations.
- Future Work:
- Full BKR Reduction: Extend the algorithm to fully realize the reduction steps of the BKR algorithm to improve efficiency.
- Optimization: Aggressively optimize the algorithm, including fine-tuning branching strategies (e.g., avoiding trivial case splits on constants) and optimizing Tarski query computation.
- Parallelism: Explore opportunities for parallelism in the algorithm.
- Integration: Further leverage the connection with verified virtual substitution for practical applications.
Summary updated