RbSyn: Type- and Effect-Guided Program Synthesis

02/25/2021
by   Sankha Narayan Guria, et al.
0

In recent years, researchers have explored component-based synthesis, which aims to automatically construct programs that operate by composing calls to existing APIs. However, prior work has not considered efficient synthesis of methods with side effects, e.g., web app methods that update a database. In this paper, we introduce RbSyn, a novel type- and effect-guided synthesis tool for Ruby. An RbSyn synthesis goal is specified as the type for the target method and a series of test cases it must pass. RbSyn works by recursively generating well-typed candidate method bodies whose write effects match the read effects of the test case assertions. After finding a set of candidates that separately satisfy each test, RbSyn synthesizes a solution that branches to execute the correct candidate code under the appropriate conditions. We formalize RbSyn on a core, object-oriented language λ_syn and describe how the key ideas of the model are scaled-up in our implementation for Ruby. We evaluated RbSyn on 19 benchmarks, 12 of which come from popular, open-source Ruby apps. We found that RbSyn synthesizes correct solutions for all benchmarks, with 15 benchmarks synthesizing in under 9 seconds, while the slowest benchmark takes 83 seconds. Using observed reads to guide synthesize is effective: using type-guidance alone times out on 10 of 12 app benchmarks. We also found that using less precise effect annotations leads to worse synthesis performance. In summary, we believe type- and effect-guided synthesis is an important step forward in synthesis of effectful methods from test cases.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
02/25/2023

Absynthe: Abstract Interpretation-Guided Synthesis

Synthesis tools have seen significant success in recent times. However, ...
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...
research
07/21/2014

Are There Good Mistakes? A Theoretical Analysis of CEGIS

Counterexample-guided inductive synthesis CEGIS is used to synthesize pr...
research
07/20/2020

SynRG: Syntax Guided Synthesis of Expressions with Alternating Quantifiers

Program synthesis is the task of automatically generating expressions th...
research
11/11/2019

Program Synthesis by Type-Guided Abstraction Refinement

We consider the problem of type-directed component based synthesis where...
research
03/30/2022

Type-Directed Program Synthesis for RESTful APIs

With the rise of software-as-a-service and microservice architectures, R...
research
10/26/2018

Synthesizing Symmetric Lenses

Lenses are programs that can be run both "front to back" and "back to fr...

Please sign up or login with your details

Forgot password? Click here to reset