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.
- Aws Albarghouthi, Isil Dillig, and Arie Gurfinkel. 2016. Maximal Specification Synthesis. In POPL ’16. ACM, 789–801.
Google Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- Amir M. Ben-Amram and Samir Genaim. 2017. On Multiphase-Linear Ranking Functions. In CAV ’17. Springer, 601–620.
Google Scholar
- 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 Scholar
- Tewodros A. Beyene, Corneliu Popeea, and Andrey Rybalchenko. 2013. Solving Existentially Quantified Horn Clauses. In CAV ’13 (LNCS, Vol. 8044). Springer, 869–882.
Google Scholar
- 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 Scholar
- Aaron R. Bradley, Zohar Manna, and Henny B. Sipma. 2005. Linear Ranking with Reachability. In CAV ’05 (LNCS, Vol. 3576). Springer, 491–504.
Google Scholar
- Byron Cook, Andreas Podelski, and Andrey Rybalchenko. 2006. Termination proofs for systems code. In PLDI ’06. ACM, 415–426.
Google Scholar
- Patrick Cousot, Radhia Cousot, Manuel Fähndrich, and Francesco Logozzo. 2013. Automatic Inference of Necessary Preconditions. In VMCAI ’13. Springer, 128–148.
Google Scholar
- Ankush Das, Shuvendu K. Lahiri, Akash Lal, and Yi Li. 2015. Angelic Verification: Precise Verification Modulo Unknowns. In CAV ’15. Springer, 324–342.
Google Scholar
- Grigory Fedyukovich, Yueling Zhang, and Aarti Gupta. 2018. Syntax-Guided Termination Analysis. In CAV ’18 (LNCS, Vol. 10981). Springer, 124–143.
Google Scholar
- 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 Scholar
Digital Library
- Laure Gonnord, David Monniaux, and Gabriel Radanne. 2015. Synthesis of Ranking Functions Using Extremal Counterexamples. In PLDI ’15. ACM, 608–618.
Google Scholar
- Kodai Hashimoto and Hiroshi Unno. 2015. Refinement Type Inference via Horn Constraint Optimization. In SAS ’15 (LNCS, Vol. 9291). Springer, 199–216.
Google Scholar
- Matthias Heizmann, Jochen Hoenicke, and Andreas Podelski. 2014. Termination Analysis by Learning Terminating Programs. In CAV ’14. Springer, 797–813.
Google Scholar
- Satoshi Kura, Hiroshi Unno, and Ichiro Hasuo. 2021. Decision Tree Learning in CEGIS-Based Termination Analysis. In CAV ’21. Springer, 75–98.
Google Scholar
- 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 Scholar
- 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 Scholar
- 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 Scholar
- Jan Leike and Matthias Heizmann. 2014. Ranking Templates for Linear Loops. In TACAS ’14 (LNCS, Vol. 8413). Springer, 172–186.
Google Scholar
- Saswat Padhi, Rahul Sharma, and Todd D. Millstein. 2016. Data-Driven Precondition Inference with Learned Features. In PLDI ’16. 42–56.
Google Scholar
- 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 Scholar
- Sumanth Prabhu, Grigory Fedyukovich, Kumar Madhukar, and Deepak D’Souza. 2021. Specification Synthesis with Constrained Horn Clauses. In PLDI ’21. ACM, 1203–1217.
Google Scholar
- 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 Scholar
- Yuki Satake, Hiroshi Unno, and Hinata Yanagi. 2020. Probabilistic Inference for Predicate Constraint Satisfaction. AAAI ’20, 34, 02 (2020), Apr., 1644–1651.
Google Scholar
- Mohamed Nassim Seghir and Daniel Kroening. 2013. Counterexample-Guided Precondition Inference. In ESOP ’13. Springer, 451–471.
Google Scholar
- Raymond M. Smullyan. 1968. First-order logic. Springer.
Google Scholar
- 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 Scholar
- Saurabh Srivastava and Sumit Gulwani. 2009. Program verification using templates over predicate abstraction. In PLDI ’09. ACM, 223–234.
Google Scholar
- Hiroshi Unno, Tachio Terauchi, and Eric Koskinen. 2021. Constraint-Based Relational Verification. In CAV ’21. Springer, 742–766.
Google Scholar
- Caterina Urban. 2013. The Abstract Domain of Segmented Ranking Functions. In SAS ’13 (LNCS, Vol. 7935). Springer, 43–62.
Google Scholar
- Caterina Urban, Arie Gurfinkel, and Temesghen Kahsai. 2016. Synthesizing Ranking Functions from Bits and Pieces. In TACAS ’16. Springer, 54–70.
Google Scholar
- Caterina Urban and Antoine Miné. 2014. An Abstract Domain to Infer Ordinal-Valued Ranking Functions. In ESOP ’14. Springer, 412–431.
Google Scholar
- 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 Scholar
Digital Library
Index Terms
Optimal CHC Solving via Termination Proofs
Recommendations
Automated termination proofs for logic programs by term rewriting
There are two kinds of approaches for termination analysis of logic programs: “transformational” and “direct” ones. Direct approaches prove termination directly on the basis of the logic program. Transformational approaches transform a logic program ...
Automated termination proofs for haskell by term rewriting
There are many powerful techniques for automated termination analysis of term rewriting. However, up to now they have hardly been used for real programming languages. We present a new approach which permits the application of existing techniques from ...
Termination prediction for general logic programs
We present a heuristic framework for attacking the undecidable termination problem of logic programs, as an alternative to current termination/nontermination proof approaches. We introduce an idea of termination prediction, which predicts termination of ...






Comments