arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2603.02260cs.PL
收藏

通过自动资源分析处理异常和效果

Handling Exceptions and Effects with Automatic Resource Analysis

Carnegie Mellon University(卡内基梅隆大学)

Ethan Chu, Yiyang Guo, Jan Hoffmann

AI总结:

本文提出了一种支持非局部控制转移的自动资源分析方法,用于处理异常和效果,通过类型系统和定理证明确保分析正确性,并在效率上表现良好。

摘要:

现有许多技术能够通过分析程序源代码自动推导参数化资源(或成本)界限。这些技术在大量程序和语言特性上效果显著。然而,为了处理异常或效果处理所需的非局部控制转移仍是一个挑战。本文提出了首个支持在异常或效果及其处理程序之间进行非局部控制转移的自动资源界限分析。该分析是类型为基础的自动摊还资源分析(AARA)的扩展,后者自动化了摊还分析的潜在方法。它针对一个带有列表和线性潜在函数的简单函数语言进行阐述。然而,这些思想可以直接应用于更丰富的环境,并且已实现于标准ML和多项式潜在函数中。除了新的异常和效果类型系统外,主要贡献是一个新颖的语法类型正确性定理,该定理确立了所推导的界限相对于基于堆栈的抽象机器的正确性。实验评估显示,新的分析能够分析现有方法无法分析的程序,且支持异常和效果处理程序的效率开销较低。

英文摘要:

There exist many techniques for automatically deriving parametric resource (or cost) bounds by analyzing the source code of a program. These techniques work effectively for a large class of programs and language features. However, non-local transfer of control as needed for exception or effect handlers has remained a challenge. This paper presents the first automatic resource bound analysis that supports non-local control transfer between exceptions or effects and their handlers. The analysis is an extension of type-based automatic amortized resource analysis (AARA), which automates the potential method of amortized analysis. It is presented for a simple functional language with lists and linear potential functions. However, the ideas are directly applicable to richer settings and implemented for Standard ML and polynomial potential functions. Apart from the new type system for exceptions and effects, a main contribution is a novel syntactic type-soundness theorem that establishes the correctness of the derived bounds with respect to a stack-based abstract machine. An experimental evaluation shows that the new analysis is capable of analyzing programs that cannot be analyzed by existing methods and that the efficiency overhead of supporting exception and effect handlers is low.

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

↑