[论文解读] Complexity of Fractran and Productivity
本文通过将 Fractran 程序编码为流规范,确立了函数式编程中生产力的计算复杂度,证明在最外层公平求值下,生产力问题是 Π⁰₂-完全的。此外,还表明广义的生产力概念——强生产力与弱生产力——在解析层次上具有高度的复杂性,分别达到 Π¹₁-完全与 Σ¹₁-完全,表明生产力在表达能力上严格强于终止性。
In functional programming languages the use of infinite structures is common practice. For total correctness of programs dealing with infinite structures one must guarantee that every finite part of the result can be evaluated in finitely many steps. This is known as productivity. For programming with infinite structures, productivity is what termination in well-defined results is for programming with finite structures. Fractran is a simple Turing-complete programming language invented by Conway. We prove that the question whether a Fractran program halts on all positive integers is Pi^0_2-complete. In functional programming, productivity typically is a property of individual terms with respect to the inbuilt evaluation strategy. By encoding Fractran programs as specifications of infinite lists, we establish that this notion of productivity is Pi^0_2-complete even for the most simple specifications. Therefore it is harder than termination of individual terms. In addition, we explore possible generalisations of the notion of productivity in the framework of term rewriting, and prove that their computational complexity is Pi^1_1-complete, thus exceeding the expressive power of first-order logic.
研究动机与目标
- 确定函数式编程中生产力的计算复杂度,特别是针对无限数据结构的情形。
- 研究在两者均为程序正确性所必需的前提下,生产力是否比终止性更难判定。
- 将生产力的概念推广至标准求值策略之外,并分析其逻辑复杂度。
- 提供一种新的、简化的 Fractran 程序到流规范的编码方式,以建立复杂度界限。
提出的方法
- 将 Fractran 程序编码为懒惰流格式(LSF)中的流规范,仅使用基本的流构造器以及 head、tail 和 mod 等函数。
- 定义一个项重写系统(TRS),其中每个 Fractran 分数对应一个基于模算术和流索引的条件重写规则。
- 通过模算术将整数映射到流位置,以模拟 Fractran 的乘法与选择过程。
- 证明一个 Fractran 程序在所有输入上均停机,当且仅当其对应的流规范在最外层公平求值下是生产力的。
- 将 Fractran 的统一停机问题归约到生产力问题,以证明其为 Π⁰₂-难。
- 将分析扩展至强生产力与弱生产力,证明其复杂度分别位于解析层次的 Π¹₁ 与 Σ¹₁。
实验结果
研究问题
- RQ1函数式编程中的生产力是否可判定,其精确的计算复杂度是什么?
- RQ2生产力的复杂度与项重写系统中终止性的复杂度相比如何?
- RQ3Fractran 能否用作最小化编码,以建立生产力复杂度的下界?
- RQ4强生产力与弱生产力等广义生产力概念的复杂度是什么?
- RQ5像源自 Fractran 的简单流规范的生产力问题,是否可能不可判定或具有解析复杂度?
主要发现
- 判断一个 Fractran 程序是否在所有正整数输入上均停机的问题是 Π⁰₂-完全的。
- 在最外层公平求值下,生产力问题同样是 Π⁰₂-完全的,即使对于非常简单的流规范也是如此。
- 强生产力(要求所有最外层公平求值序列均能到达构造器正规形式)是 Π¹₁-完全的。
- 弱生产力(仅要求存在一个此类序列)是 Σ¹₁-完全的。
- 将 Fractran 编码为流规范的过程保持了停机行为与生产力特性,从而实现了复杂度的转移。
- 结果表明,生产力的复杂度严格高于终止性,因其位于算术层次更高的位置。
更好的研究,从现在开始
从阅读论文到最终审阅,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。