Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3636501.3636944acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article
Open access

Rooting for Efficiency: Mechanised Reasoning about Array-Based Trees in Separation Logic

Published: 09 January 2024 Publication History

Abstract

Array-based encodings of tree structures are often preferable to linked or abstract data type-based representations for efficiency reasons. Compared to the more traditional encodings, array-based trees do not immediately offer convenient induction principles, and the programs that manipulate them often implement traversals non-recursively, requiring complex loop invariants for their correctness proofs.
In this work, we provide a set of definitions, lemmas, and reasoning principles that streamline proofs about array-based trees and programs that work with them. We showcase our proof techniques via a series of small but characteristic examples, culminating with a large case study: verification of a C implementation of a recently published tree clock data structure in a Separation Logic embedded into Coq.

References

[1]
Andrew W. Appel. 2011. Verified Software Toolchain - (Invited Talk). In ESOP (LNCS, Vol. 6602). Springer, 1–17. https://doi.org/10.1007/978-3-642-19718-5_1
[2]
Andrew W. Appel. 2016. Verified Functional Algorithms. Software Foundations., Volume 3 (2016), Available at https://softwarefoundations.cis.upenn.edu/vfa-current/
[3]
Andrew W. Appel. 2022. Coq’s vibrant ecosystem for verification engineering (invited talk). In CPP. ACM, 2–11. https://doi.org/10.1145/3497775.3503951
[4]
Patrick Bahr and Emil Axelsson. 2017. Generalising tree traversals and tree transformations to DAGs: Exploiting sharing without the pain. Sci. Comput. Program., 137 (2017), 63–97. https://doi.org/10.1016/j.scico.2016.03.006
[5]
Aurèle Barrière. 2018. VST Verification of B+ Trees with Cursors. Ecole Normale Supérieure de Rennes.
[6]
Qinxiang Cao, Shengyi Wang, Aquinas Hobor, and Andrew W. Appel. 2019. Proof Pearl: Magic Wand as Frame. https://doi.org/10.48550/arXiv.1909.08789
[7]
Arthur Charguéraud. 2016. Higher-order representation predicates in separation logic. In CPP. ACM, 3–14. https://doi.org/10.1145/2854065.2854068
[8]
Arthur Charguéraud. 2020. Separation Logic for Sequential Programs (Functional Pearl). Proc. ACM Program. Lang., 4, ICFP (2020), 116:1–116:34. https://doi.org/10.1145/3408998
[9]
Arthur Charguéraud. 2021. Separation Logic Foundations. Software Foundations., Volume 6 (2021), Available at https://softwarefoundations.cis.upenn.edu/slf-current/
[10]
Olivier Danvy. 2022. Fold-unfold lemmas for reasoning about recursive programs using the Coq proof assistant. J. Funct. Program., 32 (2022), e13. https://doi.org/10.1017/S0956796822000107
[11]
Colin J Fidge. 1988. Timestamps in message-passing systems that preserve the partial ordering. In Proceedings of the 11th Australian Computer Science Conference. 55–66.
[12]
Cormac Flanagan and Stephen N. Freund. 2009. FastTrack: efficient and precise dynamic race detection. In PLDI. ACM, 121–133. https://doi.org/10.1145/1542476.1542490
[13]
Jeremy Gibbons. 1991. Algebras for Tree Algorithms. Ph. D. Dissertation. University of Oxford.
[14]
Léon Gondelman, Simon Oddershede Gregersen, Abel Nieto, Amin Timany, and Lars Birkedal. 2021. Distributed causal memory: modular specification and verification in higher-order distributed separation logic. Proc. ACM Program. Lang., 5, POPL (2021), 1–29. https://doi.org/10.1145/3434323
[15]
Kiran Gopinathan, Mayank Keoliya, and Ilya Sergey. 2023. Mostly Automated Proof Repair for Verified Libraries. Proc. ACM Program. Lang., 7, PLDI (2023), 25–49. https://doi.org/10.1145/3591221
[16]
Aquinas Hobor and Jules Villard. 2013. The ramifications of sharing in data structures. In POPL. ACM, 523–536. https://doi.org/10.1145/2429069.2429131
[17]
The Iris Project. 2023. Iris: a Higher-Order Concurrent Separation Logic Framework, implemented and verified in the Coq proof assistant. https://iris-project.org/ Online
[18]
Leslie Lamport. 1978. Time, Clocks, and the Ordering of Events in a Distributed System. Commun. ACM, 21, 7 (1978), 558–565. https://doi.org/10.1145/359545.359563
[19]
Mohsen Lesani, Christian J. Bell, and Adam Chlipala. 2016. Chapar: certified causally consistent distributed key-value stores. In POPL. ACM, 357–370. https://doi.org/10.1145/2837614.2837622
[20]
Yiyun Liu, James Parker, Patrick Redmond, Lindsey Kuper, Michael Hicks, and Niki Vazou. 2020. Verifying replicated data types with typeclass refinements in Liquid Haskell. Proc. ACM Program. Lang., 4, OOPSLA (2020), 216:1–216:30. https://doi.org/10.1145/3428284
[21]
William Mansky, Yuanfeng Peng, Steve Zdancewic, and Joseph Devietti. 2017. Verifying dynamic race detection. In CPP. ACM, 151–163. https://doi.org/10.1145/3018610.3018611
[22]
Umang Mathur, Andreas Pavlogiannis, Hünkar Can Tunç, and Mahesh Viswanathan. 2022. A Tree Clock Data Structure for Causal Orderings in Concurrent Executions. In ASPLOS. ACM, 710–725. https://doi.org/10.1145/3503222.3507734
[23]
Friedemann Mattern. 1989. Virtual Time and Global States of Distributed Systems. In Parallel and Distributed Algorithms. North-Holland, 215–226.
[24]
Anshuman Mohan, Wei Xiang Leow, and Aquinas Hobor. 2021. Functional Correctness of C Implementations of Dijkstra’s, Kruskal’s, and Prim’s Algorithms. In CAV (LNCS, Vol. 12760). Springer, 801–826. https://doi.org/10.1007/978-3-030-81688-9_37
[25]
Aleksandar Nanevski, Viktor Vafeiadis, and Josh Berdine. 2010. Structuring the verification of heap-manipulating programs. In POPL. ACM, 261–274. https://doi.org/10.1145/1706299.1706331
[26]
Abel Nieto, Léon Gondelman, Alban Reynaud, Amin Timany, and Lars Birkedal. 2022. Modular verification of op-based CRDTs in separation logic. Proc. ACM Program. Lang., 6, OOPSLA2 (2022), 1788–1816. https://doi.org/10.1145/3563351
[27]
Peter W. O’Hearn. 2012. A Primer on Separation Logic (and Automatic Program Verification and Analysis). In Software Safety and Security - Tools for Analysis and Verification (NATO Science for Peace and Security Series, Vol. 33). IOS Press, 286–318. https://doi.org/10.3233/978-1-61499-028-4-286
[28]
Peter W. O’Hearn, John C. Reynolds, and Hongseok Yang. 2001. Local Reasoning about Programs that Alter Data Structures. In CSL (LNCS, Vol. 2142). Springer, 1–19. https://doi.org/10.1007/3-540-44802-0_1
[29]
José Nuno Oliveira. 2023. Program Design by Calculation.
[30]
Ruzica Piskac, Thomas Wies, and Damien Zufferey. 2014. Automating Separation Logic with Trees and Data. In CAV (LNCS, Vol. 8559). Springer, 711–728. https://doi.org/10.1007/978-3-319-08867-9_47
[31]
John C. Reynolds. 2002. Separation Logic: A Logic for Shared Mutable Data Structures. In LICS. IEEE Computer Society, 55–74. https://doi.org/10.1109/LICS.2002.1029817
[32]
Caitlin Sadowski, Jaeheon Yi, Kenneth Knowles, and Cormac Flanagan. 2008. Proving correctness of a dynamic atomicity analysis in Coq. In Workshop on Mechanizing Metatheory. 8.
[33]
Konstantin Serebryany and Timur Iskhodzhanov. 2009. ThreadSanitizer – data race detection in practice. In Proceedings of the Workshop on Binary Instrumentation and Applications. http://doi.acm.org/10.1145/1791194.1791203
[34]
Ilya Sergey, Aleksandar Nanevski, and Anindya Banerjee. 2015. Mechanized verification of fine-grained concurrent programs. In PLDI. ACM, 77–87. https://doi.org/10.1145/2737924.2737964
[35]
Philip Wadler. 1990. Deforestation: Transforming Programs to Eliminate Trees. Theor. Comput. Sci., 73, 2 (1990), 231–248. https://doi.org/10.1016/0304-3975(90)90147-A
[36]
Shengyi Wang, Qinxiang Cao, Anshuman Mohan, and Aquinas Hobor. 2019. Certifying graph-manipulating C programs via localizations within data structures. Proc. ACM Program. Lang., 3, OOPSLA (2019), 171:1–171:30. https://doi.org/10.1145/3360597
[37]
James R. Wilcox, Cormac Flanagan, and Stephen N. Freund. 2018. VerifiedFT: a verified, high-performance precise dynamic race detector. In PPoPP. ACM, 354–367. https://doi.org/10.1145/3178487.3178514
[38]
Qiyuan Zhao, George Pîrlea, Zhendong Ang, Umang Mathur, and Ilya Sergey. 2023. Artefact for Article “Rooting for Efficiency: Mechanised Reasoning about Array-Based Trees in Separation Logic”. https://doi.org/10.5281/zenodo.10366484

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM Conferences
CPP 2024: Proceedings of the 13th ACM SIGPLAN International Conference on Certified Programs and Proofs
January 2024
290 pages
ISBN:9798400704888
DOI:10.1145/3636501
This work is licensed under a Creative Commons Attribution-ShareAlike International 4.0 License.

Sponsors

In-Cooperation

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 09 January 2024

Permissions

Request permissions for this article.

Check for updates

Badges

Author Tags

  1. array-based trees
  2. logical clocks
  3. separation logic

Qualifiers

  • Research-article

Funding Sources

  • Singapore Ministry of Education

Conference

CPP '24
Sponsor:

Acceptance Rates

Overall Acceptance Rate 18 of 26 submissions, 69%

Upcoming Conference

POPL '25

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • 0
    Total Citations
  • 164
    Total Downloads
  • Downloads (Last 12 months)164
  • Downloads (Last 6 weeks)24
Reflects downloads up to 16 Oct 2024

Other Metrics

Citations

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Get Access

Login options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media