Higher-Order Specifications for Deductive Synthesis of Programs with Pointers

Authors David Young , Ziyi Yang , Ilya Sergey , Alex Potanin



PDF
Thumbnail PDF

File

LIPIcs.ECOOP.2024.45.pdf
  • Filesize: 1.08 MB
  • 26 pages

Document Identifiers

Author Details

David Young
  • University of Kansas, Lawrence, KS, USA
Ziyi Yang
  • National University of Singapore, Singapore
Ilya Sergey
  • National University of Singapore, Singapore
Alex Potanin
  • Australian National University, Canberra, Australia

Acknowledgements

We thank the anonymous ECOOP 2024 PC and AEC reviewers for their constructive and insightful comments.

Cite AsGet BibTex

David Young, Ziyi Yang, Ilya Sergey, and Alex Potanin. Higher-Order Specifications for Deductive Synthesis of Programs with Pointers. In 38th European Conference on Object-Oriented Programming (ECOOP 2024). Leibniz International Proceedings in Informatics (LIPIcs), Volume 313, pp. 45:1-45:26, Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2024)
https://doi.org/10.4230/LIPIcs.ECOOP.2024.45

Abstract

Synthetic Separation Logic (SSL) is a formalism that powers SuSLik, the state-of-the-art approach for the deductive synthesis of provably-correct programs in C-like languages that manipulate heap-based linked data structures. Despite its expressivity, SSL suffers from two shortcomings that hinder its utility. First, its main specification component, inductive predicates, only admits first-order definitions of data structure shapes, which leads to the proliferation of "boiler-plate" predicates for specifying common patterns. Second, SSL requires concrete definitions of data structures to synthesise programs that manipulate them, which results in the need to change a specification for a synthesis task every time changes are introduced into the layout of the involved structures. We propose to significantly lift the level of abstraction used in writing Separation Logic specifications for synthesis - both simplifying the approach and making the specifications more usable and easy to read and follow. We avoid the need to repetitively re-state low-level representation details throughout the specifications - allowing the reuse of different implementations of the same data structure by abstracting away the details of a specific layout used in memory. Our novel high-level front-end language called Pika significantly improves the expressiveness of SuSLik. We implemented a layout-agnostic synthesiser from Pika to SuSLik enabling push-button synthesis of C programs with in-place memory updates, along with the accompanying full proofs that they meet Separation Logic-style specifications, from high-level specifications that resemble ordinary functional programs. Our experiments show that our tool can produce C code that is comparable in its performance characteristics and is sometimes faster than Haskell.

Subject Classification

ACM Subject Classification
  • Software and its engineering → General programming languages
  • Software and its engineering → Automatic programming
  • Software and its engineering → Compilers
Keywords
  • Program Synthesis
  • Separation Logic
  • Functional Programming

Metrics

  • Access Statistics
  • Total Accesses (updated on a weekly basis)
    0
    PDF Downloads

References

  1. Zilin Chen, Ambroise Lafont, Liam O'Connor, Gabriele Keller, Craig McLaughlin, Vincent Jackson, and Christine Rizkallah. Dargent: A silver bullet for verified data layout refinement. Proc. ACM Program. Lang., 7(POPL), January 2023. URL: https://doi.org/10.1145/3571240.
  2. Andreea Costea, Amy Zhu, Nadia Polikarpova, and Ilya Sergey. Concise Read-Only Specifications for Better Synthesis of Programs with Pointers. In ESOP, volume 12075 of LNCS, pages 141-168. Springer, 2020. URL: https://doi.org/10.1007/978-3-030-44914-8_6.
  3. Cordelia V. Hall, Kevin Hammond, Will Partain, Simon L. Peyton Jones, and Philip Wadler. The Glasgow Haskell Compiler: A Retrospective. In Proceedings of the 1992 Glasgow Workshop on Functional Programming, Workshops in Computing, pages 62-71. Springer, 1992. URL: https://doi.org/10.1007/978-1-4471-3215-8_6.
  4. C. A. R. Hoare. An axiomatic basis for computer programming. Commun. ACM, 12(10):576-580, 1969. URL: https://doi.org/10.1145/363235.363259.
  5. Paul Hudak, John Hughes, Simon Peyton Jones, and Philip Wadler. A History of Haskell: Being Lazy with Class. In Proceedings of the Third ACM SIGPLAN Conference on History of Programming Languages, pages 12-1-12-55. ACM, 2007. URL: https://doi.org/10.1145/1238844.1238856.
  6. Shachar Itzhaky, Hila Peleg, Nadia Polikarpova, Reuben N. S. Rowe, and Ilya Sergey. Cyclic program synthesis. In PLDI, pages 944-959. ACV, 2021. URL: https://doi.org/10.1145/3453483.3454087.
  7. Peter W. O'Hearn, John C. Reynolds, and Hongseok Yang. Local Reasoning about Programs that Alter Data Structures. In CSL, volume 2142 of LNCS, pages 1-19. Springer, 2001. URL: https://doi.org/10.1007/3-540-44802-0_1.
  8. Nadia Polikarpova, Ivan Kuraj, and Armando Solar-Lezama. Program synthesis from polymorphic refinement types. In PLDI, pages 522-538. ACM, 2016. URL: https://doi.org/10.1145/2908080.2908093.
  9. Nadia Polikarpova and Ilya Sergey. Structuring the synthesis of heap-manipulating programs. Proc. ACM Program. Lang., 3(POPL), January 2019. URL: https://doi.org/10.1145/3290385.
  10. John C. Reynolds. Separation logic: a logic for shared mutable data structures. In LICS, pages 55-74, 2002. URL: https://doi.org/10.1109/LICS.2002.1029817.
  11. Reuben N. S. Rowe and James Brotherston. Automatic cyclic termination proofs for recursive procedures in separation logic. In CPP, pages 53-65. ACM, 2017. URL: https://doi.org/10.1145/3018610.3018623.
  12. David Turner. An Overview of Miranda. SIGPLAN Not., 21(12):158-166, 1986. URL: https://doi.org/10.1145/15042.15053.
  13. Yasunari Watanabe, Kiran Gopinathan, George Pîrlea, Nadia Polikarpova, and Ilya Sergey. Certifying the synthesis of heap-manipulating programs. Proc. ACM Program. Lang., 5(ICFP):1-29, 2021. URL: https://doi.org/10.1145/3473589.
  14. David Young, Ziyi Yang, Ilya Sergey, and Alex Potanin. Higher-Order Specifications for Deductive Synthesis of Programs with Pointers (Extended Version). CoRR, abs/2407.09143, 2024. URL: https://doi.org/10.48550/arXiv.2407.09143.
Questions / Remarks / Feedback
X

Feedback for Dagstuhl Publishing


Thanks for your feedback!

Feedback submitted

Could not send message

Please try again later or send an E-mail