Strategic term rewriting and attribute grammars are two powerful programming techniques widely used in language engineering. The former, relies on strategies to apply term rewrite rules in defining language transformations, while the latter is suitable to express context-dependent language processing algorithms. Each of these techniques, however, is usually implemented by its own powerful and large language processor system. As a result, it makes such systems harder to extend and to combine. In this paper, we present the embedding of both strategic tree rewriting and attribute grammars in a zipper-based, purely functional setting. Zippers provide a simple, but generic tree-walk mechanism that is the building block technique we use to express the purely-functional embedding of both techniques. The embedding of the two techniques in the same setting has several advantages: First, we easily combine/zip attribute grammars and strategies, thus providing language engineers the best of the two worlds. Second, the combined embedding is easier to maintain and extend since it is written in a concise and uniform setting. This results in a very small library which is able to express advanced (static) analysis and transformation tasks. We show the expressive power of our library in optimizing Haskell let expressions, expressing several Haskell refactorings and solving several language processing tasks of the LDTA Tool Challenge.


翻译:战略术语重写和属性语法是语言工程中广泛使用的两种强有力的编程技术。前者依赖在定义语言转换时适用术语重写规则的战略,后者则适合表达基于背景的语文处理算法。然而,这些技术中的每一种通常都由其本身的强大和大型语言处理系统实施。因此,这些系统更难扩展和合并。在本文件中,我们介绍将战略树重写和属性语法都嵌入一个基于拉链的纯功能性设置中。Zippers提供了一个简单但通用的树道机制,这是我们用来表达两种技术纯功能嵌入的建筑块技术。在同一环境中嵌入两种技术有若干优点:首先,我们很容易地将语法与战略结合起来/齐普属性,从而向语言工程师提供两种世界的最佳语言。第二,合并嵌入更容易维护和扩展,因为其以简洁和统一的设置为基础。这导致一个非常小的图书馆能够表达先进的(静态)树行走机制,这是我们用来表达两种技术纯功能嵌入两种技术的建筑块技术。在同一环境中嵌入这两种技术具有若干优点:首先,我们很容易地将拼写成一个表达我们最先进的(静)处理任务的图书馆,然后显示某种语言变压。

0
下载
关闭预览

相关内容

Haskell 是一种纯函数式编程语言,于 1990 年在编程语言 Miranda 的基础上标准化,并且以 λ 演算为基础发展而来。
【CVPR 2021】变换器跟踪TransT: Transformer Tracking
专知会员服务
21+阅读 · 2021年4月20日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
77+阅读 · 2020年7月26日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
57+阅读 · 2019年10月17日
强化学习最新教程,17页pdf
专知会员服务
174+阅读 · 2019年10月11日
机器学习入门的经验与建议
专知会员服务
92+阅读 · 2019年10月10日
CCF推荐 | 国际会议信息6条
Call4Papers
9+阅读 · 2019年8月13日
计算机类 | PLDI 2020等国际会议信息6条
Call4Papers
3+阅读 · 2019年7月8日
计算机 | 入门级EI会议ICVRIS 2019诚邀稿件
Call4Papers
10+阅读 · 2019年6月24日
Hierarchically Structured Meta-learning
CreateAMind
24+阅读 · 2019年5月22日
学术会议 | 知识图谱顶会 ISWC 征稿:Poster/Demo
开放知识图谱
5+阅读 · 2019年4月16日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
gan生成图像at 1024² 的 代码 论文
CreateAMind
4+阅读 · 2017年10月31日
Arxiv
0+阅读 · 2021年12月13日
Embedding Logical Queries on Knowledge Graphs
Arxiv
3+阅读 · 2019年2月19日
Adversarial Metric Attack for Person Re-identification
VIP会员
相关VIP内容
【CVPR 2021】变换器跟踪TransT: Transformer Tracking
专知会员服务
21+阅读 · 2021年4月20日
Linux导论,Introduction to Linux,96页ppt
专知会员服务
77+阅读 · 2020年7月26日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
57+阅读 · 2019年10月17日
强化学习最新教程,17页pdf
专知会员服务
174+阅读 · 2019年10月11日
机器学习入门的经验与建议
专知会员服务
92+阅读 · 2019年10月10日
相关资讯
CCF推荐 | 国际会议信息6条
Call4Papers
9+阅读 · 2019年8月13日
计算机类 | PLDI 2020等国际会议信息6条
Call4Papers
3+阅读 · 2019年7月8日
计算机 | 入门级EI会议ICVRIS 2019诚邀稿件
Call4Papers
10+阅读 · 2019年6月24日
Hierarchically Structured Meta-learning
CreateAMind
24+阅读 · 2019年5月22日
学术会议 | 知识图谱顶会 ISWC 征稿:Poster/Demo
开放知识图谱
5+阅读 · 2019年4月16日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
16+阅读 · 2018年12月24日
【推荐】自然语言处理(NLP)指南
机器学习研究会
35+阅读 · 2017年11月17日
gan生成图像at 1024² 的 代码 论文
CreateAMind
4+阅读 · 2017年10月31日
Top
微信扫码咨询专知VIP会员