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.
Supplemental Material
- 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 Scholar
Cross Ref
- Rajeev Alur, Arjun Radhakrishna, and Abhishek Udupa. 2017. Scaling Enumerative Program Synthesis via Divide and Conquer. In Proc. of TACAS. 319–336.Google Scholar
Cross Ref
- Gilles Barthe, Juan Manuel Crespo, and César Kunz. 2011. Relational verification using product programs. In Proc. of FM. Springer, 200–214. Google Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Cross Ref
- Gilles Barthe, Pedro R D’Argenio, and Tamara Rezk. 2004. Secure information flow by self-composition. In Proc. of CSF. 100–114. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Nick Benton. 2004. Simple relational correctness proofs for static analyses and program transformations. In Proc. of POPL, Vol. 39. 14–25. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Wei Chen and Jan Tijmen Udding. 1990. Program inversion: More than fun! Science of Comp. Prog. 15, 1 (1990), 1–13. Google Scholar
Digital Library
- Hubert Comon. 1997. Tree automata techniques and applications. http://www. grappa. univ-lille3. fr/tata (1997).Google Scholar
- 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 Scholar
- 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 Scholar
Digital Library
- Edsger W Dijkstra. 1982. Program inversion. In Selected Writings on Computing: A Personal Perspective. Springer, 351–354.Google Scholar
Digital Library
- John K. Feser, Swarat Chaudhuri, and Isil Dillig. 2015. Synthesizing data structure transformations from input-output examples. In Proc. of PLDI. 229–239. Google Scholar
Digital Library
- Giorgio Gallo, Giustino Longo, Stefano Pallottino, and Sang Nguyen. 1993. Directed hypergraphs and applications. Discrete applied mathematics 42, 2-3 (1993), 177–201. Google Scholar
Digital Library
- Cordell Green. 1969. Application of theorem proving to problem solving. In Proc. of IJCAI. 219–239. Google Scholar
Digital Library
- Sumit Gulwani. 2011. Automating string processing in spreadsheets using input-output examples. In Proc. of POPL. 317–330. Google Scholar
Digital Library
- Sumit Gulwani. 2012. Synthesis from examples: Interaction models and algorithms. In Symbolic and Numeric Algorithms for Scientific Computing (SYNASC) . 8–14. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Qinheping Hu and Loris D’Antoni. 2017. Automatic program inversion using symbolic transducers. In Proc. of PLDI. 376–389. Google Scholar
Digital Library
- Barbara Jobstmann, Andreas Griesmayer, and Roderick Bloem. 2005. Program repair as a game. In Proc. of CAV. 226–238. Google Scholar
Digital Library
- Etienne Kneuss, Ivan Kuraj, Viktor Kuncak, and Philippe Suter. 2013. Synthesis modulo recursive functions. Proc. of OOPSLA 48, 10 (2013), 407–426. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Zohar Manna and Richard Waldinger. 1986. A deductive approach to program synthesis. In Readings in artificial intelligence and software engineering . Elsevier, 3–34. Google Scholar
Digital Library
- Tom M Mitchell. 1982. Generalization as search. Artificial intelligence 18, 2 (1982), 203–226.Google Scholar
- Dmitry Mordvinov and Grigory Fedyukovich. 2017. Synchronizing constrained Horn clauses. LPAR, EPiC Series in Computing (2017).Google Scholar
- Carroll Morgan. 1994. Programming from specifications. Prentice Hall. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Nadia Polikarpova, Ivan Kuraj, and Armando Solar-Lezama. 2016. Program synthesis from polymorphic refinement types. In Proc. of PLDI. 522–538. Google Scholar
Digital Library
- Oleksandr Polozov and Sumit Gulwani. 2015. FlashMeta: A framework for inductive program synthesis. In Proc. of OOPSLA, Vol. 50. 107–126. Google Scholar
Digital Library
- Veselin Raychev, Pavol Bielik, Martin T. Vechev, and Andreas Krause. 2016. Learning programs from noisy data. In Proc. of POPL . 761–774. Google Scholar
Digital Library
- Veselin Raychev, Martin T. Vechev, and Andreas Krause. 2015. Predicting Program Properties from "Big Code". In Proc. of POPL . 111–124. Google Scholar
Digital Library
- Brian J Ross. 1997. Running programs backwards: the logical inversion of imperative computation. Formal Aspects of Computing 9, 3 (1997), 331–348.Google Scholar
Cross Ref
- Eric Schkufza, Rahul Sharma, and Alex Aiken. 2013. Stochastic superoptimization. In Proc. of ASPLOS. 305–316. Google Scholar
Digital Library
- Sunbeom So and Hakjoo Oh. 2017. Synthesizing Imperative Programs from Examples Guided by Static Analysis. In Proc. of SAS . 364–381.Google Scholar
Cross Ref
- Armando Solar-Lezama. 2008. Program synthesis by sketching. University of California, Berkeley.Google Scholar
- Armando Solar-Lezama. 2009. The sketching approach to program synthesis. In Proc. of APLAS. Springer, 4–13. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Marcelo Sousa and Isil Dillig. 2016. Cartesian hoare logic for verifying k-safety properties. In Proc. of PLDI. 57–69. Google Scholar
Digital Library
- Marcelo Sousa, Isil Dillig, and Shuvendu K. Lahiri. 2018. Verified Three-Way Program Merge. PACMPL OOPSLA (2018). Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- Xinyu Wang, Isil Dillig, and Rishabh Singh. 2018a. Program synthesis using abstraction refinement. PACMPL 2, POPL (2018), 63:1–63:30. Google Scholar
Digital Library
- Xinyu Wang, Sumit Gulwani, and Rishabh Singh. 2016. FIDEX: filtering spreadsheet data using examples. In Proc. of OOPSLA. 195–213. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- Yuepeng Wang, Xinyu Wang, and Isil Dillig. 2018c. Relational Program Synthesis. http://arxiv.org/abs/1809.02283 . arXiv: 1809.02283Google Scholar
- 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 Scholar
Digital Library
- Hongseok Yang. 2007. Relational separation logic. Theoretical Computer Science 375, 1-3 (2007), 308–334. Google Scholar
Digital Library
- Anna Zaks and Amir Pnueli. 2008. Covac: Compiler validation by program analysis of the cross-product. In Proc. of FM. Springer, 35–51. Google Scholar
Digital Library
Index Terms
Relational program synthesis
Recommendations
Algorithmic program synthesis: introduction
Program synthesis is a process of producing an executable program from a specification. Algorithmic synthesis produces the program automatically, without an intervention from an expert. While classical compilation falls under the definition of ...
From program verification to program synthesis
POPL '10This paper describes a novel technique for the synthesis of imperative programs. Automated program synthesis has the potential to make programming and the design of systems easier by allowing programs to be specified at a higher-level than executable ...
Synthesising Programs with Non-trivial Constants
AbstractProgram synthesis is the mechanised construction of software. One of the main difficulties is the efficient exploration of the very large solution space, and tools often require a user-provided syntactic restriction of the search space. While ...






Comments