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

持久的摊还分析,操作性

Persistent Amortised Analysis, Operationally

University of Edinburgh(爱丁堡大学)

Anton Lorenzen

AI总结:

本文探讨持久数据结构中摊还分析的适用性,指出传统方法在持久场景下失效,但通过在thunks上存储信用,信用基摊还分析仍可成立,同时提出debit方法的正式语义。

摘要:

摊还分析是一种用于证明数据结构一批操作总时间上界的技术,即使某些操作昂贵。但传统摊还分析在持久数据结构使用时会得出错误的时间上界。持久性允许对数据结构的先前版本进行操作,这阻止了昂贵重构工作的摊还。在 seminal 书籍中,Chris Okasaki 展示了如何将摊还分析扩展到持久使用。他的方法通过在数据结构中添加 thunks 并使用 debits 而不是 credits 进行分析。他的论点,即 credits 对持久使用分析来说是不合理的,已成为 folklore。在本文中,我们提供了一种新的视角来看待 Okasaki 工作中的 debits。首先,我们设定了 call-by-value lambda 计算机的 operational 语义,包含 thunks,并正式展示传统摊还分析在持久设置下不适用。然后我们表明,与 folklore 相反,只要 credits 仅存储在 thunks 上,基于 credit 的摊还分析在持久设置下仍可成立。最后,我们为 Okasaki 的 debit-based 方法提供正式语义。本文澄清了 Okasaki 工作的形式基础,并使其对更广泛的受众可访问。

英文摘要:

Amortised analysis is a technique for proving a combined time bound for a batch of operations on a data structure, even if some of those operations are expensive. But the traditional method of amortised analysis yields incorrect time bounds when the data structure is used persistently. Persistence allows operations to be performed on previous versions of the data structure, which prevents us from amortising expensive restructuring work. In his seminal book, Chris Okasaki showed how to extend amortised analysis to persistent usage. His method works by extending the data structure with thunks and performing the analysis with debits rather than credits. His argument, that credits are unsound for analysing persistent usage, has become folklore. In this paper, we provide a new perspective on the role of debits in Okasaki's work. First, we set up an operational semantics of call-by-value lambda calculus with thunks, and show formally that traditional amortised analysis does not work in a persistent setting. Then we show that, contrary to the folklore, credit-based amortised analysis can be sound in a persistent setting as long as credits are only stored on thunks. Finally, we provide a formal semantics for Okasaki's debit-based approach. Our paper clarifies the formal foundation of Okasaki's work and makes it accessible to a wider audience.

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

↑