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 $\lambda_{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.


翻译:近年来,研究人员探索了基于组件的合成,目的是自动构建通过向现有API发送电话而运作的程序。然而,先前的工作并未考虑对具有副作用的方法进行高效的合成,例如更新数据库的网络应用方法。在本论文中,我们为Ruby引入了RbSyn,这是一个新的类型和效果指导合成工具。RbSyn合成目标被指定为目标方法的类型和必须通过的一系列测试案例。RbSyn工作通过反复生成与测试案例的读写效果相匹配的正确类型候选方法机构来进行运行。在找到一套单独满足每次测试的、具有副作用的候选者之后,RbSyn综合了一个在适当条件下执行正确候选人代码的解决方案。我们将RbSyn正规化为核心、目标导向的语言 $\lambda ⁇ syn} 。 RbSyn合成目标被指定为目标方法的类型类型类型和测试案例系列。我们用19个基准来评估RbSyn,其中12个基准的写法来自普通、开源的缩略缩缩缩图。我们发现,在使用正确基准第15秒内,我们用精确的缩缩缩缩缩缩的缩写基准,在基准中,在10秒内,我们用精确的缩写基准中发现所有基准。

0
下载
关闭预览

相关内容

Ruby 是一种面向对象、命令式、函数式、动态的通用编程语言。
Linux导论,Introduction to Linux,96页ppt
专知会员服务
76+阅读 · 2020年7月26日
【经典书】贝叶斯编程,378页pdf,Bayesian Programming
专知会员服务
244+阅读 · 2020年5月18日
【2020新书】C++20 特性 第二版,A Problem-Solution Approach
专知会员服务
56+阅读 · 2020年4月26日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
144+阅读 · 2019年10月12日
【新书】Python编程基础,669页pdf
专知会员服务
186+阅读 · 2019年10月10日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
39+阅读 · 2019年10月9日
无监督元学习表示学习
CreateAMind
26+阅读 · 2019年1月4日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
机器人开发库软件大列表
专知
10+阅读 · 2018年3月18日
gan生成图像at 1024² 的 代码 论文
CreateAMind
4+阅读 · 2017年10月31日
【论文】图上的表示学习综述
机器学习研究会
12+阅读 · 2017年9月24日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Arxiv
0+阅读 · 2021年4月19日
Arxiv
1+阅读 · 2021年4月19日
Arxiv
0+阅读 · 2021年4月16日
Arxiv
0+阅读 · 2021年4月16日
VIP会员
相关资讯
无监督元学习表示学习
CreateAMind
26+阅读 · 2019年1月4日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
meta learning 17年:MAML SNAIL
CreateAMind
11+阅读 · 2019年1月2日
Hierarchical Disentangled Representations
CreateAMind
4+阅读 · 2018年4月15日
机器人开发库软件大列表
专知
10+阅读 · 2018年3月18日
gan生成图像at 1024² 的 代码 论文
CreateAMind
4+阅读 · 2017年10月31日
【论文】图上的表示学习综述
机器学习研究会
12+阅读 · 2017年9月24日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
Top
微信扫码咨询专知VIP会员