Structural recursion is a common technique used by programmers in modern languages and is taught to introductory computer science students. But what about its dual, structural corecursion? Structural corecursion is an elegant technique, supported in languages like Haskell and proof assistants such as Rocq or Agda. It enables the design of compositional algorithms by decoupling the generation and consumption of potentially infinite or large data collections. Despite these strengths, structural corecursion is generally considered more advanced than structural recursion and is primarily studied in the context of pure functional programming. Our aim is to illustrate the expressive power of different notions of structural corecursion in the presence of classical reasoning. More specifically, we study coiteration and corecursion combined with the classical callcc operator, which provides a computational interpretation of classical reasoning. This combination enables interesting stream-processing algorithms. As an application, we present a corecursive, control-based proof of the Infinite Pigeonhole Principle and compare it with the continuation-passing proof of Escardó and Oliva in Agda. To further demonstrate the power of mixing corecursion and control, we give an implementation of the Axiom of Countable Choice. In contrast to the usual continuation-passing implementations of this axiom, which rely on general recursion whose termination is established externally, our approach justifies termination by coiteration alone.


翻译:结构递归是现代编程语言中程序员常用的技术,也是计算机科学入门课程的教学内容。但其对偶概念——结构共递归呢?结构共递归是一种优雅的技术,在Haskell等语言以及Rocq或Agda等证明助手中得到支持。它通过解耦潜在无限或大规模数据集合的生成与消费,实现了组合式算法的设计。尽管具有这些优势,结构共递归通常被认为比结构递归更高级,且主要在纯函数式编程的语境中被研究。我们的目标在于阐明在经典推理存在下,不同结构共递归概念的表达能力。具体而言,我们研究了与经典callcc算子相结合的共迭代与共递归,该算子为经典推理提供了计算解释。这种结合催生了有趣的流处理算法。作为应用,我们提出了基于控制的结构共递归对无限鸽巢原理的证明,并与Escardó和Oliva在Agda中基于延续传递风格的证明进行了比较。为进一步展示共递归与控制机制融合的威力,我们实现了可数选择公理。与此公理通常依赖外部验证终止性的一般递归的延续传递实现不同,我们的方法仅通过共迭代即可论证终止性。

0
下载
关闭预览

相关内容

连续表示方法、理论与应用:综述与前瞻
专知会员服务
23+阅读 · 2025年5月28日
专知会员服务
88+阅读 · 2021年5月30日
伊利诺伊《算法》书籍,集20年之大成,附472页pdf
专知会员服务
65+阅读 · 2020年9月27日
【干货书】计算机科学离散数学,627页pdf
专知
65+阅读 · 2020年8月31日
完备的 AI 学习路线,最详细的资源整理!
新智元
18+阅读 · 2019年5月4日
类脑计算的前沿论文,看我们推荐的这7篇
人工智能前沿讲习班
21+阅读 · 2019年1月7日
图神经网络最近这么火,不妨看看我们精选的这七篇
人工智能前沿讲习班
37+阅读 · 2018年12月10日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
VIP会员
最新内容
国外海军作战管理系统与作战训练系统
专知会员服务
0+阅读 · 今天4:16
美军条令《海军陆战队规划流程(2026版)》
专知会员服务
4+阅读 · 今天3:36
《压缩式分布式交互仿真标准》120页
专知会员服务
3+阅读 · 今天3:21
《电子战数据交换模型研究报告》
专知会员服务
4+阅读 · 今天3:13
《基于Transformer的异常舰船导航识别与跟踪》80页
《低数据领域军事目标检测模型研究》
专知会员服务
4+阅读 · 今天2:37
【CMU博士论文】物理世界的视觉感知与深度理解
伊朗战争停火期间美军关键弹药状况分析
专知会员服务
8+阅读 · 4月22日
电子战革命:塑造战场的十年突破(2015–2025)
相关VIP内容
连续表示方法、理论与应用:综述与前瞻
专知会员服务
23+阅读 · 2025年5月28日
专知会员服务
88+阅读 · 2021年5月30日
伊利诺伊《算法》书籍,集20年之大成,附472页pdf
专知会员服务
65+阅读 · 2020年9月27日
相关基金
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
12+阅读 · 2014年12月31日
国家自然科学基金
2+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员