arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2404.03641cs.PLcs.DSmath.CT
收藏

通过余代数进行摊销分析

Amortized Analysis via Coalgebra

Harrison Grodin, Robert Harper

AI总结:

本文提出一种基于余代数的摊销分析新视角,将势函数泛化为余代数态射,并扩展至双范畴与索引范畴,以支持不精确上界及组合实现。

摘要:

摊销分析是一种针对数据结构进行成本分析的技术,其中成本以聚合方式研究:而非考虑单个操作的最大成本,而是限制整个会话期间所遇到的总成本。传统上,摊销分析以归纳方式表述,对操作序列的有限长度进行量化。结合先前关于数据结构余代数语义的工作,我们发展出另一种视角,即摊销分析自然地在成本代数范畴中以余代数方式看待,其中余代数态射作为势函数的一等泛化,适合整合成本与行为。利用这一简单定义,我们考虑了其他样本效应、非交换打印和随机化的摊销。为了支持不精确的摊销上界,我们将讨论调整到双范畴设置,其中势函数是余代数的余松弛态射。我们通过使用内射函子的余代数而非内函子,同时支持代数与余代数操作,利用底层范畴上的幺半结构组合势。最后,我们在余代数的索引范畴中组合摊销论证,以基于其他数据结构实现一种摊销数据结构。

英文摘要:

Amortized analysis is a cost analysis technique for data structures in which cost is studied in aggregate: rather than considering the maximum cost of a single operation, one bounds the total cost encountered throughout a session. Traditionally, amortized analysis has been phrased inductively, quantifying over finite sequences of operations. Connecting to prior work on coalgebraic semantics for data structures, we develop the alternative perspective that amortized analysis is naturally viewed coalgebraically in a category of cost algebras, where a morphism of coalgebras serves as a first-class generalization of potential function suitable for integrating cost and behavior. Using this simple definition, we consider amortization of other sample effects, non-commutative printing and randomization. To support imprecise amortized upper bounds, we adapt our discussion to the bicategorical setting, where a potential function is a colax morphism of coalgebras. We support algebraic and coalgebraic operations simultaneously by using coalgebras for an endoprofunctor instead of an endofunctor, combining potential using a monoidal structure on the underlying category. Finally, we compose amortization arguments in the indexed category of coalgebras to implement one amortized data structure in terms of others.

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

↑