Program synthesis by type-guided abstraction refinement
Zheng Guo, Michael James, David Justo, Jiaxiao Zhou, Ziteng Wang, Ranjit Jhala, Nadia Polikarpova
摘要
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 do not scale up to the standard libraries of modern languages, which span hundreds or thousands of components. Recent graph reachability based methods proposed for Java do scale, but only apply to monomorphic data and components: polymorphic data and components infinitely explode the size of the graph that must be searched, rendering synthesis intractable. We introduce type-guided abstraction refinement (TYGAR), a new approach for scalable type-directed synthesis over polymorphic datatypes and components. Our key insight is that we can overcome the explosion by building a graph over abstract types which represent a potentially unbounded set of concrete types. We show how to use graph reachability to search for candidate terms over abstract types, and introduce a new algorithm that uses proofs of untypeability of ill-typed candidates to iteratively refine the abstraction until a well-typed result is found. We have implemented TYGAR in H+, a tool that takes as input a set of Haskell libraries and a query type, and returns a Haskell term that uses functions from the provided libraries to implement the query type. Our support for polymorphism allows H+ to work with higher-order functions and type classes, and enables more precise queries due to parametricity. We have evaluated H+ on 44 queries using a set of popular Haskell libraries with a total of 291 components. H+ returns an interesting solution within the first five results for 32 out of 44 queries. Our results show that TYGAR allows H+ to rapidly return well-typed terms, with the median time to first solution of just 1.4 seconds. Moreover, we observe that gains from iterative refinement over exhaustive enumeration are more pronounced on harder queries.
问问这篇 Paper
智能体会读完全文。
Lune 把这篇 Paper 索引到了每一个公式,引用它的顶会 Paper 也一样。你提问,回答直接引用原文。
引用它的顶会 Paper20
- FlashFill++: Scaling Programming by Example by Cutting to the ChaseJosé Cambronero, Sumit Gulwani, Vu Le, Daniel Perelman 等POPL 2023 · 被引用 27 次
- SOAR: A Synthesis Approach for Data Science API RefactoringAnsong Ni, Daniel Ramos, Aidan Z. H. Yang, Inês Lynce 等ICSE 2021 · 被引用 27 次
- Dataflow-based pruning for speeding up superoptimizationManasij Mukherjee, Pranav Kant, Zhengyang Liu, John RegehrOOPSLA 2020 · 被引用 21 次
- API-Driven Program Synthesis for Testing Static Typing ImplementationsThodoris Sotiropoulos, Stefanos Chaliasos, Zhendong SuPOPL 2024 · 被引用 15 次
- Inductive Program Synthesis via Iterative Forward-Backward Abstract InterpretationYongho Yoon, Woosuk Lee, Kwangkeun YiPLDI 2023 · 被引用 15 次
相关 Paper
- Digging for fold: synthesis-aided API discovery for HaskellMichael B. James, Zheng Guo, Ziteng Wang, Shivani Doshi 等OOPSLA 2020 · 被引用 19 次
- Intensional datatype refinement: with application to scalable verification of pattern-match safetyEddie Jones, Steven J. RamsayPOPL 2021 · 被引用 3 次
- Liquid Tree AutomataAshish Mishra, Suresh JagannathanCAV 2026
- Specification-guided component-based synthesis from effectful librariesAshish Mishra, Suresh JagannathanOOPSLA 2022 · 被引用 7 次
- Combining the top-down propagation and bottom-up enumeration for inductive program synthesisWoosuk LeePOPL 2021 · 被引用 34 次
