Skip to main content

Automated Synthesis of Functional Programs with Auxiliary Functions

  • Conference paper
  • First Online:
Book cover Programming Languages and Systems (APLAS 2018)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 11275))

Included in the following conference series:

Abstract

Polikarpova et al. have recently proposed a method for synthesizing functional programs from specifications expressed as refinement types, and implemented a program synthesis tool Synquid. Although Synquid can generate non-trivial programs on various data structures such as lists and binary search trees, it cannot automatically generate programs that require auxiliary functions, unless users provide the specifications of auxiliary functions. We propose an extension of Synquid to enable automatic synthesis of programs with auxiliary functions. The idea is to prepare a template of the target function containing unknown auxiliary functions, infer the types of auxiliary functions, and then use Synquid to synthesize the auxiliary functions. We have implemented a program synthesizer based on our method, and confirmed through experiments that our method can synthesize several programs with auxiliary functions, which Synquid is unable to automatically synthesize.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Aoto, T.: Sound lemma generation for proving inductive validity of equations. In: Hariharan, R., Mukund, M., Vinay, V. (eds.) IARCS Annual Conference on Foundations of Software Technology and Theoretical Computer Science, FSTTCS 2008, Bangalore, India, 9–11 December 2008. LIPIcs, vol. 2, pp. 13–24. Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik (2008)

    Google Scholar 

  2. Frankle, J., Osera, P., Walker, D., Zdancewic, S.: Example-directed synthesis: a type-theoretic interpretation. In: Bodík, R., Majumdar, R. (eds.) Proceedings of the 43rd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL 2016, St. Petersburg, FL, USA, 20–22 January 2016, pp. 802–815. ACM (2016)

    Google Scholar 

  3. Gulwani, S., Harris, W.R., Singh, R.: Spreadsheet data manipulation using examples. Commun. ACM 55(8), 97–105 (2012)

    Article  Google Scholar 

  4. Gulwani, S., Jha, S., Tiwari, A., Venkatesan, R.: Synthesis of loop-free programs. In: Hall, M.W., Padua, D.A. (eds.) Proceedings of the 32nd ACM SIGPLAN Conference on Programming Language Design and Implementation, PLDI 2011, San Jose, CA, USA, 4–8 June 2011, pp. 62–73. ACM (2011)

    Google Scholar 

  5. Kapur, D., Subramaniam, M.: Lemma discovery in automating induction. In: McRobbie, M.A., Slaney, J.K. (eds.) CADE 1996. LNCS, vol. 1104, pp. 538–552. Springer, Heidelberg (1996). https://doi.org/10.1007/3-540-61511-3_112

    Chapter  Google Scholar 

  6. Kneuss, E., Kuraj, I., Kuncak, V., Suter, P.: Synthesis modulo recursive functions. In: Hosking, A.L., Eugster, P.T., Lopes, C.V. (eds.) Proceedings of the 2013 ACM SIGPLAN International Conference on Object Oriented Programming Systems Languages & Applications, OOPSLA 2013, part of SPLASH 2013, Indianapolis, IN, USA, 26–31 October 2013, pp. 407–426. ACM (2013)

    Google Scholar 

  7. Osera, P., Zdancewic, S.: Type-and-example-directed program synthesis. In: Grove, D., Blackburn, S. (eds.) Proceedings of the 36th ACM SIGPLAN Conference on Programming Language Design and Implementation, Portland, OR, USA, 15–17 June 2015, pp. 619–630. ACM (2015)

    Google Scholar 

  8. Polikaropova, N.: Synquid. https://bitbucket.org/nadiapolikarpova/synquid/

  9. Polikarpova, N., Kuraj, I., Solar-Lezama, A.: Program synthesis from polymorphic refinement types. ACM SIGPLAN Not. 51(6), 522–538 (2016)

    Article  Google Scholar 

  10. Shingo, E., Kobayashi, N., Tsukada, T.: Automated synthesis of functional programs with auxiliary functions. http://www-kb.is.s.u-tokyo.ac.jp/~koba/papers/aplas18-long.pdf

  11. Solar-Lezama, A.: Program synthesis by sketching. Ph.D. thesis, University of California, Berkeley (2008)

    Google Scholar 

  12. Vazou, N., Rondon, P.M., Jhala, R.: Abstract refinement types. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 209–228. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-37036-6_13

    Chapter  Google Scholar 

Download references

Acknowledgments

We would like to thank anonymous referees for useful comments. This work was supported by JSPS KAKENHI Grant Number JP15H05706 and JP16K16004.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Naoki Kobayashi .

Editor information

Editors and Affiliations

Appendices

Appendix

A Well-Formedness of Types and Type Environments

A formula \(\psi \) is well formed in the environment \(\varGamma \), written \(\varGamma \vdash \psi \), when it has a boolean sort under the assumption that each free variable in \(\psi \) has the sort declared in \(\varGamma \).

The well-formedness relations on types and type environments, \(\varGamma \vdash T\) and \( \vdash {\varGamma } \) respectively, are defined by the rules given below.

figure d
figure e

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Eguchi, S., Kobayashi, N., Tsukada, T. (2018). Automated Synthesis of Functional Programs with Auxiliary Functions. In: Ryu, S. (eds) Programming Languages and Systems. APLAS 2018. Lecture Notes in Computer Science(), vol 11275. Springer, Cham. https://doi.org/10.1007/978-3-030-02768-1_13

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-02768-1_13

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-02767-4

  • Online ISBN: 978-3-030-02768-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics