Relational program synthesis

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.

[1]  Rajeev Alur,et al.  Syntax-guided synthesis , 2013, FMCAD 2013.

[2]  Edsger W. Dijkstra,et al.  Program Inversion , 1978, Program Construction.

[3]  Armando Solar-Lezama,et al.  The Sketching Approach to Program Synthesis , 2009, APLAS.

[4]  Sumit Gulwani,et al.  Path-based inductive synthesis for program inversion , 2011, PLDI '11.

[5]  Isil Dillig,et al.  Consolidation of queries with user-defined functions , 2014, PLDI.

[6]  Amir Pnueli,et al.  CoVaC: Compiler Validation by Program Analysis of the Cross-Product , 2008, FM.

[7]  Hongseok Yang,et al.  Relational separation logic , 2007, Theor. Comput. Sci..

[8]  Andreas Krause,et al.  Learning programs from noisy data , 2016, POPL.

[9]  Alexander Aiken,et al.  Stratified synthesis: automatically learning the x86-64 instruction set , 2016, PLDI.

[10]  Sumit Gulwani,et al.  Synthesis from Examples: Interaction Models and Algorithms , 2012, 2012 14th International Symposium on Symbolic and Numeric Algorithms for Scientific Computing.

[11]  Alberto Pettorossi,et al.  Relational Verification Through Horn Clause Transformation , 2016, SAS.

[12]  Sumit Gulwani,et al.  FIDEX: filtering spreadsheet data using examples , 2016, OOPSLA.

[13]  Zohar Manna,et al.  A Deductive Approach to Program Synthesis , 1979, TOPL.

[14]  Hakjoo Oh,et al.  Synthesizing Imperative Programs from Examples Guided by Static Analysis , 2017, SAS.

[15]  Isil Dillig,et al.  Precise Detection of Side-Channel Vulnerabilities using Quantitative Cartesian Hoare Logic , 2017, CCS.

[16]  Isil Dillig,et al.  Program synthesis using abstraction refinement , 2017, Proc. ACM Program. Lang..

[17]  Adam Chlipala,et al.  Fiat , 2015, POPL.

[18]  Zohar Manna,et al.  A Deductive Approach to Program Synthesis , 1979, TOPL.

[19]  Carroll Morgan,et al.  Programming from specifications , 1990, Prentice Hall International Series in computer science.

[20]  Wei Chen,et al.  Program Inversion: More than Fun! , 1990, Sci. Comput. Program..

[21]  Benjamin Grégoire,et al.  Probabilistic Relational Hoare Logics for Computer-Aided Security Proofs , 2012, MPC.

[22]  Loris D'Antoni,et al.  Automatic program inversion using symbolic transducers , 2017, PLDI.

[23]  Alexander Aiken,et al.  Stochastic superoptimization , 2012, ASPLOS '13.

[24]  Armando Solar-Lezama,et al.  Program synthesis by sketching , 2008 .

[25]  Isil Dillig,et al.  Verifying equivalence of database-driven applications , 2017, Proc. ACM Program. Lang..

[26]  Andreas Krause,et al.  Predicting Program Properties from "Big Code" , 2015, POPL.

[27]  Isil Dillig,et al.  Verified three-way program merge , 2018, Proc. ACM Program. Lang..

[28]  Isil Dillig,et al.  Synthesis of data completion scripts using finite tree automata , 2017, Proc. ACM Program. Lang..

[29]  Sumit Gulwani,et al.  Automating string processing in spreadsheets using input-output examples , 2011, POPL '11.

[30]  Brian J. Ross,et al.  Running programs backwards: The logical inversion of imperative computation , 1997, Formal Aspects of Computing.

[31]  Gilles Barthe,et al.  Probabilistic relational reasoning for differential privacy , 2012, POPL '12.

[32]  Sumit Gulwani,et al.  FlashMeta: a framework for inductive program synthesis , 2015, OOPSLA.

[33]  Arjun Radhakrishna,et al.  Scaling Enumerative Program Synthesis via Divide and Conquer , 2017, TACAS.

[34]  Pedro R. D'Argenio,et al.  Secure information flow by self-composition , 2004, Proceedings. 17th IEEE Computer Security Foundations Workshop, 2004..

[35]  Roderick Bloem,et al.  Program Repair as a Game , 2005, CAV.

[36]  Isil Dillig,et al.  Automated Migration of Hierarchical Data to Relational Tables using Programming-by-Example , 2017, Proc. VLDB Endow..

[37]  Gilles Barthe,et al.  Relational Verification Using Product Programs , 2011, FM.

[38]  Grigory Fedyukovich,et al.  Synchronizing Constrained Horn Clauses , 2017, LPAR.

[39]  Isil Dillig,et al.  Synthesizing data structure transformations from input-output examples , 2015, PLDI.

[40]  Pedro M. Domingos,et al.  Programming by Demonstration Using Version Space Algebra , 2003, Machine Learning.

[41]  Viktor Kuncak,et al.  Synthesis modulo recursive functions , 2013, OOPSLA.

[42]  Nick Benton,et al.  Simple relational correctness proofs for static analyses and program transformations , 2004, POPL.

[43]  Rajeev Alur,et al.  Syntax-guided synthesis , 2013, 2013 Formal Methods in Computer-Aided Design.

[44]  Gilles Barthe,et al.  Beyond 2-Safety: Asymmetric Product Programs for Relational Program Verification , 2013, LFCS.

[45]  Tom M. Mitchell,et al.  Generalization as Search , 2002 .

[46]  C. Cordell Green,et al.  Application of Theorem Proving to Problem Solving , 1969, IJCAI.

[47]  Isil Dillig,et al.  Cartesian hoare logic for verifying k-safety properties , 2016, PLDI.

[48]  Gilles Barthe,et al.  Product programs and relational program logics , 2016, J. Log. Algebraic Methods Program..

[49]  Armando Solar-Lezama,et al.  Program synthesis from polymorphic refinement types , 2015, PLDI.

[50]  Giorgio Gallo,et al.  Directed Hypergraphs and Applications , 1993, Discret. Appl. Math..

[51]  Dawei Qi,et al.  SemFix: Program repair via semantic analysis , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[52]  Sanjit A. Seshia,et al.  Combinatorial sketching for finite programs , 2006, ASPLOS XII.