Abstract
We present an approach to synthesize relational invariants to prove equivalences between object-oriented programs. The approach bridges the gap between recursive data types and arrays that serve to represent internal states. Our relational invariants are recursively-defined, and thus are valid for data structures of unbounded size. Based on introducing recursion into the proofs by observing and lifting the constraints from joint methods of the two objects, our approach is fully automatic and can be seen as an algorithm for solving Constrained Horn Clauses (CHC) of a specific sort. It has been implemented on top of the SMT-based CHC solver AdtChc and evaluated on a range of benchmarks.
Download conference paper PDF
References
J.-R. Abrial. Modeling in Event-B: System and Software engineering. Cambridge University Press, 2010.
R. Alur, R. Bodík, G. Juniwal, M. M. K. Martin, M. Raghothaman, S. A. Seshia, R. Singh, A. Solar-Lezama, E. Torlak, and A. Udupa. Syntax-Guided Synthesis. In FMCAD, pages 1–17. IEEE, 2013.
S. Amani, A. Hixon, Z. Chen, C. Rizkallah, P. Chubb, L. O’Connor, J. Beeren, Y. Nagashima, J. Lim, T. Sewell, J. Tuong, G. Keller, T. Murray, G. Klein, and G. Heiserer. Cogent: Verifying high-assurance file system implementations. In ASPLOS, pages 175–188. ACM, 2016.
R.-J. Back and J. Wright. Refinement calculus: a systematic introduction. Springer Science & Business Media, 2012.
G. Barthe, J. M. Crespo, and C. Kunz. Relational verification using product programs. In FM, volume 6664 of LNCS, pages 200–214. Springer, 2011.
C. Baumann, B. Beckert, H. Blasum, and T. Bormer. Lessons learned from microkernel verification–specification is the new bottleneck. In SSV, volume 102 of EPTCS, pages 18–32. Elsevier, 2012.
D. Beyer and M. E. Keremoglu. CPAchecker: A Tool for Configurable Software Verification. In CAV, volume 6806 of LNCS, pages 184–190. Springer, 2011.
E. Börger. The ASM refinement method. Formal Aspects of Computing, 15(2-3):237–257, 2003.
A. Champion, N. Kobayashi, and R. Sato. HoIce: An ICE-Based Non-linear Horn Clause Solver. In APLAS, volume 11275 of LNCS, pages 146–156. Springer, 2018.
H. Chen, D. Ziegler, A. Chlipala, N. Zeldovich, and M. F. Kaashoek. Using Crash Hoare Logic for certifying the FSCQ file system. In SOSP. ACM, 2015.
N. Chong, B. Cook, K. Kallas, K. Khazem, F. R. Monteiro, D. Schwartz-Narbonne, S. Tasiran, M. Tautschnig, and M. R. Tuttle. Code-level model checking in the software development workflow. In G. Rothermel and D. Bae, editors, ICSE-SEIP, pages 11–20. ACM, 2020.
A. Chudnov, N. Collins, B. Cook, J. Dodds, B. Huffman, C. MacCárthaigh, S. Magill, E. Mertens, E. Mullen, S. Tasiran, et al. Continuous formal verification of Amazon s2n. In CAV, pages 430–446. Springer, 2018.
C. L. Conway and C. W. Barrett. Verifying low-level implementations of high-level datatypes. In CAV, volume 6174 of LNCS, pages 306–320. Springer, 2010.
E. De Angelis, F. Fioravanti, A. Pettorossi, and M. Proietti. Solving Horn Clauses on Inductive Data Types Without Induction. TPLP, 18(3-4):452–469, 2018.
W.-P. de Roever and K. Engelhardt. Data refinement: Model-oriented proof methods and their comparison. Cambridge University Press, 1998.
E. W. Dijkstra. A constructive approach to the problem of program correctness. BIT Numerical Mathematics, 8(3):174–186, 1968.
G. Ernst, J. Pfähler, G. Schellhorn, D. Haneberg, and W. Reif. KIV: Overview and VerifyThis competition. Software Tools for Technology Transfer (STTT), 17(6):677–694, 2015.
G. Fedyukovich, A. Gurfinkel, and N. Sharygina. Automated discovery of simulation between programs. In LPAR, volume 9450 of LNCS, pages 606–621. Springer, 2015.
G. Fedyukovich, S. Kaufman, and R. Bodík. Sampling Invariants from Frequency Distributions. In FMCAD, pages 100–107. IEEE, 2017.
G. Fedyukovich, S. Prabhu, K. Madhukar, and A. Gupta. Solving Constrained Horn Clauses Using Syntax and Data. In FMCAD, pages 170–178. IEEE, 2018.
G. Fedyukovich, S. Prabhu, K. Madhukar, and A. Gupta. Quantified Invariants via Syntax-Guided Synthesis. In CAV, Part I, volume 11561 of LNCS, pages 259–277. Springer, 2019.
D. Felsing, S. Grebing, V. Klebanov, P. Rümmer, and M. Ulbrich. Automating regression verification. In ASE, pages 349–360. ACM, 2014.
B. Godlin and O. Strichman. Inference rules for proving the equivalence of recursive procedures. Acta Informatica, 45(6):403–439, 2008.
A. Gurfinkel, T. Kahsai, A. Komuravelli, and J. A. Navas. The SeaHorn Verification Framework. In CAV, volume 9206 of LNCS, pages 343–361. Springer, 2015.
J. He, C. A. R. Hoare, and J. W. Sanders. Data refinement refined. In ESOP, pages 187–196. Springer, 1986.
C. A. R. Hoare. Unified theories of programming. In Mathematical methods in program development, pages 313–367. Springer, 1997.
H. Hojjat and P. Rümmer. The ELDARICA Horn Solver. In FMCAD, pages 158–164. IEEE, 2018.
J. P. Inala, N. Polikarpova, X. Qiu, B. S. Lerner, and A. Solar-Lezama. Synthesis of recursive ADT transformations from reusable templates. In TACAS, Part I, volume 10205 of LNCS, pages 247–263, 2017.
C. B. Jones. Systematic software development using VDM, volume 2. Prentice Hall Englewood Cliffs, 1990.
G. Klein, J. Andronick, K. Elphinstone, G. Heiser, D. Cock, P. Derrin, D. Elkaduwe, K. Engelhardt, R. Kolanski, M. Norrish, T. Sewell, H. Tuch, and S. Winwood. seL4: Formal verification of an operating-system kernel. Communications of the ACM, 53(6):107–115, 2010.
E. Kneuss, I. Kuraj, V. Kuncak, and P. Suter. Synthesis modulo recursive functions. In OOPSLA, pages 407–426, 2013.
A. Komuravelli, A. Gurfinkel, and S. Chaki. SMT-Based Model Checking for Recursive Programs. In CAV, volume 8559 of LNCS, pages 17–34, 2014.
L. Lamport. Specifying systems: the \(TLA^+\) language and tools for hardware and software engineers. Addison-Wesley, 2002.
K. R. M. Leino and A. Milicevic. Program extrapolation with Jennisys. In OOPSLA, pages 411–430, 2012.
X. Leroy. Formal verification of a realistic compiler. Communications of the ACM, 52(7):107–115, 2009.
B. H. Liskov and J. M. Wing. A behavioral notion of subtyping. Transactions on Programming Languages and Systems, 16(6):1811–1841, 1994.
R. Milner. An algebraic definition of simulation between programs. In IJCAI, pages 481–489, 1971.
A. Miltner, S. Padhi, T. Millstein, and D. Walker. Data-driven inference of representation invariants. In PLDI, pages 1–15, 2020.
D. Mordvinov and G. Fedyukovich. Property Directed Inference of Relational Invariants. In FMCAD, pages 152–160. IEEE, 2019.
L. D. Moura and N. Bjørner. Z3: An efficient SMT solver. In TACAS, volume 4963 of LNCS, pages 337–340. Springer, 2008.
K. S. Namjoshi and L. D. Zuck. Witnessing program transformations. In SAS, volume 7935 of LNCS, pages 304–323. Springer, 2013.
L. Nelson, H. Sigurbjarnarson, K. Zhang, D. Johnson, J. Bornholt, E. Torlak, and X. Wang. Hyperkernel: Push-button verification of an OS kernel. In OSDI, pages 252–269, 2017.
P. W. O’Hearn. Continuous reasoning: scaling the impact of formal methods. In LICS, pages 13–25. ACM, 2018.
L. Pick, G. Fedyukovich, and A. Gupta. Exploiting Synchrony and Symmetry in Relational Verification. In CAV, Part I, volume 10981 of LNCS, pages 164–182. Springer, 2018.
M.-L. Potet and Y. Rouzaud. Composition and refinement in the B-method. In Proc. of the B Conference, volume 1393 of LNCS, pages 46–65. Springer, 1998.
A. Reynolds, H. Barbosa, A. Nötzli, C. W. Barrett, and C. Tinelli. cvc4sy: Smart and Fast Term Enumeration for Syntax-Guided Synthesis. In CAV, Part II, volume 11562 of LNCS, pages 74–83. Springer, 2019.
A. Reynolds and V. Kuncak. Induction for SMT solvers. In VMCAI, volume 8931 of LNCS, pages 80–98. Springer, 2015.
G. Schellhorn, G. Ernst, J. Pfähler, D. Haneberg, and W. Reif. Development of a verified Flash file system. In ABZ, volume 8477 of LNCS, pages 9–24. Springer, 2014. Invited Paper.
R. Sharma, E. Schkufza, B. R. Churchill, and A. Aiken. Data-driven Equivalence Checking. In OOPSLA, pages 391–406. ACM, 2013.
H. Sigurbjarnarson, J. Bornholt, E. Torlak, and X. Wang. Push-button verification of file systems via crash refinement. In OSDI, pages 1–16, 2016.
O. Strichman and M. Veitsman. Regression verification for unbalanced recursive functions. In FM, pages 645–658. Springer, 2016.
P. Suter, M. Dotta, and V. Kuncak. Decision procedures for algebraic data types with abstractions. SIGPLAN notices, 45(1):199–210, 2010.
H. Unno, S. Torii, and H. Sakamoto. Automating Induction for Solving Horn Clauses. In CAV, volume 10427 of LNCS, pages 571–591. Springer, 2017.
N. Wirth. Program development by stepwise refinement. Communications of the ACM, 14(4):221–227, 1971.
W. Yang, G. Fedyukovich, and A. Gupta. Lemma Synthesis for Automating Induction over Algebraic Data Types. In CP, volume 11802 of LNCS, pages 600–617. Springer, 2019.
A. Zaostrovnykh, S. Pirelli, R. Iyer, M. Rizzo, L. Pedrosa, K. Argyraki, and G. Candea. Verifying software network functions with no verification expertise. In OSDI, pages 275–290, 2019.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.
The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.
Copyright information
© 2021 The Author(s)
About this paper
Cite this paper
Fedyukovich, G., Ernst, G. (2021). Bridging Arrays and ADTs in Recursive Proofs. In: Groote, J.F., Larsen, K.G. (eds) Tools and Algorithms for the Construction and Analysis of Systems. TACAS 2021. Lecture Notes in Computer Science(), vol 12652. Springer, Cham. https://doi.org/10.1007/978-3-030-72013-1_2
Download citation
DOI: https://doi.org/10.1007/978-3-030-72013-1_2
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-72012-4
Online ISBN: 978-3-030-72013-1
eBook Packages: Computer ScienceComputer Science (R0)
-
Published in cooperation with
http://www.etaps.org/