跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 计算复杂性

arXiv:2407.13671 (cs)
[提交于 2024年7月18日]

标题:Liquid Amortization: Proving Amortized Complexity with LiquidHaskell (Functional Pearl)

作者:Jan van Brügge
查看论文《Liquid Amortization: Proving Amortized Complexity with LiquidHaskell (Functional Pearl)》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Formal reasoning about the time complexity of algorithms and data structures is usually done in interactive theorem provers like Isabelle/HOL. This includes reasoning about amortized time complexity which looks at the worst case performance over a series of operations. However, most programs are not written within a theorem prover and thus use the data structures of the production language. To verify the correctness it is necessary to translate the data structures from the production language into the language of the prover. Such a translation step could introduce errors, for example due to a mismatch in features between the two languages. We show how to prove amortized complexity of data structures directly in Haskell using LiquidHaskell. Besides skipping the translation step, our approach can also provide a didactic advantage. Learners do not have to learn an additional language for proofs and can focus on the new concepts only. For this paper, we do not assume prior knowledge of amortized complexity as we explain the concepts and apply them in our first case study, a simple stack with multipop. Moving to more complicated (and useful) data structures, we show that the same technique works for binomial heaps which can be used to implement a priority queue. We also prove amortized complexity bounds for Claessen's version of the finger tree, a sequence-like data structure with constant-time cons/uncons on either end. Finally we discuss the current limitations of LiquidHaskell that made certain versions of the data structures not feasible.
评论: 12 pages, 1 figure, to be published in Haskell'24
主题: 计算复杂性 (cs.CC)
引用方式: arXiv:2407.13671 [cs.CC]
  (或者 arXiv:2407.13671v1 [cs.CC] 对于此版本)
  https://doi.org/10.48550/arXiv.2407.13671
相关 DOI: https://doi.org/10.1145/3677999.3678282

提交历史

来自:Jan Van Brügge
[v1] 2024年7月18日 星期四 16:47:34 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.CC
< 上一篇   |   下一篇 >
最新 | 近期 | 2024-07
切换浏览方式为:
cs

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站