Skip to main content

Verified Quadratic Virtual Substitution for Real Arithmetic

  • Conference paper
  • First Online:
Formal Methods (FM 2021)

Abstract

This paper presents a formally verified quantifier elimination (QE) algorithm for first-order real arithmetic by linear and quadratic virtual substitution (VS) in Isabelle/HOL. The Tarski-Seidenberg theorem established that the first-order logic of real arithmetic is decidable by QE. However, in practice, QE algorithms are highly complicated and often combine multiple methods for performance. VS is a practically successful method for QE that targets formulas with low-degree polynomials. To our knowledge, this is the first work to formalize VS for quadratic real arithmetic including inequalities. The proofs necessitate various contributions to the existing multivariate polynomial libraries in Isabelle/HOL. Our framework is modularized and easily expandable (to facilitate integrating future optimizations), and could serve as a basis for developing practical general-purpose QE algorithms. Further, as our formalization is designed with practicality in mind, we export our development to SML and test the resulting code on 378 benchmarks from the literature, comparing to Redlog, Z3, Wolfram Engine, and SMT-RAT. This identified inconsistencies in some tools, underscoring the significance of a verified approach for the intricacies of real arithmetic.

This material is based upon work supported by the National Science Foundation under Grant No. CNS-1739629, a National Science Foundation Graduate Research Fellowship under Grants Nos. DGE1252522 and DGE1745016, and by the AFOSR under grant number FA9550-16–1-0288. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation or of AFOSR.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 89.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 119.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    Notice that if \(y = 0\), then both \(\sqrt{2}y^2 + 2y + 1 = 0\) and \(y^2\cdot (2y + 1) \le 0 \wedge 2y^4 - (2y + 1)^2= 0\) are false. If instead \(y \ne 0\), then \(\sqrt{2}y^2 + 2y + 1 = 0\) is true exactly when \(\sqrt{2} = -(2y + 1)/y^2\), or exactly when \(-(2y + 1)/y^2 \ge 0 \wedge 2y^4 - (2y + 1)^2= 0\), which is logically equivalent to \(y^2\cdot (2y + 1) \le 0 \wedge 2y^4 - (2y + 1)^2= 0\), as desired.

  2. 2.

    MacBook Pro 2019 with 2.6 GHz Intel Core i7 (model 9750H) and 32 GB memory (2667 MHz DDR4 SDRAM).

  3. 3.

    https://sourceforge.net/projects/reduce-algebra/files/snapshot_2021-04-13/.

  4. 4.

    https://sourceforge.net/projects/reduce-algebra/files/snapshot_2021-07-16/.

  5. 5.

    https://github.com/ths-rwth/smtrat/releases/tag/21.05.

  6. 6.

    https://github.com/Z3Prover/z3/releases/tag/z3-4.8.10.

  7. 7.

    http://mlton.org/.

References

  1. Bohrer, B., Rahli, V., Vukotic, I., Völp, M., Platzer, A.: Formally verified differential dynamic logic. In: Bertot, Y., Vafeiadis, V. (eds.) CPP, pp. 208–221. ACM, New York (2017). https://doi.org/10.1145/3018610.3018616

  2. Chaieb, A.: Automated methods for formal proofs in simple arithmetics and algebra. Ph.D. thesis, Technische Universität München (2008). mediatum.ub.tum.de/doc/649541/649541.pdf

  3. Cohen, C., Mahboubi, A.: Formal proofs in real algebraic geometry: from ordered fields to quantifier elimination. Log. Methods Comput. Sci. 8(1) (2012). https://doi.org/10.2168/LMCS-8(1:2)2012

  4. Collins, G.E.: Quantifier elimination for real closed fields by cylindrical algebraic decomposition. In: Barkhage, H. (ed.) Automata Theory and Formal Languages. LNCS, vol. 33, pp. 134–183. Springer (1975). https://doi.org/10.1007/3-540-07407-4_17

  5. Corzilius, F., Kremer, G., Junges, S., Schupp, S., Ábrahám, E.: SMT-RAT: an open source C++ toolbox for strategic and parallel SMT solving. In: Heule, M., Weaver, S.A. (eds.) SAT. LNCS, vol. 9340, pp. 360–368. Springer (2015). https://doi.org/10.1007/978-3-319-24318-4_26

  6. Dolzmann, A., Sturm, T.: REDLOG: computer algebra meets computer logic. SIGSAM Bull. 31(2), 2–9 (1997). https://doi.org/10.1145/261320.261324

    Article  Google Scholar 

  7. Durán, A.J., Pérez, M., Varona, J.L.: The misfortunes of a trio of mathematicians using computer algebra systems. can we trust in them? Notices of the AMS 61(10), 1249–1252 (2014). https://doi.org/10.1090/noti1173

  8. Fulton, N., Mitsch, S., Quesel, J.D., Völp, M., Platzer, A.: KeYmaera X: An axiomatic tactical theorem prover for hybrid systems. In: Felty, A.P., Middeldorp, A. (eds.) CADE. LNCS, vol. 9195, pp. 527–538. Springer (2015). https://doi.org/10.1007/978-3-319-21401-6_36

  9. Gao, S., Kong, S., Clarke, E.M.: dReal: An SMT solver for nonlinear theories over the reals. In: Bonacina, M.P. (ed.) CADE. LNCS, vol. 7898, pp. 208–214. Springer (2013). https://doi.org/10.1007/978-3-642-38574-2_14

  10. Hupel, L., Nipkow, T.: A verified compiler from Isabelle/HOL to CakeML. In: Ahmed, A. (ed.) ESOP. LNCS, vol. 10801, pp. 999–1026. Springer (2018). https://doi.org/10.1007/978-3-319-89884-1_35

  11. Jovanovic, D., de Moura, L.M.: Solving non-linear arithmetic. In: Gramlich, B., Miller, D., Sattler, U. (eds.) IJCAR. LNCS, vol. 7364, pp. 339–354. Springer (2012). https://doi.org/10.1007/978-3-642-31365-3_27

  12. Košta, M.: New concepts for real quantifier elimination by virtual substitution. Ph.D. thesis, Universität des Saarlandes (2016)

    Google Scholar 

  13. McLaughlin, S., Harrison, J.: A proof-producing decision procedure for real arithmetic. In: Nieuwenhuis, R. (ed.) CADE. LNCS, vol. 3632, pp. 295–314. Springer (2005). https://doi.org/10.1007/11532231_22

  14. de Moura, L.M., Bjørner, N.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS. LNCS, vol. 4963, pp. 337–340. Springer (2008). https://doi.org/10.1007/978-3-540-78800-3_24

  15. Mulligan, C.B., Bradford, R.J., Davenport, J.H., England, M., Tonks, Z.: Quantifier elimination for reasoning in economics. CoRR (2018). arXiv:1804.10037

  16. Nipkow, T.: Linear quantifier elimination. J. Autom. Reason. 45(2), 189–212 (2010). https://doi.org/10.1007/s10817-010-9183-0

    Article  MathSciNet  MATH  Google Scholar 

  17. Passmore, G.O.: Combined decision procedures for nonlinear arithmetics, real and complex. Ph.D. thesis, School of Informatics, University of Edinburgh (2011)

    Google Scholar 

  18. Platzer, A.: Logical analysis of hybrid systems: proving theorems for complex dynamics. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-14509-4

  19. Platzer, A.: Logical foundations of cyber-physical systems. Springer, Cham (2018). https://doi.org/10.1007/978-3-319-63588-0

  20. Platzer, A., Quesel, J.D., Rümmer, P.: Real world verification. In: Schmidt, R.A. (ed.) CADE. LNCS, vol. 5663, pp. 485–501. Springer, Berlin (2009). https://doi.org/10.1007/978-3-642-02959-2_35

  21. Ratschan, S., Smaus, J.: Verification-integrated falsification of non-deterministic hybrid systems. In: Cassandras, C.G., Giua, A., Seatzu, C., Zaytoon, J. (eds.) ADHS. IFAC Proceedings Volumes, vol. 39, pp. 371–376. Elsevier (2006). https://doi.org/10.3182/20060607-3-IT-3902.00068

  22. Scharager, M., Cordwell, K., Mitsch, S., Platzer, A.: Verified quadratic virtual substitution for real arithmetic. Archive of Formal Proofs, Formal proof development (2021). https://www.isa-afp.org/entries/Virtual_Substitution.html

  23. Scharager, M., Cordwell, K., Mitsch, S., Platzer, A.: Verified quadratic virtual substitution for real arithmetic. CoRR (2021). arXiv:2105.14183

  24. Scharager, M., Cordwell, K., Mitsch, S., Platzer, A.: Verified quadratic virtual substitution for real arithmetic: benchmark examples and scripts. Zenodo (2021). https://doi.org/10.5281/zenodo.5189881

  25. Seidenberg, A.: A new decision method for elementary algebra. Annals Math. 60(2), 365–374 (1954)

    Google Scholar 

  26. Sternagel, C., Thiemann, R.: Executable multivariate polynomials. Archive of Formal Proofs, Formal proof development (2010). www.isa-afp.org/entries/Polynomials.html

  27. Sturm, T.: A survey of some methods for real quantifier elimination, decision, and satisfiability and their applications. Math. Comput. Sci. 11(3-4), 483–502 (2017). https://doi.org/10.1007/s11786-017-0319-z

  28. Sturm, T.: Thirty years of virtual substitution: foundations, techniques, applications. In: Kauers, M., Ovchinnikov, A., Schost, É. (eds.) ISSAC, pp. 11–16. ACM (2018). https://doi.org/10.1145/3208976.3209030

  29. Tarski, A.: A decision method for elementary algebra and geometry. RAND Corporation, Santa Monica (1951)

    Google Scholar 

  30. Weispfenning, V.: The complexity of linear problems in fields. J. Symb. Comput. 5(1/2), 3–27 (1988). https://doi.org/10.1016/S0747-7171(88)80003-8

    Article  MathSciNet  MATH  Google Scholar 

  31. Weispfenning, V.: Quantifier elimination for real algebra - the cubic case. In: MacCallum, M.A.H. (ed.) ISSAC, pp. 258–263. ACM (1994). https://doi.org/10.1145/190347.190425

  32. Weispfenning, V.: Quantifier elimination for real algebra - the quadratic case and beyond. Appl. Algebra Eng. Commun. Comput. 8(2), 85–101 (1997). https://doi.org/10.1007/s002000050055

    Article  MathSciNet  MATH  Google Scholar 

Download references

Acknowledgment

We wish to thank Fabian Immler for his substantial contributions at CMU to the polynomial theories of Isabelle/HOL and regret that his current industry position precludes our ability to include him as a coauthor. Thank you also to the anonymous FM reviewers for their useful feedback.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Matias Scharager .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Scharager, M., Cordwell, K., Mitsch, S., Platzer, A. (2021). Verified Quadratic Virtual Substitution for Real Arithmetic. In: Huisman, M., Păsăreanu, C., Zhan, N. (eds) Formal Methods. FM 2021. Lecture Notes in Computer Science(), vol 13047. Springer, Cham. https://doi.org/10.1007/978-3-030-90870-6_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-90870-6_11

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-90869-0

  • Online ISBN: 978-3-030-90870-6

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics