skip to main content
research-article
Open Access

Optimal CHC Solving via Termination Proofs

Published:11 January 2023Publication History
Skip Abstract Section

Abstract

Motivated by applications to open program reasoning such as maximal specification inference, this paper studies optimal CHC solving, a problem to compute maximal and/or minimal solutions of constrained Horn clauses (CHCs). This problem and its subproblems have been studied in the literature, and a major approach is to iteratively improve a solution of CHCs until it becomes optimal. So a key ingredient of optimization methods is the optimality checking of a given solution. We propose a novel optimality checking method, as well as an optimization method using the proposed optimality checker, based on a computational theoretical analysis of the optimality checking problem. The key observation is that the optimality checking problem is closely related to the termination analysis of programs, and this observation is useful both theoretically and practically. From a theoretical perspective, it clarifies a limitation of an existing method and incorrectness of another method in the literature. From a practical perspective, it allows us to apply techniques of termination analysis to the optimality checking of a solution of CHCs. We present an optimality checking method based on constraint-based synthesis of termination arguments, implemented our method, evaluated it on CHCs that encode maximal specification synthesis problems, and obtained promising results.

References

  1. Aws Albarghouthi, Isil Dillig, and Arie Gurfinkel. 2016. Maximal Specification Synthesis. In POPL ’16. ACM, 789–801. Google ScholarGoogle Scholar
  2. Christophe Alias, Alain Darte, Paul Feautrier, and Laure Gonnord. 2010. Multi-dimensional Rankings, Program Termination, and Complexity Bounds of Flowchart Programs. In SAS ’10. Springer, 117–133. Google ScholarGoogle Scholar
  3. Amir M. Ben-Amram and Samir Genaim. 2014. Ranking Functions for Linear-Constraint Loops. J. ACM, 61, 4 (2014), Article 26, July, 55 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Amir M. Ben-Amram and Samir Genaim. 2017. On Multiphase-Linear Ranking Functions. In CAV ’17. Springer, 601–620. Google ScholarGoogle Scholar
  5. Tewodros Beyene, Swarat Chaudhuri, Corneliu Popeea, and Andrey Rybalchenko. 2014. A Constraint-based Approach to Solving Games on Infinite Graphs. In POPL ’14. ACM, 221–233. Google ScholarGoogle Scholar
  6. Tewodros A. Beyene, Corneliu Popeea, and Andrey Rybalchenko. 2013. Solving Existentially Quantified Horn Clauses. In CAV ’13 (LNCS, Vol. 8044). Springer, 869–882. Google ScholarGoogle Scholar
  7. Sam Blackshear and Shuvendu K. Lahiri. 2013. Almost-Correct Specifications: A Modular Semantic Framework for Assigning Confidence to Warnings. In PLDI ’13 (PLDI ’13). ACM, 209–218. Google ScholarGoogle Scholar
  8. Aaron R. Bradley, Zohar Manna, and Henny B. Sipma. 2005. Linear Ranking with Reachability. In CAV ’05 (LNCS, Vol. 3576). Springer, 491–504. Google ScholarGoogle Scholar
  9. Byron Cook, Andreas Podelski, and Andrey Rybalchenko. 2006. Termination proofs for systems code. In PLDI ’06. ACM, 415–426. Google ScholarGoogle Scholar
  10. Patrick Cousot, Radhia Cousot, Manuel Fähndrich, and Francesco Logozzo. 2013. Automatic Inference of Necessary Preconditions. In VMCAI ’13. Springer, 128–148. Google ScholarGoogle Scholar
  11. Ankush Das, Shuvendu K. Lahiri, Akash Lal, and Yi Li. 2015. Angelic Verification: Precise Verification Modulo Unknowns. In CAV ’15. Springer, 324–342. Google ScholarGoogle Scholar
  12. Grigory Fedyukovich, Yueling Zhang, and Aarti Gupta. 2018. Syntax-Guided Termination Analysis. In CAV ’18 (LNCS, Vol. 10981). Springer, 124–143. Google ScholarGoogle Scholar
  13. Juergen Giesl, Cornelius Aschermann, Marc Brockschmidt, Fabian Emmes, Florian Frohn, Carsten Fuhs, Jera Hensel, Carsten Otto, Martin Pluecker, Peter Schneider-Kamp, Thomas Stroeder, Stephanie Swiderski, and Rene Thiemann. 2017. Analyzing Program Termination and Complexity Automatically with AProVE. Journal of Automated Reasoning, 58 (2017), 3–31. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Laure Gonnord, David Monniaux, and Gabriel Radanne. 2015. Synthesis of Ranking Functions Using Extremal Counterexamples. In PLDI ’15. ACM, 608–618. Google ScholarGoogle Scholar
  15. Kodai Hashimoto and Hiroshi Unno. 2015. Refinement Type Inference via Horn Constraint Optimization. In SAS ’15 (LNCS, Vol. 9291). Springer, 199–216. Google ScholarGoogle Scholar
  16. Matthias Heizmann, Jochen Hoenicke, and Andreas Podelski. 2014. Termination Analysis by Learning Terminating Programs. In CAV ’14. Springer, 797–813. Google ScholarGoogle Scholar
  17. Satoshi Kura, Hiroshi Unno, and Ichiro Hasuo. 2021. Decision Tree Learning in CEGIS-Based Termination Analysis. In CAV ’21. Springer, 75–98. Google ScholarGoogle Scholar
  18. Takuya Kuwahara, Tachio Terauchi, Hiroshi Unno, and Naoki Kobayashi. 2014. Automatic Termination Verification for Higher-Order Functional Programs. In ESOP ’14 (LNCS, Vol. 8410). Springer, 392–411. Google ScholarGoogle Scholar
  19. Shuvendu K. Lahiri, Akash Lal, Sridhar Gopinath, Alexander Nutz, Vladimir Levin, Rahul Kumar, Nate Deisinger, Jakob Lichtenberg, and Chetan Bansal. 2020. Angelic Checking within Static Driver Verifier: Towards high-precision defects without (modeling) cost. In FMCAD ’20. IEEE, 169–178. Google ScholarGoogle Scholar
  20. Chin Soon Lee, Neil D. Jones, and Amir M. Ben-Amram. 2001. The size-change principle for program termination. In POPL ’01. ACM, 81–92. Google ScholarGoogle Scholar
  21. Jan Leike and Matthias Heizmann. 2014. Ranking Templates for Linear Loops. In TACAS ’14 (LNCS, Vol. 8413). Springer, 172–186. Google ScholarGoogle Scholar
  22. Saswat Padhi, Rahul Sharma, and Todd D. Millstein. 2016. Data-Driven Precondition Inference with Learned Features. In PLDI ’16. 42–56. Google ScholarGoogle Scholar
  23. Andreas Podelski and Andrey Rybalchenko. 2004. A Complete Method for the Synthesis of Linear Ranking Functions. In VMCAI ’04 (LNCS, Vol. 2937). Springer, 239–251. Google ScholarGoogle Scholar
  24. Sumanth Prabhu, Grigory Fedyukovich, Kumar Madhukar, and Deepak D’Souza. 2021. Specification Synthesis with Constrained Horn Clauses. In PLDI ’21. ACM, 1203–1217. Google ScholarGoogle Scholar
  25. Sriram Sankaranarayanan, Swarat Chaudhuri, Franjo Ivančić, and Aarti Gupta. 2008. Dynamic Inference of Likely Data Preconditions over Predicates by Tree Learning. In ISSTA ’08 (ISSTA ’08). ACM, 295–306. Google ScholarGoogle Scholar
  26. Yuki Satake, Hiroshi Unno, and Hinata Yanagi. 2020. Probabilistic Inference for Predicate Constraint Satisfaction. AAAI ’20, 34, 02 (2020), Apr., 1644–1651. Google ScholarGoogle Scholar
  27. Mohamed Nassim Seghir and Daniel Kroening. 2013. Counterexample-Guided Precondition Inference. In ESOP ’13. Springer, 451–471. Google ScholarGoogle Scholar
  28. Raymond M. Smullyan. 1968. First-order logic. Springer. Google ScholarGoogle Scholar
  29. Armando Solar-Lezama, Liviu Tancau, Rastislav Bodik, Sanjit Seshia, and Vijay Saraswat. 2006. Combinatorial Sketching for Finite Programs. In ASPLOS XII. ACM, 404–415. Google ScholarGoogle Scholar
  30. Saurabh Srivastava and Sumit Gulwani. 2009. Program verification using templates over predicate abstraction. In PLDI ’09. ACM, 223–234. Google ScholarGoogle Scholar
  31. Hiroshi Unno, Tachio Terauchi, and Eric Koskinen. 2021. Constraint-Based Relational Verification. In CAV ’21. Springer, 742–766. Google ScholarGoogle Scholar
  32. Caterina Urban. 2013. The Abstract Domain of Segmented Ranking Functions. In SAS ’13 (LNCS, Vol. 7935). Springer, 43–62. Google ScholarGoogle Scholar
  33. Caterina Urban, Arie Gurfinkel, and Temesghen Kahsai. 2016. Synthesizing Ranking Functions from Bits and Pieces. In TACAS ’16. Springer, 54–70. Google ScholarGoogle Scholar
  34. Caterina Urban and Antoine Miné. 2014. An Abstract Domain to Infer Ordinal-Valued Ranking Functions. In ESOP ’14. Springer, 412–431. Google ScholarGoogle Scholar
  35. Zhe Zhou, Robert Dickerson, Benjamin Delaware, and Suresh Jagannathan. 2021. Data-Driven Abductive Inference of Library Specifications. Proceedings of the ACM on Programming Languages, 5, OOPSLA (2021), Article 116, Oct., 29 pages. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Optimal CHC Solving via Termination Proofs

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Article Metrics

          • Downloads (Last 12 months)144
          • Downloads (Last 6 weeks)18

          Other Metrics

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!