skip to main content
article
Public Access

Optimizing synthesis with metasketches

Published:11 January 2016Publication History
Skip Abstract Section

Abstract

Many advanced programming tools---for both end-users and expert developers---rely on program synthesis to automatically generate implementations from high-level specifications. These tools often need to employ tricky, custom-built synthesis algorithms because they require synthesized programs to be not only correct, but also optimal with respect to a desired cost metric, such as program size. Finding these optimal solutions efficiently requires domain-specific search strategies, but existing synthesizers hard-code the strategy, making them difficult to reuse. This paper presents metasketches, a general framework for specifying and solving optimal synthesis problems. metasketches make the search strategy a part of the problem definition by specifying a fragmentation of the search space into an ordered set of classic sketches. We provide two cooperating search algorithms to effectively solve metasketches. A global optimizing search coordinates the activities of local searches, informing them of the costs of potentially-optimal solutions as they explore different regions of the candidate space in parallel. The local searches execute an incremental form of counterexample-guided inductive synthesis to incorporate information sent from the global search. We present Synapse, an implementation of these algorithms, and show that it effectively solves optimal synthesis problems with a variety of different cost functions. In addition, metasketches can be used to accelerate classic (non-optimal) synthesis by explicitly controlling the search strategy, and we show that Synapse solves classic synthesis problems that state-of-the-art tools cannot.

References

  1. R. Alur, L. D’Antoni, S. Gulwani, D. Kini, and M. Viswanathan. Automated grading of DFA constructions. In IJCAI, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. R. Alur, R. Bodik, G. Juniwal, M. M. K. Martin, M. Raghothaman, S. A. Seshia, R. Singh, A. Solar-Lezama, E. Torlak, and A. Udupa. Syntax-guided synthesis. In FMCAD, 2013.Google ScholarGoogle ScholarCross RefCross Ref
  3. R. Alur, R. Bodik, E. Dallal, D. Fisman, P. Garg, G. Juniwal, H. Kress-Gazit, P. Madhusudan, M. M. K. Martin, M. Raghothaman, S. Saha, S. A. Seshia, R. Singh, A. Solar-Lezama, E. Torlak, and A. Udupa. Syntax-guided synthesis. In Dependable Software Systems Engineering, volume 40. 2015.Google ScholarGoogle Scholar
  4. R. Alur, D. Fisman, R. Singh, and A. Solar-Lezama. The second competition on syntax-guided synthesis. In SYNT, 2015. URL http: //formal.epfl.ch/synt/2015/slides/fisman-etal.pdf.Google ScholarGoogle Scholar
  5. M. Carbin, S. Misailovic, and M. C. Rinard. Verifying quantitative reliability for programs that execute on unreliable hardware. In OOPSLA, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S. Chaudhuri, M. Clochard, and A. Solar-Lezama. Bridging boolean and quantitative synthesis using smoothed proof search. In POPL, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. A. Cimatti, A. Franzén, A. Griggio, R. Sebastiani, and C. Stenico. Satisfiability modulo the theory of costs: Foundations and applications. In TACAS, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. L. De Moura and N. Bjørner. Z3: An efficient SMT solver. In TACAS, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. H. Esmaeilzadeh, A. Sampson, L. Ceze, and D. Burger. Neural acceleration for general-purpose approximate programs. In MICRO, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. K. Feser, S. Chaudhuri, and I. Dillig. Synthesizing data structure transformations from input-output examples. In PLDI, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S. Gulwani. Automating string processing in spreadsheets using inputoutput examples. In POPL, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. S. Gulwani, S. Jha, A. Tiwari, and R. Venkatesan. Synthesis of loop-free programs. In PLDI, 2011. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. S. Gulwani, W. R. Harris, and R. Singh. Spreadsheet data manipulation using examples. Commun. ACM, 55(8), Aug. 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. J. Jeon, X. Qiu, A. Solar-Lezama, and J. S. Foster. Adaptive concretization for parallel program synthesis. In CAV, 2015.Google ScholarGoogle Scholar
  15. S. Jha, S. Gulwani, S. A. Seshia, and A. Tiwari. Oracle-guided component-based program synthesis. In ICSE, 2010. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. R. Joshi, G. Nelson, and K. Randall. Denali: a goal-directed superoptimizer. In PLDI, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. A. S. Köksal, Y. Pu, S. Srivastava, R. Bodik, J. Fisher, and N. Piterman. Synthesis of biological models from mutation experiments. In POPL, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. A. Krizhevsky. Learning multiple layers of features from tiny images. Technical report, University of Toronto, 2009.Google ScholarGoogle Scholar
  19. I. Kuraj, V. Kuncak, and D. Jackson. Programming with enumerable sets of structures. In OOPSLA, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Y. Li, A. Albarghouthi, Z. Kincaid, A. Gurfinkel, and M. Chechik. Symbolic optimization with SMT solvers. In POPL, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. A. Massalin. Superoptimizer: A look at the smallest program. In ASPLOS, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. A. K. Menon, O. Tamuz, S. Gulwani, and A. T. Kalai. A machine learning framework for programming by example. In ICML, 2013.Google ScholarGoogle Scholar
  23. L. A. Meyerovich. Parallel Layout Engines: Synthesis and Optimization of Tree Traversals. PhD thesis, University of California, Berkeley, 2013.Google ScholarGoogle Scholar
  24. L. A. Meyerovich, M. E. Torok, E. Atkinson, and R. Bodik. Parallel schedule synthesis for attribute grammars. In PPoPP, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. T. Moreau, M. Wyse, J. Nelson, A. Sampson, H. Esmaeilzadeh, L. Ceze, and M. Oskin. SNNAP: Approximate computing on programmable SoCs via neural acceleration. In HPCA, 2015.Google ScholarGoogle ScholarCross RefCross Ref
  26. V. Nair and G. E. Hinton. Rectified linear units improve restricted Boltzmann machines. In ICML, 2010.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. P. M. Phothilimthana, T. Jelvis, R. Shah, N. Totla, S. Chasins, and R. Bodik. Chlorophyll: Synthesis-aided compiler for low-power spatial architectures. In PLDI, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. O. Polozov and S. Gulwani. FlashMeta: A framework for inductive program synthesis. In OOPSLA, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. J. D. Ramsdell. An operational semantics for Scheme. SIGPLAN Lisp Pointers, V(2):6–10, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. A. Reynolds, M. Deters, V. Kuncak, C. Tinelli, and C. Barrett. Counterexample-guided quantifier instantiation for synthesis in SMT. In CAV, 2015.Google ScholarGoogle Scholar
  31. E. Schkufza, R. Sharma, and A. Aiken. Stochastic superoptimization. In ASPLOS, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. R. Sebastiani and S. Tomasi. Optimization in SMT with LA(Q) cost functions. In IJCAR, 2012. Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. J. E. Smith. Characterizing computer performance with a single number. Commun. ACM, 31(10), Oct. 1988. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. A. Solar-Lezama. Program synthesis by sketching. PhD thesis, University of California, Berkeley, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. A. Solar-Lezama, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Combinatorial sketching for finite programs. In ASPLOS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. A. Solar-Lezama, G. Arnold, L. Tancau, R. Bodik, V. Saraswat, and S. Seshia. Sketching stencils. In PLDI, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. V. Srinivasan and T. Reps. Synthesis of machine code from semantics. In PLDI, 2015. Google ScholarGoogle ScholarDigital LibraryDigital Library
  38. M. Szudzik. An elegant pairing function. In NKS, 2006.Google ScholarGoogle Scholar
  39. E. Torlak and R. Bodik. Growing solver-aided languages with Rosette. In Onward!, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. E. Torlak and R. Bodik. A lightweight symbolic virtual machine for solver-aided host languages. In PLDI, 2014. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. E. Torlak and D. Jackson. Kodkod: A relational model finder. In TACAS, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. A. Udupa, A. Raghavan, J. V. Deshmukh, S. Mador-Haim, M. M. K. Martin, and R. Alur. Transit: Specifying protocols with concolic snippets. In PLDI, 2013. Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. H. S. Warren, Jr. Hacker’s Delight. Addison-Wesley, 2007. Introduction Optimal Syntax-Guided Synthesis Metasketches The Metasketch Abstraction Properties of Metasketches Examples Optimal Synthesis Algorithm Global Search Local Searches Characterization Implementation Evaluation Benchmarks Is Synapse a practical approach to solving different kinds of synthesis problems? Does the fragmentation of the search space by a metasketch translate into parallel speedup? Is online completeness empirically useful? How beneficial are our metasketch and implementation optimizations? Can Synapse reason about dynamic cost functions? Related Work ConclusionGoogle ScholarGoogle Scholar

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 51, Issue 1
    POPL '16
    January 2016
    815 pages
    ISSN:0362-1340
    EISSN:1558-1160
    DOI:10.1145/2914770
    • Editor:
    • Andy Gill
    Issue’s Table of Contents
    • cover image ACM Conferences
      POPL '16: Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages
      January 2016
      815 pages
      ISBN:9781450335492
      DOI:10.1145/2837614

    Copyright © 2016 ACM

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    • Published: 11 January 2016

    Check for updates

    Qualifiers

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