Interactive Synthesis of Code Snippets

  • Tihomir Gvero
  • Viktor Kuncak
  • Ruzica Piskac
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 6806)


We describe a tool that applies theorem proving technology to synthesize code fragments that use given library functions. To determine candidate code fragments, our approach takes into account polymorphic type constraints as well as test cases. Our tool interactively displays a ranked list of suggested code fragments that are appropriate for the current program point. We have found our system to be useful for synthesizing code fragments for common programming tasks, and we believe it is a good platform for exploring software synthesis techniques.


  1. [BG01]
    Bachmair, L., Ganzinger, H.: Resolution theorem proving. Handbook of Automated Reasoning, 19–99 (2001)Google Scholar
  2. [Can11]
    Aemon Cannon. Ensime. Retrieved 20 April (2011),
  3. [DM82]
    Damas, L., Milner, R.: Principal type-schemes for functional programs. In: POPL (1982)Google Scholar
  4. [JGST10]
    Jha, S., Gulwani, S., Seshia, S.A., Tiwari, A.: Oracle-guided component-based program synthesis. In: ICSE, vol. 1 (2010)Google Scholar
  5. [MW80]
    Manna, Z., Waldinger, R.: A deductive approach to program synthesis. ACM Trans. Program. Lang. Syst. 2(1), 90–121 (1980)CrossRefzbMATHGoogle Scholar
  6. [MXBK05]
    Mandelin, D., Xu, L., Bodík, R., Kimelman, D.: Jungloid mining: helping to navigate the API jungle. In: PLDI (2005)Google Scholar
  7. [OSV08]
    Odersky, M., Spoon, L., Venners, B.: Programming in Scala: a comprehensive step-by-step guide. Artima Press (2008)Google Scholar
  8. [SC06]
    Sahavechaphan, N., Claypool, K.: Xsnippet: mining for sample code. In: OOPSLA (2006)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • Tihomir Gvero
    • 1
  • Viktor Kuncak
    • 1
  • Ruzica Piskac
    • 1
  1. 1.Swiss Federal Institute of Technology Lausanne (EPFL)Switzerland

Personalised recommendations