Program Synthesis by Type-Guided Abstraction Refinement

11/11/2019
by   Zheng Guo, et al.
0

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 languages like Java do scale, but only apply to components over monomorphic data and functions: polymorphic data and functions 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. We have evaluated H+ on a set of 44 queries using a set of popular Haskell libraries with a total of 291 components. Our results demonstrate that H+ returns an interesting solution within the first five results for 33 out of 44 queries. Moreover, TYGAR allows H+ to rapidly return well-typed terms, with the median time to first solution of just 1.4 seconds.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/21/2017

Program Synthesis using Abstraction Refinement

We present a new approach to example-guided program synthesis based on c...
research
09/02/2022

Type-Directed Synthesis of Visualizations from Natural Language Queries

We propose a new technique based on program synthesis for automatically ...
research
05/10/2020

Dynamic IFC Theorems for Free!

We show that noninterference and transparency, the key soundness theorem...
research
09/06/2022

Specification-Guided Component-Based Synthesis from Effectful Libraries

Component-based synthesis seeks to build programs using the APIs provide...
research
05/07/2023

Synthesizing Conjunctive Queries for Code Search

This paper presents Squid, a new conjunctive query synthesis algorithm f...
research
02/25/2021

RbSyn: Type- and Effect-Guided Program Synthesis

In recent years, researchers have explored component-based synthesis, wh...
research
07/08/2021

Duplicate-sensitivity Guided Transformation Synthesis for DBMS Correctness Bug Detection

Database Management System (DBMS) plays a core role in modern software f...

Please sign up or login with your details

Forgot password? Click here to reset