Abstract
We present a method for synthesizing recursive functions that provably satisfy a given specification in the form of a polymorphic refinement type. We observe that such specifications are particularly suitable for program synthesis for two reasons. First, they offer a unique combination of expressive power and decidability, which enables automatic verification—and hence synthesis—of nontrivial programs. Second, a type-based specification for a program can often be effectively decomposed into independent specifications for its components, causing the synthesizer to consider fewer component combinations and leading to a combinatorial reduction in the size of the search space. At the core of our synthesis procedure is a newalgorithm for refinement type checking, which supports specification decomposition. We have evaluated our prototype implementation on a large set of synthesis problems and found that it exceeds the state of the art in terms of both scalability and usability. The tool was able to synthesize more complex programs than those reported in prior work (several sorting algorithms and operations on balanced search trees), as well as most of the benchmarks tackled by existing synthesizers, often starting from a more concise and intuitive user input.
- A. Albarghouthi, S. Gulwani, and Z. Kincaid. Recursive program synthesis. In CAV, 2013.Google Scholar
- A. Albarghouthi, I. Dillig, and A. Gurfinkel. Maximal specification synthesis. In POPL, 2016. Google Scholar
Digital Library
- R. Alur, R. Bodík, 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 Scholar
Cross Ref
- R. Alur, P. ˇ Cerný, and A. Radhakrishna. Synthesis through unification. In CAV, 2015.Google Scholar
- L. Augustsson. djinn, the official Haskell package webpage. http://hackage.haskell.org/package/djinn, 2014.Google Scholar
- E. Brady. Idris, a general-purpose dependently typed programming language: Design and implementation. J. Funct. Program., 23(5):552–593, 2013.Google Scholar
Cross Ref
- K. Claessen, M. Johansson, D. Rosén, and N. Smallbone. Hipspec: Automating inductive proofs of program properties. In ATx/WInG, 2012.Google Scholar
- T. Coquand. An algorithm for type-checking dependent types. Sci. Comput. Program., 26(1-3):167–177, 1996. Google Scholar
Digital Library
- R. Davies and F. Pfenning. Intersection types and computational effects. In ICFP, 2000. Google Scholar
Digital Library
- I. Dillig, T. Dillig, B. Li, and K. L. McMillan. Inductive invariant generation via abductive inference. In OOPSLA, 2013. Google Scholar
Digital Library
- J. Dunfield and F. Pfenning. Tridirectional typechecking. In POPL, 2004. Google Scholar
Digital Library
- J. K. Feser, S. Chaudhuri, and I. Dillig. Synthesizing data structure transformations from input-output examples. In PLDI, 2015. Google Scholar
Digital Library
- C. Flanagan. Hybrid type checking. In POPL, 2006. Google Scholar
Digital Library
- J. Frankle, P. Osera, D. Walker, and S. Zdancewic. Exampledirected synthesis: a type-theoretic interpretation. In POPL, 2016. Google Scholar
Digital Library
- T. Gvero, V. Kuncak, I. Kuraj, and R. Piskac. Complete completion using types and weights. In PLDI, 2013. Google Scholar
Digital Library
- J. Heras, E. Komendantskaya, M. Johansson, and E. Maclean. Proof-pattern recognition and lemma discovery in ACL2. In LPAR, 2013.Google Scholar
Cross Ref
- J. P. Inala, X. Qiu, B. Lerner, and A. Solar-Lezama. Type assisted synthesis of recursive transformers on algebraic data types. CoRR, abs/1507.05527, 2015.Google Scholar
- R. Jhala, E. Seidel, and N. Vazou. Programming with refinement types (an introduction to liquidhaskell). https: //ucsd-progsys.github.io/liquidhaskell-tutorial, 2015.Google Scholar
- M. Kawaguchi, P. M. Rondon, and R. Jhala. Type-based data structure verification. In PLDI, 2009. Google Scholar
Digital Library
- E. Kneuss, I. Kuraj, V. Kuncak, and P. Suter. Synthesis modulo recursive functions. In OOPSLA, 2013. Google Scholar
Digital Library
- K. R. M. Leino and A. Milicevic. Program extrapolation with Jennisys. In OOPSLA, 2012. Google Scholar
Digital Library
- M. Liffiton, A. Previti, A. Malik, and J. Marques-Silva. Fast, flexible mus enumeration. Constraints, pages 1–28, 2015. Google Scholar
Digital Library
- D. Mandelin, L. Xu, R. Bodík, and D. Kimelman. Jungloid mining: Helping to navigate the api jungle. In PLDI, 2005. Google Scholar
Digital Library
- A. Milicevic, J. P. Near, E. Kang, and D. Jackson. Alloy*: A general-purpose higher-order relational constraint solver. In ICSE, 2015. Google Scholar
Digital Library
- O. Montano-Rivas, R. L. McCasland, L. Dixon, and A. Bundy. Scheme-based theorem discovery and concept invention. Expert Syst. Appl., 39(2):1637–1646, 2012. Google Scholar
Digital Library
- U. Norell. Dependently typed programming in agda. In AFP, 2009. Google Scholar
Digital Library
- P. Osera and S. Zdancewic. Type-and-example-directed program synthesis. In PLDI, 2015. Google Scholar
Digital Library
- D. Perelman, S. Gulwani, T. Ball, and D. Grossman. Type-directed completion of partial expressions. In PLDI, 2012. Google Scholar
Digital Library
- B. C. Pierce. Types and Programming Languages. MIT Press, 2002. Google Scholar
Digital Library
- B. C. Pierce and D. N. Turner. Local type inference. ACM Trans. Program. Lang. Syst., 22(1):1–44, 2000. Google Scholar
Digital Library
- N. Polikarpova and I. Kuraj. Synquid code repository. https://bitbucket.org/nadiapolikarpova/synquid/, 2015.Google Scholar
- N. Polikarpova, I. Kuraj, and A. Solar-Lezama. Program synthesis from polymorphic refinement types. CoRR, abs/1510.08419, 2016.Google Scholar
- P. M. Rondon, M. Kawaguchi, and R. Jhala. Liquid types. In PLDI, 2008. Google Scholar
Digital Library
- S. Srivastava and S. Gulwani. Program verification using templates over predicate abstraction. In PLDI, 2009. Google Scholar
Digital Library
- P. Suter, A. S. Köksal, and V. Kuncak. Satisfiability modulo recursive programs. In SAS, 2011. Google Scholar
Digital Library
- N. Vazou, P. M. Rondon, and R. Jhala. Abstract refinement types. In ESOP, 2013. Google Scholar
Digital Library
- N. Vazou, E. L. Seidel, and R. Jhala. Liquidhaskell: experience with refinement types in the real world. In Haskell, 2014. Google Scholar
Digital Library
- N. Vazou, E. L. Seidel, R. Jhala, D. Vytiniotis, and S. L. P. Jones. Refinement types for haskell. In ICFP, 2014. Google Scholar
Digital Library
- N. Vazou, A. Bakst, and R. Jhala. Bounded refinement types. In ICFP, 2015. Google Scholar
Digital Library
- P. Wadler. Theorems for free! In FPCA, 1989. Google Scholar
Digital Library
- H. Xi and F. Pfenning. Dependent types in practical programming. In POPL, 1999. Google Scholar
Digital Library
Index Terms
Program synthesis from polymorphic refinement types
Recommendations
Resource-guided program synthesis
PLDI 2019: Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and ImplementationThis article presents resource-guided synthesis, a technique for synthesizing recursive programs that satisfy both a functional specification and a symbolic resource bound. The technique is type-directed and rests upon a novel type system that combines ...
Program synthesis by type-guided abstraction refinement
We consider the problem of type-directed component-based synthesis where, given a set of (typed) components and a query type, the goal is to synthesize a term that inhabits the query. Classical approaches based on proof search in intuitionistic logics ...
Program synthesis from polymorphic refinement types
PLDI '16: Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and ImplementationWe present a method for synthesizing recursive functions that provably satisfy a given specification in the form of a polymorphic refinement type. We observe that such specifications are particularly suitable for program synthesis for two reasons. ...







Comments