arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1710.01291cs.PL
收藏

不仅通过示例编程

Programming Not Only by Example

Hila Peleg, Sharon Shoham, Eran Yahav

AI总结:

本文提出一种细粒度交互模型,允许程序员对合成程序的部分提供反馈,而非仅依赖示例,用户研究显示参与者更偏好此方式且反馈更快。

摘要:

近年来,自动合成技术取得了巨大进步,这些技术能够根据程序员表达的某种意图自动生成代码。合成技术采用的一个主要挑战仍然在于让程序员传达其意图。当表达的意图是粗粒度时(例如,对表达式预期类型的限制),合成器通常会生成一长串结果供程序员选择,将繁重的工作转移给用户。另一种在终端用户合成中成功使用的方法是示例编程(PBE),用户利用示例以交互和迭代的方式细化意图。然而,仅使用示例对程序员来说表达力不足,程序员可以观察生成的程序,并通过直接关联生成程序的部分来细化意图。我们提出了一种新颖的方法,使用细粒度交互模型与合成器交互。我们的方法采用丰富的交互模型,其中(i)合成器用调试信息装饰候选程序,以帮助理解程序并识别好的或坏的部分,以及(ii)允许用户不仅对程序的预期输出提供反馈,还可以对底层程序本身提供反馈。也就是说,当用户将程序识别为(部分)正确或不正确时,他们还可以明确指示好的或坏的部分,以允许合成器接受或丢弃程序的部分,而不是将整个程序丢弃。我们在受控用户研究中展示了我们方法的价值。我们的研究表明,参与者强烈偏好使用细粒度反馈而不是示例,并且能够更快地提供细粒度反馈。

英文摘要:

In recent years, there has been tremendous progress in automated synthesis techniques that are able to automatically generate code based on some intent expressed by the programmer. A major challenge for the adoption of synthesis remains in having the programmer communicate their intent. When the expressed intent is coarse-grained (for example, restriction on the expected type of an expression), the synthesizer often produces a long list of results for the programmer to choose from, shifting the heavy-lifting to the user. An alternative approach, successfully used in end-user synthesis is programming by example (PBE), where the user leverages examples to interactively and iteratively refine the intent. However, using only examples is not expressive enough for programmers, who can observe the generated program and refine the intent by directly relating to parts of the generated program. We present a novel approach to interacting with a synthesizer using a granular interaction model. Our approach employs a rich interaction model where (i) the synthesizer decorates a candidate program with debug information that assists in understanding the program and identifying good or bad parts, and (ii) the user is allowed to provide feedback not only on the expected output of a program, but also on the underlying program itself. That is, when the user identifies a program as (partially) correct or incorrect, they can also explicitly indicate the good or bad parts, to allow the synthesizer to accept or discard parts of the program instead of discarding the program as a whole. We show the value of our approach in a controlled user study. Our study shows that participants have strong preference to using granular feedback instead of examples, and are able to provide granular feedback much faster.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑