Skip to main content
Log in

CHC-Based Verification of Programs Through Graph Decompositions

  • Original Research
  • Published:
SN Computer Science Aims and scope Submit manuscript

Abstract

We present a novel methodology for automated program analysis that leverages graph encodings of computations. The crux of our approach lies in restructuring the program behavior graphs through tree decompositions of bounded width. To achieve this, we introduce a notion of labeled multigraph, called nested-word shape, that is used as a summary for portions of program behavior graphs. Such multigraphs are used within the construction of a symbolic data-tree automaton (sdta), a recently introduced notion of automaton designed to accept tree data structures. We use sdtas to capture the tree decompositions of the program behavior graphs of a given program. Verification of the original program is then accomplished by checking the emptiness of the data-tree language accepted by these sdtas, which can be effectively reduced to the satisfiability of constrained Horn clauses (CHC). Our approach results in an under-approximate analysis parameterized by the width k of the tree decomposition used for the analysis, and thus provides a complete method for the classes of programs whose behavior graphs have bounded treewidth. We detail our methodology for recursive sequential programs, which enjoy the bounded treewidth property, and subsequently extend it to concurrent programs. Notably, our approach shows promise across an even broader spectrum of program classes, including distributed systems and concurrent programs operating under weak memory models.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8
Fig. 9

Similar content being viewed by others

Data Availability

Not applicable.

Notes

  1. We assume that there are no unmatched calls and returns, differently from [1].

References

  1. Alur R, Madhusudan P. Adding nesting structure to words. In: Ibarra, OH, Dang Z, editors. Developments in language theory, 10th international conference, DLT 2006, Santa Barbara, CA, USA, June 26–29, 2006. Proceedings, vol. 4036. Lecture notes in computer science. Springer; 2006. pp. 1–13. https://doi.org/10.1007/11779148_1 .

  2. Madhusudan P, Parlato G. The tree width of auxiliary storage. In: Ball T, Sagiv M, editors. Proceedings of the 38th ACM SIGPLAN-SIGACT symposium on principles of programming languages, POPL 2011, Austin, TX, USA, 26–28, 2011. ACM; 2011. pp. 283–294. https://doi.org/10.1145/1926385.1926419.

  3. Faella M, Parlato G. Reasoning about data trees using CHCs. In: Shoham S, Vizel Y, editors. Computer aided verification—34th international conference, CAV 2022, Haifa, Israel, August 7–10, 2022, proceedings, part II, vol. 13372. Lecture notes in computer science. Springer; 2022. pp. 249–271. https://doi.org/10.1007/978-3-031-13188-2_13.

  4. Grebenshchikov S, Lopes NP, Popeea C, Rybalchenko A. Synthesizing software verifiers from proof rules. In: Vitek J, Lin H, Tip F, editors. ACM SIGPLAN conference on programming language design and implementation, PLDI ’12, Beijing, China—June 11–16, 2012. ACM; 2012. pp. 405–416. https://doi.org/10.1145/2254064.2254112.

  5. Gurfinkel A, Bjørner N. The science, art, and magic of constrained Horn clauses. In: 21st International symposium on symbolic and numeric algorithms for scientific computing, SYNASC 2019, Timisoara, Romania, September 4–7 , 2019. IEEE; 2019. pp. 6–10. https://doi.org/10.1109/SYNASC49474.2019.00010.

  6. Bjørner N, Gurfinkel A, McMillan KL, Rybalchenko A. Horn clause solvers for program verification. In: Beklemishev LD, Blass A, Dershowitz N, Finkbeiner B, Schulte W, editors. Fields of logic and computation II—Essays dedicated to Yuri Gurevich on the occasion of his 75th birthday, vol. 9300. Lecture notes in computer science. Springer; 2015. pp. 24–51. https://doi.org/10.1007/978-3-319-23534-9_2.

  7. Champion A, Chiba T, Kobayashi N, Sato R. Ice-based refinement type discovery for higher-order functional programs. J Autom Reason. 2020;64(7):1393–418. https://doi.org/10.1007/s10817-020-09571-y.

    Article  MathSciNet  Google Scholar 

  8. Fedyukovich G, Ahmad MBS, Bodík R. Gradual synthesis for static parallelization of single-pass array-processing programs. In: Cohen A, Vechev MT, editors. Proceedings of the 38th ACM SIGPLAN conference on programming language design and implementation, PLDI 2017, Barcelona, Spain, June 18–23, 2017. ACM; pp. 572–585. https://doi.org/10.1145/3062341.3062382.

  9. Garoche P, Kahsai T, Thirioux X. Hierarchical state machines as modular Horn clauses. In: Gallagher JP, Rümmer P, editors. Proceedings 3rd workshop on horn clauses for verification and synthesis, HCVS@ETAPS 2016, vol. 219. Eindhoven, The Netherlands, 3rd April 2016. EPTCS; 2016. pp. 15–28. https://doi.org/10.4204/EPTCS.219.2.

  10. Gurfinkel A, Kahsai T, Komuravelli A, Navas JA. The seahorn verification framework. In: Kroening D, Pasareanu CS, editors. Computer aided verification—27th international conference, CAV 2015, San Francisco, CA, USA, July 18–24, 2015, proceedings, part I, vol. 9206. Lecture notes in computer science. Springer; 2015. pp. 343–361. https://doi.org/10.1007/978-3-319-21690-4_20.

  11. Hojjat H, Konecný F, Garnier F, Iosif R, Kuncak V, Rümmer P. A verification toolkit for numerical transition systems—tool paper. In: Giannakopoulou D, Méry D, editors. FM 2012: Formal methods—18th international symposium, Paris, France, August 27–31, 2012. Proceedings, vol. 7436. Lecture notes in computer science. Springer; 2012. pp. 247–251. https://doi.org/10.1007/978-3-642-32759-9_21.

  12. Kahsai T, Rümmer P, Sanchez H, Schäf M. Jayhorn: a framework for verifying java programs. In: Chaudhuri S, Farzan A, editors. Computer aided verification—28th international conference, CAV 2016, Toronto, ON, Canada, July 17–23, 2016, proceedings, part I, vol. 9779. Lecture notes in computer science. Springer; 2016. pp. 352–358. https://doi.org/10.1007/978-3-319-41528-4_19.

  13. Kobayashi N, Sato R, Unno H. Predicate abstraction and CEGAR for higher-order model checking. In: Hall MW, Padua DA, editors. Proceedings of the 32nd ACM SIGPLAN conference on programming language design and implementation, PLDI 2011, San Jose, CA, USA, June 4–8. ACM; 2011. pp. 222–233. https://doi.org/10.1145/1993498.1993525.

  14. Matsushita Y, Tsukada T, Kobayashi N. RustHorn: CHC-based verification for rust programs. In: Müller P, editor. Programming languages and systems—29th European symposium on programming, ESOP 2020, held as part of the European joint conferences on theory and practice of software, ETAPS 2020, Dublin, Ireland, April 25–30, 2020. Proceedings, vol. 2075. Lecture notes in computer science. Springer; 2020. pp. 484–514. https://doi.org/10.1007/978-3-030-44914-8_18.

  15. De Angelis E, K, HGV. CHC-COMP 2022: competition report. In: Hamilton GW, Kahsai T, Proietti M, editors. Proceedings 9th workshop on horn clauses for verification and synthesis and 10th international workshop on verification and program transformation, HCVS/VPT@ETAPS 2022, and 10th international workshop on verification and program transformation, Munich, Germany, 3rd April 2022. EPTCS; 2022. pp. 373:44–62. https://doi.org/10.4204/EPTCS.373.5.

  16. Inverso O, La Torre S, Parlato G, Tomasco E. Verifying programs by bounded tree-width behavior graphs. In: Malvone V, Murano A, editors. Multi-agent systems—20th European conference, EUMAS 2023, Naples, Italy, September 14–15, 2023. Proceedings, vol. 14282. Lecture notes in computer science. Springer; 2023. pp. 116–132. https://doi.org/10.1007/978-3-031-43264-4_8.

  17. Manna Z, Zarba CG. Combining decision procedures. In: Formal methods at the crossroads. From Panacea to Foundational Support, 10th anniversary colloquium of UNU/IIST, The International Institute for Software Technology of The United Nations University, Lisbon, Portugal, March 18–20, 2002, revised papers, vol. 2757. LNCS. Springer; 2002. pp. 381–422.

  18. Lamport L. How to make a multiprocessor computer that correctly executes multiprocess programs. IEEE Trans Comput. 1979;28(9):690–1. https://doi.org/10.1109/TC.1979.1675439.

    Article  Google Scholar 

  19. La Torre S, Madhusudan P, Parlato G. A robust class of context-sensitive languages. In: 22nd IEEE symposium on logic in computer science (LICS 2007), 10–12 July 2007, Wroclaw, Poland, proceedings. IEEE Computer Society; 2007. pp. 161–170. https://doi.org/10.1109/LICS.2007.9.

  20. Atig MF, Bollig B, Habermehl P. Emptiness of ordered multi-pushdown automata is 2etime-complete. Int J Found Comput Sci. 2017;28(8):945–76. https://doi.org/10.1142/S0129054117500332.

    Article  MathSciNet  Google Scholar 

  21. Qadeer S, Wu D. KISS: keep it simple and sequential. In: Pugh WW, Chambers C, editors. Proceedings of the ACM SIGPLAN 2004 conference on programming language design and implementation 2004, Washington, DC, USA, June 9–11, 2004. ACM; 2004. pp. 14–24. https://doi.org/10.1145/996841.996845.

  22. Lal A, Reps TW. Reducing concurrent analysis under a context bound to sequential analysis. Formal Methods Syst Des. 2009;35(1):73–97. https://doi.org/10.1007/S10703-009-0078-9.

    Article  Google Scholar 

  23. La Torre S, Madhusudan P, Parlato G. Reducing context-bounded concurrent reachability to sequential reachability. In: Bouajjani A, Maler O, editors. Computer aided verification, 21st international conference, CAV 2009, Grenoble, France, June 26–July 2, 2009. Proceedings, vol. 5643. Lecture notes in computer science. Springer; 2009. pp. 477–492. https://doi.org/10.1007/978-3-642-02658-4_36.

  24. Emmi M, Qadeer S, Rakamaric Z. Delay-bounded scheduling. In: Ball T, Sagiv M, editors. Proceedings of the 38th ACM SIGPLAN-SIGACT symposium on principles of programming languages, POPL 2011, Austin, TX, USA, January 26–28, 2011. ACM; 2011. pp. 411–422. https://doi.org/10.1145/1926385.1926432.

  25. La Torre S, Napoli M. Reachability of multistack pushdown systems with scope-bounded matching relations. In: Katoen J, König B, editors. CONCUR 2011—concurrency theory—22nd international conference, CONCUR 2011, Aachen, Germany, September 6–9, 2011. Proceedings, vol. 6901. Lecture notes in computer science. Springer; 2011. pp. 203–218. https://doi.org/10.1007/978-3-642-23217-6_14.

  26. La Torre S, Parlato G. Scope-bounded multistack pushdown systems: fixed-point, sequentialization, and tree-width. In: D’Souza D, Kavitha T, Radhakrishnan J, editors. IARCS annual conference on foundations of software technology and theoretical computer science, FSTTCS 2012, December 15–17, 2012, Hyderabad, India, vol. 18. LIPIcs. Schloss Dagstuhl - Leibniz-Zentrum für Informatik; 2012. pp. 173–184. https://doi.org/10.4230/LIPICS.FSTTCS.2012.173.

  27. La Torre S, Napoli M, Parlato G. Scope-bounded pushdown languages. Int J Found Comput Sci. 2016;27(2):215–34. https://doi.org/10.1142/S0129054116400074.

    Article  MathSciNet  Google Scholar 

  28. La Torre S, Napoli M, Parlato G. Reachability of scope-bounded multistack pushdown systems. Inf Comput. 2020;275: 104588. https://doi.org/10.1016/J.IC.2020.104588.

    Article  MathSciNet  Google Scholar 

  29. Bouajjani A, Emmi M, Parlato G. On sequentializing concurrent programs. In: Yahav E, editor. Static analysis—18th international symposium, SAS 2011, Venice, Italy, September 14–16, 2011. Proceedings, vol. 6887. Lecture notes in computer science. Springer; 2011. pp. 129–145. https://doi.org/10.1007/978-3-642-23702-7_13.

  30. Flum J, Grohe M. Parameterized complexity theory. Texts in theoretical computer science. An EATCS series. Berlin: Springer; 2006. https://doi.org/10.1007/3-540-29953-X.

    Book  Google Scholar 

  31. Musuvathi M, Qadeer S. Iterative context bounding for systematic testing of multithreaded programs. In: Ferrante J, McKinley KS, editors. Proceedings of the ACM SIGPLAN 2007 conference on programming language design and implementation, San Diego, California, USA, June 10–13, 2007. ACM; 2007. pp. 446–455. https://doi.org/10.1145/1250734.1250785.

  32. Qadeer S, Rehof J. Context-bounded model checking of concurrent software. In: Halbwachs N, Zuck LD, editors. Tools and algorithms for the construction and analysis of systems, 11th international conference, TACAS 2005, held as part of the joint European conferences on theory and practice of software, ETAPS 2005, Edinburgh, UK, April 4–8, 2005. Proceedings, vol. 3440. Lecture notes in computer science. Springer; 2005. pp. 93–107. Springer. https://doi.org/10.1007/978-3-540-31980-1_7.

  33. Inverso O, Tomasco E, Fischer B, La Torre S, Parlato G. Bounded verification of multi-threaded programs via lazy sequentialization. ACM Trans Program Lang Syst. 2022;44(1):1–1150. https://doi.org/10.1145/3478536.

    Article  Google Scholar 

  34. La Torre S, Napoli M, Parlato G. A unifying approach for multistack pushdown automata. In: Csuhaj-Varjú E, Dietzfelbinger M, Ésik Z, editors. Mathematical foundations of computer science 2014—39th international symposium, MFCS 2014, Budapest, Hungary, August 25–29, 2014. Proceedings, part I, vol. 8634. Lecture notes in computer science. Springer; 2014. pp. 377–389. https://doi.org/10.1007/978-3-662-44522-8_32.

  35. Tomasco E, Inverso O, Fischer B, La Torre S, Parlato G. Verifying concurrent programs by memory unwinding. In: Baier C, Tinelli C, editors. Tools and algorithms for the construction and analysis of systems—21st international conference, TACAS 2015, held as part of the European joint conferences on theory and practice of software, ETAPS 2015, London, UK, April 11–18, 2015. Proceedings, vol. 9035. Lecture notes in computer science. Springer; 2015. pp. 551–565. https://doi.org/10.1007/978-3-662-46681-0_52 .

  36. Enea C, Habermehl P, Inverso O, Parlato G. On the path-width of integer linear programming. In: Peron A, Piazza C, editors. Proceedings fifth international symposium on games, automata, logics and formal verification, GandALF 2014, Verona, Italy, September 10–12, 2014, vol. 161. EPTCS; 2014. pp. 74–87. https://doi.org/10.4204/EPTCS.161.9.

  37. Enea C, Habermehl P, Inverso O, Parlato G. On the path-width of integer linear programming. Inf Comput. 2017;253:257–71. https://doi.org/10.1016/j.ic.2016.07.010.

    Article  MathSciNet  Google Scholar 

  38. Courcelle B. The monadic second-order logic of graphs. I. Recognizable sets of finite graphs. Inf Comput. 1990;85(1):12–75. https://doi.org/10.1016/0890-5401(90)90043-H.

    Article  MathSciNet  Google Scholar 

  39. Seese D. The structure of models of decidable monadic theories of graphs. Ann Pure Appl Log. 1991;53(2):169–95. https://doi.org/10.1016/0168-0072(91)90054-P.

    Article  MathSciNet  Google Scholar 

  40. Gurfinkel A. Program verification with constrained Horn clauses (invited paper). In: Shoham S, Vizel Y, editors. Computer aided verification—34th international conference, CAV 2022, Haifa, Israel, August 7–10, 2022. Proceedings, part I, vol. 1337. Lecture notes in computer science. Springer; 2022. pp. 19–29. https://doi.org/10.1007/978-3-031-13185-1_2.

  41. La Torre S, Madhusudan P, Parlato G. Analyzing recursive programs using a fixed-point calculus. In: Hind M, Diwan A, editors. Proceedings of the 2009 ACM SIGPLAN conference on programming language design and implementation, PLDI 2009, Dublin, Ireland, June 15–21, 2009. ACM; 2009. pp. 211–222. https://doi.org/10.1145/1542476.1542500.

  42. Moura LM, Bjørner N. Z3: an efficient SMT solver. In: Ramakrishnan CR, Rehof J, editors. Tools and algorithms for the construction and analysis of systems, 14th international conference, TACAS 2008, held as part of the joint European conferences on theory and practice of software, ETAPS 2008, Budapest, Hungary, March 29–April 6, 2008. Proceedings, vol. 4963. Lecture notes in computer science. Springer; 2008. pp. 337–340. https://doi.org/10.1007/978-3-540-78800-3_24.

  43. Blicha M, Britikov K, Sharygina N. The Golem Horn solver. In: Enea C, Lal A, editors. Computer aided verification—35th international conference, CAV 2023, Paris, France, July 17–22, 2023. Proceedings, part II, vol. 13965. Lecture notes in computer science. Springer; 2023. pp. 209–223. https://doi.org/10.1007/978-3-031-37703-7_10.

  44. Hojjat H, Rümmer P. The ELDARICA Horn solver. In: Bjørner NS, Gurfinkel A, editors. 2018 Formal methods in computer aided design, FMCAD 2018, Austin, TX, USA, October 30–November 2, 2018. IEEE; 2018. pp. 1–7. https://doi.org/10.23919/FMCAD.2018.8603013.

  45. Henn T, Völker M, Kowalewski S, Trinh M, Petrovic O, Brecher C. Verification of behavior trees using linear constrained horn clauses. In: Groote JF, Huisman M, editors. Formal methods for industrial critical systems—27th international conference, FMICS 2022, Warsaw, Poland, 2022, 14–15. Proceedings, vol. 13487. Lecture notes in computer science. Springer; 2022. pp. 211–225. https://doi.org/10.1007/978-3-031-15008-1_14.

  46. Faella M, Parlato G. Reachability games modulo theories with a bounded safety player. In: Williams B, Chen Y, Neville J, editors. Thirty-seventh AAAI conference on artificial intelligence, AAAI 2023, thirty-fifth conference on innovative applications of artificial intelligence, IAAI 2023, thirteenth symposium on educational advances in artificial intelligence, EAAI 2023, Washington, DC, USA, February 7–14, 2023. AAAI Press; 2023. pp. 6330–6337. https://doi.org/10.1609/AAAI.V37I5.25779.

  47. Tomasco E, Nguyen TL, Inverso O, Fischer B, La Torre S, Parlato G. Lazy sequentialization for TSO and PSO via shared memory abstractions. In: Piskac R, Talupur M, editors. 2016 Formal methods in computer-aided design, FMCAD 2016, Mountain View, CA, USA, October 3–6, 2016. IEEE; 2016. pp. 193–200. https://doi.org/10.1109/FMCAD.2016.7886679.

  48. Tomasco E, Nguyen TL, Fischer B, La Torre S, Parlato G. Using shared memory abstractions to design eager sequentializations for weak memory models. In: Cimatti A, Sirjani M, editors. Software engineering and formal methods—15th international conference, SEFM 2017, Trento, Italy, September 4–8, 2017. Proceedings, vol. 10469. Lecture notes in computer science. Springer; 2017. pp. 185–202. Springer https://doi.org/10.1007/978-3-319-66197-1_12.

  49. Komuravelli A, Bjørner NS, Gurfinkel A, McMillan KL. Compositional verification of procedural programs using horn clauses over integers and arrays. In: Kaivola R, Wahl T, editors. Formal methods in computer-aided design, FMCAD 2015, Austin, Texas, USA, September 27–30. IEEE; 2015. pp. 89–96. https://doi.org/10.1109/FMCAD.2015.7542257.

  50. De Angelis E, Fioravanti F, Pettorossi A, Proietti M. Program verification using constraint handling rules and array constraint generalizations. Fundam Inform. 2017;150(1):73–117. https://doi.org/10.3233/FI-2017-1461.

    Article  MathSciNet  Google Scholar 

  51. Faella M, Parlato G. A unified automata-theoretic approach to LTLf modulo theories. In: ECAI 2024—27th European conference on artificial intelligence, October 19–24, 2024. Santiago de Compostela, Spain. Frontiers in artificial intelligence and applications. IOS Press; 2024.

Download references

Funding

This work was partially supported by INDAM-GNCS 2022–24, AWS 2021 Amazon Research Awards, the MUR project SOP (Securing sOftware Platforms - CUP: H73C22000890001) as part of the SERICS project (Security and Rights in CyberSpace - n. PE00000014 - CUP: B43C22000750006), Verifica di proprietà di sicurezza nello sviluppo del software under the Start-up 2022 program funded by the Computer Science Division UNIMOL, the MUR project Future AI Research (FAIR) Spoke 3, and FARB 2022–24 grants of Università degli Studi di Salerno.

Author information

Authors and Affiliations

Authors

Contributions

All the authors contributed equally to this work.

Corresponding author

Correspondence to Gennaro Parlato.

Ethics declarations

Conflict of interest

On behalf of all authors, the corresponding author states that there is no conflict of interest.

Research involving human and /or animals

This article does not contain any studies with human participants or animals performed by any of the authors.

Informed consent

Not applicable.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Faella, M., Garbi, G., La Torre, S. et al. CHC-Based Verification of Programs Through Graph Decompositions. SN COMPUT. SCI. 5, 1062 (2024). https://doi.org/10.1007/s42979-024-03371-6

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s42979-024-03371-6

Keywords

Navigation