一句话:提出 Smyth,用实时双向求值将断言求值产生的示例反向传播,指导类型化函数式程序草图中洞的补全。
基于示例的综合常要求 trace-complete 示例才能合成递归函数,规格负担重。本文提出 Smyth:在带类型函数式语言中进行程序草图,断言具体求值产生示例,并通过 live bidirectional evaluation 将示例沿部分求值表达式反向传播以补全空洞;因此无需 trace-complete 示例即可合成递归函数,并支持相互依赖的综合目标。在 Myth 基准上,无部分实现时 Smyth 平均只需 Myth 约 66% 的专家示例;对随机示例较稳健;用户草图进一步降低总规格负担;Leon 与 Synquid 在若干任务上失败而 Smyth 成功。
We present a system called Smyth for program sketching in a typed functional language whereby the concrete evaluation of ordinary assertions gives rise to input-output examples, which are then used to guide the search to complete the holes. The key innovation, called live bidirectional evaluation, propagates examples "backward" through partially evaluated sketches. Live bidirectional evaluation enables Smyth to (a) synthesize recursive functions without trace-complete sets of examples and (b) specify and solve interdependent synthesis goals. Eliminating the trace-completeness requirement resolves a significant limitation faced by prior synthesis techniques when given partial specifications in the form of input-output examples. To assess the practical implications of our techniques, we ran several experiments on benchmarks used to evaluate Myth, a state-of-the-art example-based synthesis tool. First, given expert examples (and no partial implementations), we find that Smyth requires on average 66% of the number of expert examples required by Myth. Second, we find that Smyth is robust to randomly-generated examples, synthesizing many tasks with relatively few more random examples than those provided by an expert. Third, we create a suite of small sketching tasks by systematically employing a simple sketching strategy to the Myth benchmarks; we find that user-provided sketches in Smyth often further reduce the total specification burden (i.e. the combination of partial implementations and examples). Lastly, we find that Leon and Synquid, two state-of-the-art logic-based synthesis tools, fail to complete several tasks on which Smyth succeeds.
@article{LubinCOC20,
title = {Program sketching with live bidirectional evaluation},
author = {Justin Lubin and Nick Collins and Cyrus Omar and Ravi Chugh},
journal = {Proceedings of the ACM on Programming Languages},
volume = {4},
number = {ICFP},
year = {2020},
doi = {10.1145/3408991}
}