skip to main content
research-article
Open access

Solvable Polynomial Ideals: The Ideal Reflection for Program Analysis

Published: 05 January 2024 Publication History

Abstract

This paper presents a program analysis method that generates program summaries involving polynomial arithmetic. Our approach builds on prior techniques that use solvable polynomial maps for summarizing loops. These techniques are able to generate all polynomial invariants for a restricted class of programs, but cannot be applied to programs outside of this class---for instance, programs with nested loops, conditional branching, unstructured control flow, etc. There currently lacks approaches to apply these prior methods to the case of general programs. This paper bridges that gap. Instead of restricting the kinds of programs we can handle, our method abstracts every loop into a model that can be solved with prior techniques, bringing to bear prior work on solvable polynomial maps to general programs. While no method can generate all polynomial invariants for arbitrary programs, our method establishes its merit through a monotonicty result. We have implemented our techniques, and tested them on a suite of benchmarks from the literature. Our experiments indicate our techniques show promise on challenging verification tasks requiring non-linear reasoning.

References

[1]
Mohammad Afzal, A. Asia, Avriti Chauhan, Bharti Chimdyalwar, Priyanka Darke, Advaita Datar, Shrawan Kumar, and R. Venkatesh. 2019. VeriAbs : Verification by Abstraction and Test Generation. In 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE). 1138–1141. https://doi.org/10.1109/ASE.2019.00121
[2]
Daneshvar Amrollahi, Ezio Bartocci, George Kenison, Laura Kovács, Marcel Moosbrugger, and Miroslav Stankovič. 2022. Solving Invariant Generation for Unsolvable Loops. In Static Analysis, Gagandeep Singh and Caterina Urban (Eds.). Springer Nature Switzerland, Cham. 19–43. isbn:978-3-031-22308-2 https://doi.org/10.1007/978-3-031-22308-2_3
[3]
Dirk Beyer. 2023. Competition on Software Verification and Witness Validation: SV-COMP 2023. In Tools and Algorithms for the Construction and Analysis of Systems, Sriram Sankaranarayanan and Natasha Sharygina (Eds.). Springer Nature Switzerland, Cham. https://doi.org/10.1007/978-3-031-30820-8_29
[4]
Bruno Buchberger. 1976. A Theoretical Basis for the Reduction of Polynomials to Canonical Forms. SIGSAM Bull., 10, 3 (1976), Aug., 19–29. https://doi.org/10.1145/1088216.1088219
[5]
David Cachera, Thomas Jensen, Arnaud Jobin, and Florent Kirchner. 2012. Inference of Polynomial Invariants for Imperative Programs: A Farewell to Gröbner Bases. In Static Analysis, Antoine Miné and David Schmidt (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 58–74. isbn:978-3-642-33125-1 https://doi.org/10.1007/978-3-642-33125-1_7
[6]
Krishnendu Chatterjee, Hongfei Fu, Amir Kafshdar Goharshady, and Ehsan Kafshdar Goharshady. 2020. Polynomial Invariant Generation for Non-Deterministic Recursive Programs. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2020). Association for Computing Machinery, New York, NY, USA. 672–687. isbn:9781450376136 https://doi.org/10.1145/3385412.3385969
[7]
David A. Cox, John Little, and Donal O’Shea. 2015. Ideals, Varieties, and Algorithms (4th ed.). Springer. https://doi.org/10.1007/978-3-319-16721-3
[8]
John Cyphert, Jason Breck, Zachary Kincaid, and Thomas W. Reps. 2019. Refinement of path expressions for static analysis. Proc. ACM Program. Lang., 3, POPL (2019), 45:1–45:29. https://doi.org/10.1145/3290358
[9]
John Cyphert and Zachary Kincaid. 2023. Solvable Polynomial Ideals: The Ideal Reflection for Program Analysis. arxiv:2311.04092.
[10]
John Cyphert and Zachary Kincaid. 2023. Solvable Polynomial Ideals: The Ideal Reflection for Program Analysis Artifact. https://doi.org/10.5281/zenodo.10069757
[11]
Graham Everest, Alfred J van der Poorten, Igor Shparlinski, and Thomas Ward. 2003. Recurrence Sequences. 104, American Mathematical Society Providence, RI.
[12]
Azadeh Farzan and Zachary Kincaid. 2015. Compositional Recurrence Analysis. In Proceedings of the 15th Conference on Formal Methods in Computer-Aided Design (FMCAD ’15). FMCAD Inc, Austin, Texas. 57–64. isbn:9780983567851 https://doi.org/10.1109/FMCAD.2015.7542253
[13]
Jean-Charles Faugère. 1999. A new efficient algorithm for computing Gröbner bases (F4). Journal of Pure and Applied Algebra, 139, 1 (1999), 61–88. issn:0022-4049 https://doi.org/10.1016/S0022-4049(99)00005-5
[14]
Jean-Charles Faugère. 2010. FGb: A Library for Computing Gröbner Bases. In Mathematical Software – ICMS 2010. https://www-polsys.lip6.fr/~jcf/FGb/index.html
[15]
Florian Frohn, Marcel Hark, and Jürgen Giesl. 2020. Termination of Polynomial Loops. In Static Analysis, David Pichardie and Mihaela Sighireanu (Eds.). Springer International Publishing, Cham. 89–112. isbn:978-3-030-65474-0 https://doi.org/10.1007/978-3-030-65474-0_5
[16]
Guoqiang Ge. 1993. Algorithms Related to Multiplicative Representations of Algebraic Numbers. Ph. D. Dissertation. Mathematics Department, University of California at Berkeley. Berkeley, CA.
[17]
Amir Kafshdar Goharshady, S. Hitarth, Fatemeh Mohammadi, and Harshit Jitendra Motwani. 2023. Algebro-Geometric Algorithms for Template-Based Synthesis of Polynomial Programs. Proc. ACM Program. Lang., 7, OOPSLA1 (2023), Article 100, apr, 30 pages. https://doi.org/10.1145/3586052
[18]
Matthias Heizmann, Jochen Hoenicke, and Andreas Podelski. 2009. Refinement of Trace Abstraction. In Static Analysis, 16th International Symposium, SAS 2009, Los Angeles, CA, USA, August 9-11, 2009. Proceedings, Jens Palsberg and Zhendong Su (Eds.) (Lecture Notes in Computer Science, Vol. 5673). Springer, 69–85. https://doi.org/10.1007/978-3-642-03237-0_7
[19]
Ehud Hrushovski, Joël Ouaknine, Amaury Pouly, and James Worrell. 2018. Polynomial Invariants for Affine Programs. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS ’18). Association for Computing Machinery, New York, NY, USA. 530–539. isbn:9781450355834 https://doi.org/10.1145/3209108.3209142
[20]
Ehud Hrushovski, Joël Ouaknine, Amaury Pouly, and James Worrell. 2023. On Strongest Algebraic Program Invariants. J. ACM, 70, 5 (2023), Article 29, oct, 22 pages. issn:0004-5411 https://doi.org/10.1145/3614319
[21]
Andreas Humenberger, Maximilian Jaroschek, and Laura Kovács. 2018. Invariant Generation for Multi-Path Loops with Polynomial Assignments. In Verification, Model Checking, and Abstract Interpretation, Isil Dillig and Jens Palsberg (Eds.). Springer International Publishing, Cham. 226–246. isbn:978-3-319-73721-8 https://doi.org/10.1007/978-3-319-73721-8_11
[22]
Fredrik Johansson. 2017. Arb: efficient arbitrary-precision midpoint-radius interval arithmetic. IEEE Trans. Comput., 66 (2017), 1281–1292. https://doi.org/10.1109/TC.2017.2690633
[23]
Manuel Kauers and Burkhard Zimmermann. 2008. Computing the algebraic relations of C-finite sequences and multisequences. Journal of Symbolic Computation, 43, 11 (2008), 787–803. issn:0747-7171 https://doi.org/10.1016/j.jsc.2008.03.002
[24]
Zachary Kincaid, John Cyphert, Jason Breck, and Thomas Reps. 2018. Non-Linear Reasoning for Invariant Synthesis. Proc. ACM Program. Lang., 2, POPL (2018), Article 54, dec, 33 pages. https://doi.org/10.1145/3158142
[25]
Zachary Kincaid, Nicolas Koh, and Shaowei Zhu. 2023. When Less Is More: Consequence-Finding in a Weak Theory of Arithmetic. Proc. ACM Program. Lang., 7, POPL (2023), Article 44, jan, 33 pages. https://doi.org/10.1145/3571237
[26]
Zachary Kincaid, Thomas Reps, and John Cyphert. 2021. Algebraic Program Analysis. In Computer Aided Verification, Alexandra Silva and K. Rustan M. Leino (Eds.). Springer International Publishing, Cham. 46–83. isbn:978-3-030-81685-8 https://doi.org/10.1007/978-3-030-81685-8_3
[27]
Kensuke Kojima, Minoru Kinoshita, and Kohei Suenaga. 2018. Generalized homogeneous polynomials for efficient template-based nonlinear invariant synthesis. Theoretical Computer Science, 747 (2018), 33–47. https://doi.org/10.1016/j.tcs.2018.06.005
[28]
Laura Kovács. 2008. Reasoning Algebraically About P-Solvable Loops. In Tools and Algorithms for the Construction and Analysis of Systems, C. R. Ramakrishnan and Jakob Rehof (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 249–264. isbn:978-3-540-78800-3 https://doi.org/10.1007/978-3-540-78800-3_18
[29]
Markus Müller-Olm and Helmut Seidl. 2004. A Note on Karr’s Algorithm. In Automata, Languages and Programming, Josep Díaz, Juhani Karhumäki, Arto Lepistö, and Donald Sannella (Eds.). Springer Berlin Heidelberg, Berlin, Heidelberg. 1016–1028. isbn:978-3-540-27836-8 https://doi.org/10.1007/978-3-540-27836-8_85
[30]
Markus Müller-Olm and Helmut Seidl. 2004. Computing polynomial program invariants. Inform. Process. Lett., 91, 5 (2004), 233–244. https://doi.org/10.1016/j.ipl.2004.05.004
[31]
Steven De Oliveira, Saddek Bensalem, and Virgile Prevosto. 2016. Polynomial invariants by linear algebra. Lecture Notes in Computer Science, 9938 LNCS (2016), 479–494. https://doi.org/10.1007/978-3-319-46520-3_30 Conference of 14th International Symposium on Automated Technology for Verification and Analysis, ATVA 2016 ; Conference Date: 17 October 2016 Through 20 October 2016; Conference Code:185289
[32]
Enric Rodríguez-Carbonell and Deepak Kapur. 2004. Automatic Generation of Polynomial Loop Invariants: Algebraic Foundations. In Proceedings of the 2004 International Symposium on Symbolic and Algebraic Computation (ISSAC ’04). Association for Computing Machinery, New York, NY, USA. 266–273. isbn:158113827X https://doi.org/10.1145/1005285.1005324
[33]
Enric Rodríguez-Carbonell and Deepak Kapur. 2007. Generating all polynomial invariants in simple loops. Journal of Symbolic Computation, 42, 4 (2007), 443–476. https://doi.org/10.1016/j.jsc.2007.01.002
[34]
Sriram Sankaranarayanan, Henny B. Sipma, and Zohar Manna. 2004. Non-Linear Loop Invariant Generation Using GröBner Bases. In Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’04). Association for Computing Machinery, New York, NY, USA. 318–329. isbn:158113729X https://doi.org/10.1145/964001.964028
[35]
Jake Silverman and Zachary Kincaid. 2019. Loop Summarization with Rational Vector Addition Systems. In Computer Aided Verification, Isil Dillig and Serdar Tasiran (Eds.). Springer International Publishing, Cham. 97–115. isbn:978-3-030-25543-5 https://doi.org/10.1007/978-3-030-25543-5_7
[36]
The FLINT team. 2023. FLINT: Fast Library for Number Theory. Version 2.9.0, https://flintlib.org
[37]
S. M. Ulam and John von Neumann. 1947. On combination of stochastic and deterministic processes. Summer meeting of the American Mathematical Society.
[38]
Philipp Wendler and Dirk Beyer. 2023. Bench Exec 3.16. https://github.com/sosy-lab/benchexec
[39]
Shaowei Zhu and Zachary Kincaid. 2021. Reflections on Termination of Linear Loops. In Computer Aided Verification: 33rd International Conference, CAV 2021, Virtual Event, July 20–23, 2021, Proceedings, Part II. Springer-Verlag, Berlin, Heidelberg. 51–74. isbn:978-3-030-81687-2 https://doi.org/10.1007/978-3-030-81688-9_3
[40]
Shaowei Zhu and Zachary Kincaid. 2021. Termination Analysis without the Tears. In Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI 2021). Association for Computing Machinery, New York, NY, USA. 1296–1311. isbn:9781450383912 https://doi.org/10.1145/3453483.3454110

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 8, Issue POPL
January 2024
2820 pages
EISSN:2475-1421
DOI:10.1145/3554315
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution 4.0 International License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 05 January 2024
Published in PACMPL Volume 8, Issue POPL

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. Algebraic program analysis
  2. monotone program analysis
  3. polynomial invariants

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)320
  • Downloads (Last 6 weeks)45
Reflects downloads up to 27 Dec 2024

Other Metrics

Citations

Cited By

View all

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media