[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
10.1145/1993498.1993557acmconferencesArticle/Chapter ViewAbstractPublication PagespldiConference Proceedingsconference-collections
research-article

Path-based inductive synthesis for program inversion

Published: 04 June 2011 Publication History

Abstract

In this paper, we investigate the problem of semi-automated inversion of imperative programs, which has the potential to make it much easier and less error prone to write programs that naturally pair as inverses, such as insert/delete operations, compressors/decompressors, and so on. Viewing inversion as a subproblem of program synthesis, we propose a novel synthesis technique called Path-based inductive synthesis (PINS) and apply it to inversion. PINS starts from a program P and a template T for its inverse. PINS then iteratively refines the space of template instantiations by exploring paths in the composition of P and T with symbolic execution. PINS uses an SMT solver to intelligently guide the refinement process, based on the paths explored so far. The key idea motivating this approach is the small path-bound hypothesis: that the behavior of a program can be summarized with a small, carefully chosen set of its program paths.
We evaluated PINS by using it to invert 14 programs such as compressors (e.g., Lempel-Ziv-Welch), encoders (e.g., UUEncode), and arithmetic operations (e.g., vector rotation). Most of these examples are difficult or impossible to invert using prior techniques, but PINS was able to invert all of them. We also found that a semi-automated technique we developed to mine a template from the program to be inverted worked well. In our experiments, PINS takes between one second to thirty minutes to synthesize inverses. We believe this proof-of-concept implementation demonstrates the viability of the PINS approach to program synthesis.

References

[1]
CBMC. http://www.cprover.org/cbmc/.
[2]
LZW and LZ77. http://en.wikipedia.org/wiki/Lempel-Ziv-Welch and URLhttp://en.wikipedia.org/wiki/LZ77_and_LZ78.
[3]
PINS. http://www.cs.umd.edu/~saurabhs/vs3/PINS/.
[4]
Wei Chen. A formal approach to program inversion. In CSC: Proc. of the ACM conference on Cooperation, pages 398--403, 1990.
[5]
Byron Cook, Sumit Gulwani, Tal Lev-Ami, Andrey Rybalchenko, and Mooly Sagiv. Proving conditional termination. In CAV'08.
[6]
Byron Cook, Andreas Podelski, and Andrey Rybalchenko. Termination proofs for systems code. In PLDI, pages 415--426, 2006.
[7]
Leonardo de~Moura and Nikolaj Bjø rner. Z3, 2008. http://research.microsoft.com/projects/Z3/.
[8]
Edsger~W. Dijkstra. Program inversion. In Program Construction, http://www.cs.utexas.edu/~EWD/ewd06xx/EWD671.PDF, pages 54--57, London, UK, 1979. Springer-Verlag.
[9]
David Eppstein. A heuristic approach to program inversion. In IJCAI, pages 219--221, 1985.
[10]
Michael D. Ernst, Jeff H. Perkins, Philip J. Guo, Stephen McCamant, Carlos Pacheco, Matthew~S. Tschantz, and Chen Xiao. The Daikon system for dynamic detection of likely invariants. Science of Computer Programming, 69(1--3):35--45, December 2007.
[11]
Robert Glück and Masahiko Kawabe. A method for automatic program inversion based on LR(0) parsing. Fundam. Inf., 66(4):367--395, 2005.
[12]
David Gries. The Science of Programming. Springer-Verlag New York, Inc., 1987.
[13]
Sumit Gulwani. Dimensions in program synthesis (invited talk paper). In ACM Symposium on PPDP, 2010.
[14]
Sumit Gulwani. Automating string processing in spreadsheets using input-output examples. In POPL, pages 317--330, 2011.
[15]
Sumit Gulwani, Susmit~Kumar Jha, Ashish Tiwari, and Ramarathnam Venkatesan. Synthesis of loop-free programs. In PLDI, 2011.
[16]
Sumit Gulwani, Vijay Korthikanti, and Ashish Tiwari. Synthesizing geometry constructions. In PLDI, 2011.
[17]
Sumit Gulwani, Saurabh Srivastava, and Ramarathnam Venkatesan. Program analysis as constraint solving. In PLDI, 2008.
[18]
Sumit Gulwani and Ashish Tiwari. Constraint-based approach for analysis of hybrid systems. In CAV, pages 190--203, 2008.
[19]
Sumit Gulwani and Florian Zuleger. The reachability-bound problem. In PLDI'10, pages 292--304, 2010.
[20]
William~R. Harris and Sumit Gulwani. Spreadsheet table transformations from examples. In PLDI, 2011.
[21]
Shachar Itzhaky, Sumit Gulwani, Neil Immerman, and Mooly Sagiv. A simple inductive synthesis methodology and its applications. In OOPSLA, pages 36--46, 2010.
[22]
Susmit Jha, Sumit Gulwani, Sanjit Seshia, and Ashish Tiwari. Oracle-guided component-based program synthesis. In ICSE, 2010.
[23]
Aditya Kanade, Rajeev Alur, Sriram Rajamani, and G~Ramalingam. Representation dependence testing using program inversion. In FSE, 2010.
[24]
Masahiko Kawabe and Robert Glück. The program inverter lrinv and its structure. In PADL, pages 219--234, 2005.
[25]
James C. King. Symbolic execution and program testing. Communications of the ACM, 19(7):385--394, 1976.
[26]
Viktor Kuncak, Mikael Mayer, Ruzica Piskac, and Philippe Suter. Complete functional synthesis. In PLDI, 2010.
[27]
Zohar Manna and Richard Waldinger. A deductive approach to program synthesis. ACM Trans. Program. Lang. Syst., 2(1), 1980.
[28]
Zohar Manna and Richard J. Waldinger. Toward automatic program synthesis. Communications of the ACM, 14(3):151--165, 1971.
[29]
Kazutaka Morita, Akimasa Morihata, Kiminori Matsuzaki, Zhenjiang Hu, and Masato Takeichi. Automatic inversion generates divide-and-conquer parallel programs. In PLDI'07.
[30]
William H. Press, Saul A. Teukolsky, William T. Vetterling, and Brian P. Flannery. LU Decomposition and Its Applications, chapter 2.3, pages 34--42. 1993.
[31]
Brian J. Ross. Running programs backwards: The logical inversion of imperative computation. Formal Asp. Comput., 9(3):331--348, 1997.
[32]
D. R. Smith. Kids: A semiautomatic program development system. IEEE Trans. Softw. Eng., 16:1024--1043, 1990.
[33]
Armando Solar-Lezama, Gilad Arnold, Liviu Tancau, Rastislav Bodik, Vijay Saraswat, and Sanjit Seshia. Sketching stencils. In PLDI, pages 167--178, 2007.
[34]
Armando Solar-Lezama, Christopher~Grant Jones, and Rastislav Bodík. Sketching concurrent data structures. In PLDI, 2008.
[35]
Armando Solar-Lezama, Rodric Rabbah, Rastislav Bodík, and Kemal Ebcioğlu. Prog. by sketching for bit-stream. prgs. In PLDI, pages 281--294, 2005.
[36]
Saurabh Srivastava and Sumit Gulwani. Program verification using templates over predicate abstraction. In PLDI, 2009.
[37]
Saurabh Srivastava, Sumit Gulwani, and Jeffrey S. Foster. VS3: SMT solvers for program verification. In CAV, 2009.
[38]
Saurabh Srivastava, Sumit Gulwani, and Jeffrey S. Foster. From program verification to program synthesis. In POPL, 2010.
[39]
Ankur Taly, Sumit Gulwani, and Ashish Tiwari. Synthesizing switching logic using constraint solving. In VMCAI, pages 305--319, 2009.
[40]
T. A. Welch. A technique for high-performance data compression. Computer, 17(6):8--19, 1984.
[41]
Daniel~M. Yellin. Attribute grammar inversion and source-to-source translation. Springer-Verlag New York, Inc., 1988.
[42]
J. Ziv and A. Lempel. A universal algorithm for sequential data compression. IEEE Transactions on Information Theory, IT-23(5):337--343, 1977.

Cited By

View all
  • (2024)Neuro-Symbolic Approach to Certified Scientific Software SynthesisProceedings of the 1st ACM International Conference on AI-Powered Software10.1145/3664646.3664776(147-150)Online publication date: 10-Jul-2024
  • (2024)From Batch to Stream: Automatic Generation of Online AlgorithmsProceedings of the ACM on Programming Languages10.1145/36564188:PLDI(1014-1039)Online publication date: 20-Jun-2024
  • (2024)Semantic Code Refactoring for Abstract Data TypesProceedings of the ACM on Programming Languages10.1145/36328708:POPL(816-847)Online publication date: 5-Jan-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
PLDI '11: Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation
June 2011
668 pages
ISBN:9781450306638
DOI:10.1145/1993498
  • General Chair:
  • Mary Hall,
  • Program Chair:
  • David Padua
  • cover image ACM SIGPLAN Notices
    ACM SIGPLAN Notices  Volume 46, Issue 6
    PLDI '11
    June 2011
    652 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/1993316
    Issue’s Table of Contents
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 04 June 2011

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. inductive synthesis
  2. pins
  3. program inversion
  4. symbolic execution
  5. testing-inspired synthesis

Qualifiers

  • Research-article

Conference

PLDI '11
Sponsor:

Acceptance Rates

Overall Acceptance Rate 406 of 2,067 submissions, 20%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)23
  • Downloads (Last 6 weeks)0
Reflects downloads up to 23 Dec 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Neuro-Symbolic Approach to Certified Scientific Software SynthesisProceedings of the 1st ACM International Conference on AI-Powered Software10.1145/3664646.3664776(147-150)Online publication date: 10-Jul-2024
  • (2024)From Batch to Stream: Automatic Generation of Online AlgorithmsProceedings of the ACM on Programming Languages10.1145/36564188:PLDI(1014-1039)Online publication date: 20-Jun-2024
  • (2024)Semantic Code Refactoring for Abstract Data TypesProceedings of the ACM on Programming Languages10.1145/36328708:POPL(816-847)Online publication date: 5-Jan-2024
  • (2024) Sparcl : A language for partially invertible computation Journal of Functional Programming10.1017/S095679682300012634Online publication date: 26-Jan-2024
  • (2024)Reconciling Partial and Local InvertibilityProgramming Languages and Systems10.1007/978-3-031-57267-8_3(59-89)Online publication date: 6-Apr-2024
  • (2022)Synbit: synthesizing bidirectional programs using unidirectional sketchesFormal Methods in System Design10.1007/s10703-023-00436-961:2-3(198-247)Online publication date: 1-Dec-2022
  • (2022)Bootstrapping Library-Based SynthesisStatic Analysis10.1007/978-3-031-22308-2_13(272-298)Online publication date: 2-Dec-2022
  • (2021)Synbit: synthesizing bidirectional programs using unidirectional sketchesProceedings of the ACM on Programming Languages10.1145/34854825:OOPSLA(1-31)Online publication date: 15-Oct-2021
  • (2021)Haskell⁻¹: automatic function inversion in HaskellProceedings of the 14th ACM SIGPLAN International Symposium on Haskell10.1145/3471874.3472982(41-55)Online publication date: 18-Aug-2021
  • (2018)Relational program synthesisProceedings of the ACM on Programming Languages10.1145/32765252:OOPSLA(1-27)Online publication date: 24-Oct-2018
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media