Abstract
AbstractWe address the problem of verifying that the functions of a program meet their contracts, specified by pre/postconditions. We follow an approach based on constrained Horn clauses (CHCs) by which the verification problem is reduced to the problem of checking satisfiability of a set of clauses derived from the given program and contracts. We consider programs that manipulate algebraic data types (ADTs) and a class of contracts specified by catamorphisms, that is, functions defined by simple recursion schemata on the given ADTs. We show by several examples that state-of-the-art CHC satisfiability tools are not effective at solving the satisfiability problems obtained by direct translation of the contracts into CHCs. To overcome this difficulty, we propose a transformation technique that removes the ADT terms from CHCs and derives new sets of clauses that work on basic sorts only, such as integers and booleans. Thus, when using the derived CHCs there is no need for induction rules on ADTs. We prove that the transformation is sound, that is, if the derived set of CHCs is satisfiable, then so is the original set. We also prove that the transformation always terminates for the class of contracts specified by catamorphisms. Finally, we present the experimental results obtained by an implementation of our technique when verifying many non-trivial contracts for ADT manipulating programs.
Publisher
Cambridge University Press (CUP)
Subject
Artificial Intelligence,Computational Theory and Mathematics,Hardware and Architecture,Theoretical Computer Science,Software
Reference40 articles.
1. Reynolds, A. and Kuncak, V. 2015. Induction for SMT solvers. In 16th VMCAI. LNCS, vol. 8931. Springer, 80–98.
2. Mordvinov, D. and Fedyukovich, G. 2017. Synchronizing constrained Horn clauses. In LPAR-21. EPiC Series in Computing, vol. 46. EasyChair, 338–355.
3. Cousot, P. and Halbwachs, N. 1978. Automatic discovery of linear restraints among variables of a program. In 5th POPL. ACM, 84–96.
4. Reasoning About Algebraic Data Types with Abstractions
5. Satisfiability of constrained Horn clauses on algebraic data types: A transformation-based approach
Cited by
6 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. A Historical Perspective on Program Transformation and Recent Developments (Invited Contribution);Proceedings of the 2024 ACM SIGPLAN International Workshop on Partial Evaluation and Program Manipulation;2024-01-11
2. Proceedings 39th International Conference on Logic Programming;Electronic Proceedings in Theoretical Computer Science;2023-09-12
3. Multiple Query Satisfiability of Constrained Horn Clauses;Practical Aspects of Declarative Languages;2023
4. A Rule-Based Approach for Designing and Composing Abstract Domains;Logic-Based Program Synthesis and Transformation;2023
5. Constrained Horn Clauses Satisfiability via Catamorphic Abstractions;Logic-Based Program Synthesis and Transformation;2023