We present AlgCo (Algebraic Coinductives), a practical framework for inductive reasoning over commonly used coinductive types such as conats, streams, and infinitary trees with finite branching factor. The key idea is to exploit the notion of algebraic complete partial order from domain theory to define continuous operations over coinductive types via primitive recursion on ``dense'' collections of their elements, enabling a convenient strategy for reasoning about algebraic coinductives by straightforward proofs by induction. We implement the AlgCo framework in Coq and demonstrate its power by verifying a stream variant of the sieve of Eratosthenes, a regular expression library based on coinductive trie encodings of formal languages, and expected value semantics for coinductive sampling processes over discrete probability distributions in the random bit model.
翻译:我们提出了AlgCo(代数共归),这是一个实用的框架,用于归纳推理常用的联合归纳类型,例如conats,streams和具有有限分枝因子的无穷树。关键思想是利用来自域论的代数完全偏序概念,通过对其元素的“密集”集合进行原始递归,定义连续操作,从而实现对联合归纳类型的便捷推理策略,通过归纳证明直接实现。我们在Coq中实现了AlgCo框架,并通过验证Eratosthenes筛选器的流变体,基于共归字典树编码的正则表达式库,以及在随机位模型中对离散概率分布的共归抽样过程的期望值语义展示了其功能。