skip to main content
research-article
Open Access

Relational program synthesis

Published:24 October 2018Publication History
Skip Abstract Section

Abstract

This paper proposes relational program synthesis, a new problem that concerns synthesizing one or more programs that collectively satisfy a relational specification. As a dual of relational program verification, relational program synthesis is an important problem that has many practical applications, such as automated program inversion and automatic generation of comparators. However, this relational synthesis problem introduces new challenges over its non-relational counterpart due to the combinatorially larger search space. As a first step towards solving this problem, this paper presents a synthesis technique that combines the counterexample-guided inductive synthesis framework with a novel inductive synthesis algorithm that is based on relational version space learning. We have implemented the proposed technique in a framework called Relish, which can be instantiated to different application domains by providing a suitable domain-specific language and the relevant relational specification. We have used the Relish framework to build relational synthesizers to automatically generate string encoders/decoders as well as comparators, and we evaluate our tool on several benchmarks taken from prior work and online forums. Our experimental results show that the proposed technique can solve almost all of these benchmarks and that it significantly outperforms EUSolver, a generic synthesis framework that won the general track of the most recent SyGuS competition.

Skip Supplemental Material Section

Supplemental Material

a155-wang.webm

References

  1. Rajeev Alur, Rastislav Bodik, Garvit Juniwal, Milo MK Martin, Mukund Raghothaman, Sanjit A Seshia, Rishabh Singh, Armando Solar-Lezama, Emina Torlak, and Abhishek Udupa. 2013. Syntax-guided synthesis. In Proc. of FMCAD. 1–8.Google ScholarGoogle ScholarCross RefCross Ref
  2. Rajeev Alur, Arjun Radhakrishna, and Abhishek Udupa. 2017. Scaling Enumerative Program Synthesis via Divide and Conquer. In Proc. of TACAS. 319–336.Google ScholarGoogle ScholarCross RefCross Ref
  3. Gilles Barthe, Juan Manuel Crespo, and César Kunz. 2011. Relational verification using product programs. In Proc. of FM. Springer, 200–214. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Gilles Barthe, Juan Manuel Crespo, and César Kunz. 2013. Beyond 2-safety: Asymmetric product programs for relational program verification. In Proc. of LFCS. Springer, 29–43.Google ScholarGoogle ScholarCross RefCross Ref
  5. Gilles Barthe, Juan Manuel Crespo, and César Kunz. 2016. Product programs and relational program logics. Journal of Logical and Algebraic Methods in Programming 85, 5 (2016), 847–859.Google ScholarGoogle ScholarCross RefCross Ref
  6. Gilles Barthe, Pedro R D’Argenio, and Tamara Rezk. 2004. Secure information flow by self-composition. In Proc. of CSF. 100–114. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Gilles Barthe, Benjamin Grégoire, and Santiago Zanella Béguelin. 2012a. Probabilistic relational Hoare logics for computeraided security proofs. In International Conference on Mathematics of Program Construction. Springer, 1–6. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Gilles Barthe, Boris Köpf, Federico Olmedo, and Santiago Zanella Béguelin. 2012b. Probabilistic relational reasoning for differential privacy. In Proc. of POPL, Vol. 47. 97–110. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Nick Benton. 2004. Simple relational correctness proofs for static analyses and program transformations. In Proc. of POPL, Vol. 39. 14–25. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Jia Chen, Yu Feng, and Isil Dillig. 2017. Precise Detection of Side-Channel Vulnerabilities using Quantitative Cartesian Hoare Logic. In Proc. of CCS. 875–890. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Wei Chen and Jan Tijmen Udding. 1990. Program inversion: More than fun! Science of Comp. Prog. 15, 1 (1990), 1–13. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Hubert Comon. 1997. Tree automata techniques and applications. http://www. grappa. univ-lille3. fr/tata (1997).Google ScholarGoogle Scholar
  13. Emanuele De Angelis, Fabio Fioravanti, Alberto Pettorossi, and Maurizio Proietti. 2016. Relational verification through horn clause transformation. In Proc. of SAS. Springer, 147–169.Google ScholarGoogle Scholar
  14. Benjamin Delaware, Clément Pit-Claudel, Jason Gross, and Adam Chlipala. 2015. Fiat: Deductive synthesis of abstract data types in a proof assistant. In Proc. of POPL, Vol. 50. 689–700. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Edsger W Dijkstra. 1982. Program inversion. In Selected Writings on Computing: A Personal Perspective. Springer, 351–354.Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. John K. Feser, Swarat Chaudhuri, and Isil Dillig. 2015. Synthesizing data structure transformations from input-output examples. In Proc. of PLDI. 229–239. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Giorgio Gallo, Giustino Longo, Stefano Pallottino, and Sang Nguyen. 1993. Directed hypergraphs and applications. Discrete applied mathematics 42, 2-3 (1993), 177–201. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Cordell Green. 1969. Application of theorem proving to problem solving. In Proc. of IJCAI. 219–239. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Sumit Gulwani. 2011. Automating string processing in spreadsheets using input-output examples. In Proc. of POPL. 317–330. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Sumit Gulwani. 2012. Synthesis from examples: Interaction models and algorithms. In Symbolic and Numeric Algorithms for Scientific Computing (SYNASC) . 8–14. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Stefan Heule, Eric Schkufza, Rahul Sharma, and Alex Aiken. 2016. Stratified synthesis: automatically learning the x86-64 instruction set. In Proc. of PLDI. 237–250. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Qinheping Hu and Loris D’Antoni. 2017. Automatic program inversion using symbolic transducers. In Proc. of PLDI. 376–389. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Barbara Jobstmann, Andreas Griesmayer, and Roderick Bloem. 2005. Program repair as a game. In Proc. of CAV. 226–238. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. Etienne Kneuss, Ivan Kuraj, Viktor Kuncak, and Philippe Suter. 2013. Synthesis modulo recursive functions. Proc. of OOPSLA 48, 10 (2013), 407–426. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Tessa Lau, Steven A. Wolfman, Pedro Domingos, and Daniel S. Weld. 2003. Programming by Demonstration Using Version Space Algebra. Machine Learning 53, 1-2 (2003), 111–156. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Zohar Manna and Richard Waldinger. 1986. A deductive approach to program synthesis. In Readings in artificial intelligence and software engineering . Elsevier, 3–34. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Tom M Mitchell. 1982. Generalization as search. Artificial intelligence 18, 2 (1982), 203–226.Google ScholarGoogle Scholar
  28. Dmitry Mordvinov and Grigory Fedyukovich. 2017. Synchronizing constrained Horn clauses. LPAR, EPiC Series in Computing (2017).Google ScholarGoogle Scholar
  29. Carroll Morgan. 1994. Programming from specifications. Prentice Hall. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Hoang Duong Thien Nguyen, Dawei Qi, Abhik Roychoudhury, and Satish Chandra. 2013. Semfix: Program repair via semantic analysis. In Proc. of ICSE. 772–781. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. Nadia Polikarpova, Ivan Kuraj, and Armando Solar-Lezama. 2016. Program synthesis from polymorphic refinement types. In Proc. of PLDI. 522–538. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Oleksandr Polozov and Sumit Gulwani. 2015. FlashMeta: A framework for inductive program synthesis. In Proc. of OOPSLA, Vol. 50. 107–126. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Veselin Raychev, Pavol Bielik, Martin T. Vechev, and Andreas Krause. 2016. Learning programs from noisy data. In Proc. of POPL . 761–774. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Veselin Raychev, Martin T. Vechev, and Andreas Krause. 2015. Predicting Program Properties from "Big Code". In Proc. of POPL . 111–124. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Brian J Ross. 1997. Running programs backwards: the logical inversion of imperative computation. Formal Aspects of Computing 9, 3 (1997), 331–348.Google ScholarGoogle ScholarCross RefCross Ref
  36. Eric Schkufza, Rahul Sharma, and Alex Aiken. 2013. Stochastic superoptimization. In Proc. of ASPLOS. 305–316. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Sunbeom So and Hakjoo Oh. 2017. Synthesizing Imperative Programs from Examples Guided by Static Analysis. In Proc. of SAS . 364–381.Google ScholarGoogle ScholarCross RefCross Ref
  38. Armando Solar-Lezama. 2008. Program synthesis by sketching. University of California, Berkeley.Google ScholarGoogle Scholar
  39. Armando Solar-Lezama. 2009. The sketching approach to program synthesis. In Proc. of APLAS. Springer, 4–13. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Armando Solar-Lezama, Liviu Tancau, Rastislav Bodik, Sanjit Seshia, and Vijay Saraswat. 2006. Combinatorial sketching for finite programs. Proc. of ASPLOS 41, 11 (2006), 404–415. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Marcelo Sousa and Isil Dillig. 2016. Cartesian hoare logic for verifying k-safety properties. In Proc. of PLDI. 57–69. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. Marcelo Sousa, Isil Dillig, and Shuvendu K. Lahiri. 2018. Verified Three-Way Program Merge. PACMPL OOPSLA (2018). Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Marcelo Sousa, Isil Dillig, Dimitrios Vytiniotis, Thomas Dillig, and Christos Gkantsidis. 2014. Consolidation of queries with user-defined functions. In Proc. of PLDI, Vol. 49. 554–564. Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Saurabh Srivastava, Sumit Gulwani, Swarat Chaudhuri, and Jeffrey S Foster. 2011. Path-based inductive synthesis for program inversion. In Proc. of PLDI, Vol. 46. 492–503. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Xinyu Wang, Isil Dillig, and Rishabh Singh. 2017. Synthesis of data completion scripts using finite tree automata. PACMPL 1, OOPSLA (2017), 62:1–62:26. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Xinyu Wang, Isil Dillig, and Rishabh Singh. 2018a. Program synthesis using abstraction refinement. PACMPL 2, POPL (2018), 63:1–63:30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Xinyu Wang, Sumit Gulwani, and Rishabh Singh. 2016. FIDEX: filtering spreadsheet data using examples. In Proc. of OOPSLA. 195–213. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Yuepeng Wang, Isil Dillig, Shuvendu K. Lahiri, and William R. Cook. 2018b. Verifying equivalence of database-driven applications. PACMPL 2, POPL (2018), 56:1–56:29. Google ScholarGoogle ScholarDigital LibraryDigital Library
  49. Yuepeng Wang, Xinyu Wang, and Isil Dillig. 2018c. Relational Program Synthesis. http://arxiv.org/abs/1809.02283 . arXiv: 1809.02283Google ScholarGoogle Scholar
  50. Navid Yaghmazadeh, Xinyu Wang, and Isil Dillig. 2018. Automated Migration of Hierarchical Data to Relational Tables using Programming-by-Example. Proc. of VLDB 11, 5 (2018), 580–593. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Hongseok Yang. 2007. Relational separation logic. Theoretical Computer Science 375, 1-3 (2007), 308–334. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Anna Zaks and Amir Pnueli. 2008. Covac: Compiler validation by program analysis of the cross-product. In Proc. of FM. Springer, 35–51. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Relational program synthesis

        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

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!