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.
SynGuar: Guaranteeing Generalization in Programming by Example
实例编程(Programming by Example,PBE)是一种程序合成范例,其中合成器创建与一组给定实例匹配的程序。在这种合成的许多应用中(例如,程序修复或逆向工程),我们要重建一个接近特定目标程序的程序,而不仅仅是产生一些满足所见示例的程序。在这种情况下,我们希望合成的程序能够很好地推广,即,在捕获目标函数行为的未观察到的示例上,尽可能少地产生错误。在本文中,我们提出了第一个框架(称为SynGuar)的PBE合成器,保证实现低泛化误差与高概率。我们的主要贡献是一个程序,动态计算有多少额外的例子足以在理论上保证推广。我们展示了我们的技术如何可以用于2个著名的合成方法:PROSE和STUN(通过统一合成),常见的字符串操作程序基准。我们发现,往往几百个例子足以证明绑定泛化错误低于$5\%$与高($\geq 98\%$)概率在这些基准。此外,我们证实了这一经验:SynGuar显着提高了现有的合成器在生成正确的目标程序的准确性。但是,由于任意选择的例子较少,相同的基线合成器(没有SynGuar)过拟合并失去准确性。
Context-Free Grammar Inference for Complex Programming Languages in Black Box Settings
Tsinghua Shenzhen International Graduate School(清华大学深圳国际研究生院);The University of Newcastle(纽卡斯尔大学);The Australian National University(澳大利亚国立大学);Central University of Finance and Economics(中央财经大学);School of Computer Science, Guangdong University of Science and Technology(广东工业大学计算机学院);Peng Cheng Laboratory(鹏城实验室)
Programming errors in traversal programs over structured data
Traffic strategies á la Strafunski和“Scrap Your Boilerplate”提供了一种非常通用和统一的方法来查询和转换深度嵌套和异构结构的数据,包括函数式编程和重写中的术语、OO编程中的对象以及XML编程中的XML文档。然而,由此产生的遍历程序容易出现编程错误。我们特别关注超出保守类型错误的错误;我们检查的示例包括发散遍历、过早终止的遍历和带有死代码的遍历。基于可能的编程错误清单,我们探讨了静态类型和静态分析的选项,以便可以避免某些类别的错误。这种探索产生了对策略库及其底层程序设计语言的改进建议。Haskell用于插图和规格说明,并提供充分的解释,以使非专业人员能够理解演示文稿。总体思想是语言不可知论的,并据此进行了总结。
Methodic of joint using the tools of automation of lexical and parsing analysis in the process of teaching the programming theory of future informatics teachers
Massachusetts Institute of Technology(麻省理工学院);Microsoft Research(微软研究院);Google Brain(谷歌大脑)
实例编程(Programming by Example,PBE)是从输入输出实例中归纳出计算机程序的任务。它可以被看作是一种机器学习,其中假设空间是某些程序设计语言中的合法程序的集合。最近的工作可微解释放松离散空间的程序到一个连续的空间,使搜索程序可以使用基于梯度的优化。虽然概念上很强大,但到目前为止,基于可微解释器的程序合成只能解决非常简单的问题。在这项工作中,我们研究建模时出现的选择,构建一个微分程序设计语言和它们的影响,成功的合成。建模选择的主要动机来自函数式编程:我们研究内存分配方案、不可变数据、类型系统和内置控制流结构的影响。从经验上讲,我们表明,将函数式编程思想到微分程序设计语言,使我们能够学习更复杂的程序比现有的微分语言是可能的。