skip to main content
research-article
Open Access
Artifacts Available

Natural synthesis of provably-correct data-structure manipulations

Published:12 October 2017Publication History
Skip Abstract Section

Abstract

This paper presents natural synthesis, which generalizes the proof-theoretic synthesis technique to support very expressive logic theories. This approach leverages the natural proof methodology and reduces an intractable, unbounded-size synthesis problem to a tractable, bounded-size synthesis problem, which is amenable to be handled by modern inductive synthesis engines. The synthesized program admits a natural proof and is a provably-correct solution to the original synthesis problem. We explore the natural synthesis approach in the domain of imperative data-structure manipulations and present a novel syntax-guided synthesizer based on natural synthesis. The input to our system is a program template together with a rich functional specification that the synthesized program must meet. Our system automatically produces a program implementation along with necessary proof artifacts, namely loop invariants and ranking functions, and guarantees the total correctness with a natural proof. Experiments show that our natural synthesizer can efficiently produce provably-correct implementations for sorted lists and binary search trees. To our knowledge, this is the first system that can automatically synthesize these programs, their functional correctness and their termination in tandem from bare-bones control flow skeletons.

Skip Supplemental Material Section

Supplemental Material

References

  1. Wei-Ngan Chin, Cristina David, Huu Hai Nguyen, and Shengchao Qin. 2012. Automated Verification of Shape, Size and Bag Properties via User-defined Predicates in Separation Logic. Sci. Comput. Program. (2012), 1006–1036. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Adam Chlipala. 2011. Mostly-automated Verification of Low-level Programs in Computational Separation Logic. In Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’11). ACM, New York, NY, USA, 234–245. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Ernie Cohen, Markus Dahlweid, Mark A. Hillebrand, Dirk Leinenbach, Michal Moskal, Thomas Santen, Wolfram Schulte, and Stephan Tobies. 2009. VCC: A Practical System for Verifying Concurrent C. In TPHOLs’09 (LNCS), Vol. 5674. Springer, Berlin, Heidelberg, 23–42. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Benjamin Delaware, Clément Pit-Claudel, Jason Gross, and Adam Chlipala. 2015. Fiat: Deductive Synthesis of Abstract Data Types in a Proof Assistant. In Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’15). ACM, New York, NY, USA, 689–700. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Ankush Desai, Pranav Garg, and P. Madhusudan. 2014. Natural Proofs for Asynchronous Programs Using Almostsynchronous Reductions. In Proceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA ’14). ACM, New York, NY, USA, 709–725. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. John K. Feser, Swarat Chaudhuri, and Isil Dillig. 2015. Synthesizing Data Structure Transformations from Input-output Examples. In Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’15). ACM, New York, NY, USA, 229–239. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Peter Hawkins, Alex Aiken, Kathleen Fisher, Martin Rinard, and Mooly Sagiv. 2011. Data Representation Synthesis. In Proceedings of the 32Nd ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’11). ACM, New York, NY, USA, 38–49. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Radu Iosif, Adam Rogalewicz, and Jirí Simácek. 2013. The Tree Width of Separation Logic with Recursive Definitions. In CADE-24. Springer, Berlin, Heidelberg, 21–38. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Bart Jacobs, Jan Smans, Pieter Philippaerts, Frédéric Vogels, Willem Penninckx, and Frank Piessens. 2011. VeriFast: a powerful, sound, predictable, fast verifier for C and Java. In NFM’11. Springer, Berlin, Heidelberg, 41–55. Google ScholarGoogle ScholarCross RefCross Ref
  10. Etienne Kneuss, Ivan Kuraj, Viktor Kuncak, and Philippe Suter. 2013. Synthesis Modulo Recursive Functions. In Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages & Applications (OOPSLA ’13). ACM, New York, NY, USA, 407–426. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Tal Lev-Ami, Thomas Reps, Mooly Sagiv, and Reinhard Wilhelm. 2000. Putting Static Analysis to Work for Verification: A Case Study. In Proceedings of the 2000 ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA ’00). ACM, New York, NY, USA, 26–38. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Tal Lev-Ami and Shmuel Sagiv. 2000. TVLA: A System for Implementing Static Analyses. In SAS ’00 (LNCS), Vol. 1824. Springer, Berlin, Heidelberg, 280–301. Google ScholarGoogle ScholarCross RefCross Ref
  13. P. Madhusudan, Gennaro Parlato, and Xiaokang Qiu. 2011. Decidable Logics Combining Heap Structures and Data. In Proceedings of the 38th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’11). ACM, New York, NY, USA, 611–622. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. P. Madhusudan, Xiaokang Qiu, and Andrei Stefanescu. 2012. Recursive Proofs for Inductive Tree Data-structures. In Proceedings of the 39th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’12). ACM, New York, NY, USA, 123–136. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Zohar Manna and Richard Waldinger. 1979. Synthesis: Dreams => Programs. IEEE Transactions on Software Engineering 5, 4 (1979), 294–328. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Peter W. O’Hearn, John C. Reynolds, and Hongseok Yang. 2001. Local Reasoning about Programs that Alter Data Structures. In CSL’01 (LNCS), Vol. 2142. Springer, Berlin, Heidelberg, 1–19. Google ScholarGoogle ScholarCross RefCross Ref
  17. Edgar Pek, Xiaokang Qiu, and P. Madhusudan. 2014. Natural Proofs for Data Structure Manipulation in C Using Separation Logic. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’14). ACM, New York, NY, USA, 440–451. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Nadia Polikarpova, Ivan Kuraj, and Armando Solar-Lezama. 2016. Program Synthesis from Polymorphic Refinement Types. In Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’16). ACM, New York, NY, USA, 522–538. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Xiaokang Qiu, Pranav Garg, Andrei Ştefănescu, and Parthasarathy Madhusudan. 2013. Natural Proofs for Structure, Data, and Separation. In Proceedings of the 34th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’13). ACM, New York, NY, USA, 231–242. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. John C. Reynolds. 2002. Separation logic: a logic for shared mutable data structures. In Proceedings 17th Annual IEEE Symposium on Logic in Computer Science. IEEE, 55–74. Google ScholarGoogle ScholarCross RefCross Ref
  21. Rishabh Singh and Armando Solar-Lezama. 2011. Synthesizing Data Structure Manipulations from Storyboards. In Proceedings of the 19th ACM SIGSOFT Symposium and the 13th European Conference on Foundations of Software Engineering (ESEC/FSE ’11). ACM, New York, NY, USA, 289–299. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Armando Solar-Lezama, Liviu Tancau, Rastislav Bodik, Sanjit Seshia, and Vijay Saraswat. 2006. Combinatorial Sketching for Finite Programs. In Proceedings of the 12th International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS XII). ACM, New York, NY, USA, 404–415. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Saurabh Srivastava, Sumit Gulwani, and Jeffrey S. Foster. 2010. From Program Verification to Program Synthesis. In Proceedings of the 37th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (POPL ’10). ACM, New York, NY, USA, 313–326. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Philippe Suter, Ali Sinan Köksal, and Viktor Kuncak. 2011. Satisfiability Modulo Recursive Programs. In SAS’11 (LNCS), Eran Yahav (Ed.), Vol. 6887. Springer, Berlin, Heidelberg, 298–315. Google ScholarGoogle ScholarCross RefCross Ref
  25. Emina Torlak and Rastislav Bodik. 2014. A Lightweight Symbolic Virtual Machine for Solver-aided Host Languages. In Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’14). ACM, New York, NY, USA, 530–541. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Martin Vechev and Eran Yahav. 2008. Deriving Linearizable Fine-grained Concurrent Objects. In Proceedings of the 29th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’08). ACM, New York, NY, USA, 125–135. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Martin T. Vechev, Eran Yahav, David F. Bacon, and Noam Rinetzky. 2007. CGCExplorer: A Semi-automated Search Procedure for Provably Correct Concurrent Collectors. In Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI ’07). ACM, New York, NY, USA, 456–467. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Natural synthesis of provably-correct data-structure manipulations

                  Recommendations

                  Comments

                  Login options

                  Check if you have access through your login credentials or your institution to get full access on this article.

                  Sign in

                  Full Access

                  • Published in

                    cover image Proceedings of the ACM on Programming Languages
                    Proceedings of the ACM on Programming Languages  Volume 1, Issue OOPSLA
                    October 2017
                    1786 pages
                    EISSN:2475-1421
                    DOI:10.1145/3152284
                    Issue’s Table of Contents

                    Copyright © 2017 ACM

                    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                    Publisher

                    Association for Computing Machinery

                    New York, NY, United States

                    Publication History

                    • Published: 12 October 2017
                    Published in pacmpl Volume 1, Issue OOPSLA

                    Permissions

                    Request permissions about this article.

                    Request Permissions

                    Check for updates

                    Qualifiers

                    • research-article

                  PDF Format

                  View or Download as a PDF file.

                  PDF

                  eReader

                  View online with eReader.

                  eReader