skip to main content
research-article

Synthesis of loop-free programs

Published:04 June 2011Publication History
Skip Abstract Section

Abstract

We consider the problem of synthesizing loop-free programs that implement a desired functionality using components from a given library. Specifications of the desired functionality and the library components are provided as logical relations between their respective input and output variables. The library components can be used at most once, and hence the library is required to contain a reasonable overapproximation of the multiset of the components required.

We solve the above component-based synthesis problem using a constraint-based approach that involves first generating a synthesis constraint, and then solving the constraint. The synthesis constraint is a first-order ∃∀ logic formula whose size is quadratic in the number of components. We present a novel algorithm for solving such constraints. Our algorithm is based on counterexample guided iterative synthesis paradigm and uses off-the-shelf SMT solvers.

We present experimental results that show that our tool Brahma can efficiently synthesize highly nontrivial 10-20 line loop-free bitvector programs. These programs represent a state space of approximately 2010 programs, and are beyond the reach of the other tools based on sketching and superoptimization.

References

  1. Satisfiability modulo theories competition (smt-comp). \URLhttp://www.smtcomp.org/2009/index.shtml.Google ScholarGoogle Scholar
  2. SMTLIB: Satisfiability modulo theories lib. URLhttp://smtlib.org.Google ScholarGoogle Scholar
  3. Yices: An SMT solver. URLhttp://yices.csl.sri.com.Google ScholarGoogle Scholar
  4. The AHA! (A Hacker's Assistant) Superoptimizer, 2008. Download: URLhttp://www.hackersdelight.org/aha.zip, Documentation: URLhttp://www.hackersdelight.org/aha/aha.pdf.Google ScholarGoogle Scholar
  5. S. Bansal and A. Aiken. Automatic generation of peephole superoptimizers. In ASPLOS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. Bansal and A. Aiken. Binary translation using peephole superoptimizers. In OSDI, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. R. Cytron, J. Ferrante, B. K. Rosen, M. N. Wegman, and F. K. Zadeck. An efficient method of computing static single assignment form. In POPL, 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. B. Fischer and J. Schumann. Autobayes: A system for generating data analysis programs from statistical models. J. Funct. Program., 13(3):483--508, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. P. Flener and L. Popelmnsky. On the use of inductive reasoning in program synthesis: Prejudice and prospects. In LOBSTR. 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. E. M. Gold. Language identification in the limit. Information and Control, 10(5):447--474, 1967.Google ScholarGoogle ScholarCross RefCross Ref
  11. T. Granlund and R. Kenner. Eliminating branches using a superoptimizer and %the gnu c compiler. In PLDI, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. S. Gulwani. Dimensions in program synthesis. In PPDP, pages 13--24. ACM, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. S. Gulwani. Automating string processing in spreadsheets using input-output examples. In POPL, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Gulwani, V. Korthikanti, and A. Tiwari. Synthesizing geometry constructions. In PLDI, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. J. Hamza, B. Jobstmann, and V. Kuncak. Synthesis for regular specifications over unbounded domains. In FMCAD, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. B. Harris and S. Gulwani. Spreadsheet table transformations from examples. In PLDI, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. S. Itzhaky, S. Gulwani, N. Immerman, and M. Sagiv. A simple inductive synthesis methodology and its applications. In OOPSLA, pages 36--46, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. R. N. Jackiw and W. F. Finzer. The geometer's sketchpad: programming by geometry. In Watch what I do: programming by demonstration, pages 293--307. MIT Press, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. S. Jha, S. Gulwani, S. Seshia, and A. Tiwari. Oracle-guided component-based program synthesis. In ICSE, pages 215--224, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. S. Jha, S. Gulwani, S. Seshia, and A. Tiwari. Synthesizing switching logic for safety and dwell-time requirements. In Proc. 1st ACM/IEEE Intl. Conf. on Cyber-Physical Systems, ICCPS, pages 22--31, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. T. A. Johnson and R. Eigenmann. Context-sensitive domain-independent algorithm composition and selection. In PLDI, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. R. Joshi, G. Nelson, and K. H. Randall. Denali: A goal-directed superoptimizer. In PLDI, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. D. E. Knuth. The art of computer programming. \URLhttp://www-cs-faculty.stanford.edu/ knuth/taocp.html.Google ScholarGoogle Scholar
  24. T. A. Lau, P. Domingos, and D. S. Weld. Version space algebra and its application to programming by demonstration. In ICML, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Y. Lustig and M. Vardi. Synthesis from component libraries. In Proc. FoSSaCS, pages 395--409, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. D. Mandelin, L. Xu, R. Bodík, and D. Kimelman. Jungloid mining: helping to navigate the API jungle. In PLDI, pages 48--61, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Z. Manna and R. Waldinger. A deductive approach to program synthesis. ACM TOPLAS, 2(1):90--121, 1980. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. H. Massalin. Superoptimizer - a look at the smallest program. In ASPLOS, pages 122--126, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. S. Muggleton, editor. Inductive Logic Programming, volume 38 of The APIC Series. Academic Press, 1992.Google ScholarGoogle Scholar
  30. E. Y. Shapiro. Algorithmic Program DeBugging. MIT Press, Cambridge, MA, USA, 1983. Google ScholarGoogle ScholarDigital LibraryDigital Library
  31. A. Solar-Lezama, G. Arnold, L. Tancau, R. Bodík, V. A. Saraswat, and S. A. Seshia. Sketching stencils. In PLDI, pages 167--178, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. A. Solar-Lezama, R. Rabbah, R. Bodík, and K. Ebcioglu. Programming by sketching for bit-streaming programs. In PLDI, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. A. Solar-Lezama, L. Tancau, R. Bodík, S. Seshia, and V. Saraswat. Combinatorial sketching for finite programs. In ASPLOS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. S. Srivastava, S. Gulwani, and J. S. Foster. From program verification to program synthesis. In POPL, pages 313--326, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. M. Stickel, R. Waldinger, M. Lowry, T. Pressburger, and I. Underwood. Deductive composition of astro. software from subroutine libraries. In CADE, '94. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. A. Taly, S. Gulwani, and A. Tiwari. Synthesizing switching logic using constraint solving. In VMCAI, pages 305--319. Springer, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. H. S. Warren. Hacker's Delight. Addison-Wesley, '02. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. I. H. Witten and D. Mo. TELS: learning text editing tasks from examples. In Watch what I do: programming by demonstration, pages 293--307. MIT Press, Cambridge, MA, USA, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library

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 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
    • 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

    Copyright © 2011 ACM

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 4 June 2011

    Check for updates

    Qualifiers

    • research-article

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!