Many tools used to process programs, like compilers, analyzers, or verifiers, perform transformations on their intermediate program representation, like abstract syntax trees. Implementing such program transformations is a non-trivial task, since it is necessary to iterate over the complete syntax tree and apply various transformations at nodes in a tree. In this paper we show how the features of functional logic programming are useful to implement program transformations in a compact and comprehensible manner. For this purpose, we propose to write program transformations as partially defined and non-deterministic operations. Since the implementation of non-determinism usually causes some overhead compared to deterministically defined operations, we compare our approach to a deterministic transformation method. We evaluate these alternatives for the functional logic language Curry and its intermediate representation FlatCurry which is used in various analysis and verification tools and compilers.


翻译:许多用于处理程序的工具,如编译器、分析器或验证器,都会对其中间程序表示(如抽象语法树)执行变换。实现此类程序变换是一项非平凡的任务,因为必须遍历完整的语法树并在树节点上应用各种变换。本文展示了函数式逻辑编程的特性如何有助于以紧凑且易于理解的方式实现程序变换。为此,我们提出将程序变换编写为部分定义且非确定性的操作。由于非确定性的实现通常比确定性定义的操作带来一定的开销,我们将我们的方法与一种确定性变换方法进行了比较。我们针对函数式逻辑语言Curry及其在多种分析、验证工具和编译器中使用的中间表示FlatCurry,对这些替代方案进行了评估。

0
下载
关闭预览

相关内容

【2022新书】Python数学逻辑,285页pdf
专知会员服务
68+阅读 · 2022年11月24日
【经典书】算法C语言实现,Algorithms in C. 672页pdf
专知会员服务
82+阅读 · 2020年8月13日
自动结构变分推理,Automatic structured variational inference
专知会员服务
41+阅读 · 2020年2月10日
【2022新书】Python数学逻辑,285页pdf
专知
13+阅读 · 2022年11月24日
百闻不如一码!手把手教你用Python搭一个Transformer
大数据文摘
18+阅读 · 2019年4月22日
多图带你读懂 Transformers 的工作原理
AI研习社
10+阅读 · 2019年3月18日
【干货】深入理解变分自编码器
专知
21+阅读 · 2018年3月22日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
21+阅读 · 2013年12月31日
Arxiv
0+阅读 · 1月13日
VIP会员
相关VIP内容
【2022新书】Python数学逻辑,285页pdf
专知会员服务
68+阅读 · 2022年11月24日
【经典书】算法C语言实现,Algorithms in C. 672页pdf
专知会员服务
82+阅读 · 2020年8月13日
自动结构变分推理,Automatic structured variational inference
专知会员服务
41+阅读 · 2020年2月10日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
21+阅读 · 2013年12月31日
Top
微信扫码咨询专知VIP会员