arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1701.04288cs.FL
收藏

树-串函数的多项式时间主动合成

Polynomial-Time Proactive Synthesis of Tree-to-String Functions from Examples

Mikaël Mayer, Jad Hamza, Viktor Kuncak

摘要:

从例子合成使非专家用户能够通过指定他们行为的例子来生成程序。这种合成的特定领域形式最近已经部署在广泛使用的电子表格软件产品中。在本文中,我们有助于这样的技术的基础,并提出了一个完整的算法合成一类递归函数定义的结构递归在给定的代数数据类型定义。我们考虑的函数将代数数据类型映射到字符串;它们对于以下情况很有用,例如,漂亮的打印和序列化的程序和数据。我们将我们的问题形式化为学习确定性顺序的自上而下的树到串换能器与一个单一的状态。我们考虑的第一个问题是从用户提供的任何一组输入/输出示例中学习树到字符串转换器。我们表明,这个问题是NP-完全的一般情况下,但可以解决在多项式时间下(实际上有用的)封闭条件下,每个子树的树的输入/输出的例子集也是输入/输出的例子。由于提出相关的输入/输出的例子可能是困难的用户,同时创建硬约束问题的合成器,我们还研究了一个更自动化的主动学习的情况下,算法选择的输入,用户提供的输出。我们的算法要求一个最坏情况下的线性数量的查询作为代数数据类型定义的大小的函数,以确定一个唯一的换能器。

英文摘要:

Synthesis from examples enables non-expert users to generate programs by specifying examples of their behavior. A domain-specific form of such synthesis has been recently deployed in a widely used spreadsheet software product. In this paper we contribute to foundations of such techniques and present a complete algorithm for synthesis of a class of recursive functions defined by structural recursion over a given algebraic data type definition. The functions we consider map an algebraic data type to a string; they are useful for, e.g., pretty printing and serialization of programs and data. We formalize our problem as learning deterministic sequential top-down tree-to-string transducers with a single state. The first problem we consider is learning a tree-to-string transducer from any set of input/output examples provided by the user. We show that this problem is NP-complete in general, but can be solved in polynomial time under a (practically useful) closure condition that each subtree of a tree in the input/output example set is also part of the input/output examples. Because coming up with relevant input/output examples may be difficult for the user while creating hard constraint problems for the synthesizer, we also study a more automated active learning scenario in which the algorithm chooses the inputs for which the user provides the outputs. Our algorithm asks a worst-case linear number of queries as a function of the size of the algebraic data type definition to determine a unique transducer.

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

↑