Linearly Ordered Attribute Grammars: with Automatic Augmenting Dependency Selection

L. T. V. Binsbergen, J. Bransen, A. Dijkstra
{"title":"Linearly Ordered Attribute Grammars: with Automatic Augmenting Dependency Selection","authors":"L. T. V. Binsbergen, J. Bransen, A. Dijkstra","doi":"10.1145/2678015.2682543","DOIUrl":null,"url":null,"abstract":"Attribute Grammars (AGs) extend Context-Free Grammars with attributes: information gathered on the syntax tree that adds semantics to the syntax. AGs are very well suited for describing static analyses, code-generation and other phases incorporated in a compiler. AGs are divided into classes based on the nature of the dependencies between the attributes. In this paper we examine the class of Linearly Ordered Attribute Grammars (LOAGs), for which strict, bounded size evaluators can be generated. Deciding whether an Attribute Grammar is linearly ordered is an NP-hard problem. The Ordered Attribute Grammars form a subclass of LOAG for which membership is tested in polynomial time by Kastens' algorithm (1980). On top of this algorithm we apply an augmenting dependency selection algorithm, allowing it to determine membership for the class LOAG. Although the worst-case complexity of our algorithm is exponential, the algorithm turns out to be efficient for practical full-sized AGs. As a result, we can compile the main AG of the Utrecht Haskell Compiler without the manual addition of augmenting dependencies. The reader is provided with insight in the difficulty of deciding whether an AG is linearly ordered, what optimistic choice is made by Kastens' algorithm and how augmenting dependencies can resolve these difficulties.","PeriodicalId":440670,"journal":{"name":"Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation","volume":"41 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2015-01-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"5","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 2015 Workshop on Partial Evaluation and Program Manipulation","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2678015.2682543","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 5

Abstract

Attribute Grammars (AGs) extend Context-Free Grammars with attributes: information gathered on the syntax tree that adds semantics to the syntax. AGs are very well suited for describing static analyses, code-generation and other phases incorporated in a compiler. AGs are divided into classes based on the nature of the dependencies between the attributes. In this paper we examine the class of Linearly Ordered Attribute Grammars (LOAGs), for which strict, bounded size evaluators can be generated. Deciding whether an Attribute Grammar is linearly ordered is an NP-hard problem. The Ordered Attribute Grammars form a subclass of LOAG for which membership is tested in polynomial time by Kastens' algorithm (1980). On top of this algorithm we apply an augmenting dependency selection algorithm, allowing it to determine membership for the class LOAG. Although the worst-case complexity of our algorithm is exponential, the algorithm turns out to be efficient for practical full-sized AGs. As a result, we can compile the main AG of the Utrecht Haskell Compiler without the manual addition of augmenting dependencies. The reader is provided with insight in the difficulty of deciding whether an AG is linearly ordered, what optimistic choice is made by Kastens' algorithm and how augmenting dependencies can resolve these difficulties.
线性有序属性语法:与自动增加依赖选择
属性语法(AGs)用属性扩展上下文无关语法:在语法树上收集的信息,将语义添加到语法中。AGs非常适合于描述静态分析、代码生成和编译器中包含的其他阶段。基于属性之间依赖关系的性质,AGs被划分为不同的类。在本文中,我们研究了一类线性有序属性语法(loag),可以为其生成严格的有界大小求值器。确定属性语法是否线性有序是一个np困难问题。有序属性语法是LOAG的一个子类,它的隶属性通过Kastens的算法(1980)在多项式时间内进行测试。在此算法之上,我们应用了一个增强依赖选择算法,允许它确定LOAG类的成员资格。虽然我们的算法的最坏情况复杂度是指数的,但该算法对实际的全尺寸AGs是有效的。因此,我们可以编译Utrecht Haskell编译器的主AG,而无需手动添加扩展依赖项。读者可以深入了解决定AG是否线性有序的困难,Kastens的算法做出了什么样的乐观选择,以及增加依赖关系如何解决这些困难。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信