Skip to main content
QUICK REVIEW

[论文解读] Functional Logic Program Transformations

Hanus Michael, Steven Libby|arXiv (Cornell University)|Jan 19, 2026
Logic, programming, and type systems被引用 0
一句话总结

论文提出在 Curry 的函数式逻辑编程中实现程序转换的方法,利用非确定性和函数式模式来创建紧凑、模块化的转换,并在 FlatCurry 表示上比较非确定性与确定性方法的差异。

ABSTRACT

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.

研究动机与目标

  • 将程序转换作为编译器、分析器和验证器的工具进行动机阐述和研究。
  • 展示函数式逻辑编程如何促进紧凑且易懂的转换定义。
  • 给出一种表示(FlatCurry)并演示将转换定义为部分定义的、非确定性的操作。
  • 在 Curry 及其 FlatCurry 中间表示上评估非确定性与确定性转换方法的对比。

提出的方法

  • 将程序转换定义为在 Curry 中的部分定义和非确定性操作。
  • 使用函数式模式在转换中表达深度模式匹配。
  • 将 FlatCurry 作为中间表示来定位和操作转换后的程序。
  • 解释封装搜索以管理转换中的非确定性与失败。
  • 在实现和开销方面比较非确定性转换定义与确定性转换定义。
  • 提供示例(例如在列表中插入某个位置)来展示转换定义。

实验结果

研究问题

  • RQ1如何使用 Curry 的函数式逻辑特性以模块化、易理解的方式表达程序转换?
  • RQ2非确定性与确定性转换定义的优缺点(如开销)分别是什么?
  • RQ3这些转换方法在 Curry 程序和 FlatCurry 中间表示上的适用性如何?
  • RQ4函数式模式和封装搜索在表达和控制转换方面扮演什么角色?

主要发现

  • 函数式逻辑特性使程序转换的表示紧凑且模块化。
  • 带封装搜索的非确定性操作能够简明地表达转换,并在适当时处理多结果。
  • 函数式模式允许在转换中进行深度、潜在任意深度的模式匹配,从而提升表达力。
  • 研究包括对 Curry/FlatCurry 环境下非确定性与确定性转换方法的对比评估。
  • FlatCurry 作为在基于 Curry 的工具中应用和评估转换的实际中间形式。

更好的研究,从现在开始

从论文设计到论文写作,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。