属性文法中语义动作的合成
Synthesis of Semantic Actions in Attribute Grammars
摘要:
属性文法允许将语义动作与上下文无关文法中的产生式规则相关联,从而提供了一种简单而有效的形式主义来定义语言的语义。然而,起草语义动作可能很棘手,并且会消耗大量开发人员的时间。在这项工作中,我们提出了一个综合的方法来自动推断的语义动作,从一组的例子关联字符串的含义。我们还提出了一个新的覆盖度量,衍生覆盖。我们使用它来构建一个采样器,以有效地自动绘制字符串来驱动合成引擎。我们建立我们的想法到我们的工具,PANINI,并根据经验评估它的12个基准,包括一个前向差分引擎,一个解释器的Java字节码的一个子集,和一个迷你编译器的C语言到两个地址的代码。我们的研究结果表明,PANINI的规模以及要合成的动作的数量和上下文无关文法的大小,显着优于简单的基线。
英文摘要:
Attribute grammars allow the association of semantic actions to the production rules in context-free grammars, providing a simple yet effective formalism to define the semantics of a language. However, drafting the semantic actions can be tricky and a large drain on developer time. In this work, we propose a synthesis methodology to automatically infer the semantic actions from a set of examples associating strings to their meanings. We also propose a new coverage metric, derivation coverage. We use it to build a sampler to effectively and automatically draw strings to drive the synthesis engine. We build our ideas into our tool, PANINI, and empirically evaluate it on twelve benchmarks, including a forward differentiation engine, an interpreter over a subset of Java bytecode, and a mini-compiler for C language to two-address code. Our results show that PANINI scales well with the number of actions to be synthesized and the size of the context-free grammar, significantly outperforming simple baselines.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。