arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2601.12943cs.PL
收藏

依赖类型AARA:一种非仿射方法用于高阶程序的资源分析

Dependently-Typed AARA: A Non-Affine Approach for Resource Analysis of Higher-Order Programs

Princeton University(普林斯顿大学);Key Lab of HCST (PKU), MOE(北京大学计算机辅助设计与图形学教育部重点实验室;北京大学信息科学技术学院);SCS, Peking University

Han Xu, Di Wang

AI总结:

本文提出了一种非仿射依赖类型系统,用于高阶程序的资源分析,通过解耦资源与类型并采用非仿射类型机制,以提高资源行为推导的精度。

摘要:

静态资源分析旨在在不执行程序的情况下确定其资源消耗(例如时间复杂度)。在众多现有的资源分析方法中,仿射类型系统曾是主流方法之一。然而,这些仿射类型系统在推导高阶程序的精确资源行为方面存在不足,尤其是在涉及部分应用的情况下。本文提出了λ_amor^na,一种非仿射的AARA风格依赖类型系统,用于对高阶函数程序进行资源推理。关键观察是,先前方法的主要问题来自(i)类型与资源的紧密耦合,以及(ii)仿射与高阶类型机制之间的冲突。为了推导高阶函数的精确资源行为,λ_amor^na将资源与类型解耦,并采用非仿射类型机制。λ_amor^na的非仿射类型系统通过使用依赖类型实现这一点,允许在类型级别上表达潜在函数,而无需普通类型。本文正式化了λ_amor^na的语法和语义,并证明了其正确性,从而保证了资源界限的正确性。几个具有挑战性的经典和高阶示例被提出,以展示λ_amor^na的推理能力的表达性和组合性。

英文摘要:

Static resource analysis determines the resource consumption (e.g., time complexity) of a program without executing it. Among the numerous existing approaches for resource analysis, affine type systems have been one dominant approach. However, these affine type systems fall short of deriving precise resource behavior of higher-order programs, particularly in cases that involve partial applications. This article presents λ_\ms{amor}^\ms{na}}, a non-affine AARA-style dependent type system for resource reasoning about higher-order functional programs. The key observation is that the main issue in previous approaches comes from (i) the close coupling of types and resources, and (ii) the conflict between affine and higher-order typing mechanisms. To derive precise resource behavior of higher-order functions, λ_\ms{amor}^\ms{na}} decouples resources from types and follows a non-affine typing mechanism. The non-affine type system of λ_\ms{amor}^\ms{na}} achieves this by using dependent types, which allows expressing type-level potential functions separate from ordinary types. This article formalizes λ_\ms{amor}^\ms{na}}'s syntax and semantics, and proves its soundness, which guarantees the correctness of resource bounds. Several challenging classic and higher-order examples are presented to demonstrate the expressiveness and compositionality of λ_\ms{amor}^\ms{na}}'s reasoning capability.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑