Program synthesis by type-guided abstraction refinement

Author:

Guo Zheng1,James Michael1,Justo David1,Zhou Jiaxiao1,Wang Ziteng1,Jhala Ranjit1,Polikarpova Nadia1

Affiliation:

1. University of California at San Diego, USA

Abstract

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.

Funder

National Science Foundation

Publisher

Association for Computing Machinery (ACM)

Subject

Safety, Risk, Reliability and Quality,Software

Reference41 articles.

1. Scaling Enumerative Program Synthesis via Divide and Conquer

2. Lennart Augusstson. 2005. Djinn. https://github.com/augustss/djinn . Lennart Augusstson. 2005. Djinn. https://github.com/augustss/djinn .

3. The Localization Reduction and Counterexample-Guided Abstraction Refinement

4. Types as abstract interpretations

Cited by 22 articles. 订阅此论文施引文献 订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献

1. API-Driven Program Synthesis for Testing Static Typing Implementations;Proceedings of the ACM on Programming Languages;2024-01-05

2. Survey of intelligent program synthesis techniques;International Conference on Algorithms, High Performance Computing, and Artificial Intelligence (AHPCAI 2023);2023-12-07

3. Synthesizing MILP Constraints for Efficient and Robust Optimization;Proceedings of the ACM on Programming Languages;2023-06-06

4. Inductive Program Synthesis via Iterative Forward-Backward Abstract Interpretation;Proceedings of the ACM on Programming Languages;2023-06-06

5. Algebro-geometric Algorithms for Template-Based Synthesis of Polynomial Programs;Proceedings of the ACM on Programming Languages;2023-04-06

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3