arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2207.03994cs.PLcs.LO
收藏

LibNDT:建立一个基于链接嵌套数据库的形式化属性库

LibNDT: Towards a Formal Library on Spreadable Properties over Linked Nested Datatypes

Mathieu Montin, Amélie Ledein, Catherine Dubois

摘要:

在过去的25年里,嵌套数据库得到了广泛的研究,无论是在理论上使用范畴理论,还是在程序设计语言(如Haskell)中的实践。它们存在于递归多态数据库中,其中类型参数在整个递归过程中都在变化。它们有多种应用,例如对常规数据类型进行内存建模或约束建模,而不依赖于依赖类型。在这项工作中,我们专注于一个特定的子集,我们称之为链接嵌套数据类型(LNDT)的嵌套数据库。我们表明,一些常见的datashees,如列表和也许,以及一些著名的嵌套datashees,如巢,甚至布什可以建立各种实例的LNDT。我们继续介绍LibNDT,一个库,在Agda和Coq开发,它侧重于一组结构,可以直接从LNDT建立的参数传播到LNDT本身。这些可展开的元素有两种,一种是功能,如折叠和映射,另一种是属性,如映射的全等性或对结构中至少一个或全部元素的给定谓词的满足。我们利用Coq和Agda的依赖类型系统来建模后者。本文最后讨论了在我们的开发过程中提出的各种有趣的话题,例如终止问题,我们的工具的比较以及使用其他元素扩展LibNDT所需的证明工作。

英文摘要:

Nested datatypes have been widely studied in the past 25 years, both theoretically using category theory, and practically in programming languages such as Haskell. They consist in recursive polymorphic datatypes where the type parameter changes throughout the recursion. They have a variety of applications such as modelling memory or modelling constraints over regular datatypes without relying on dependent types. In this work, we focus on a specific subset of nested datatypes which we call Linked Nested DataTypes (LNDT). We show that some usual datatypes such has List and Maybe, as well as some well-known nested datatypes such as Nest and even Bush can be built as various instances of LNDT. We proceed by presenting LibNDT, a library, developed both in Agda and Coq, which focuses on the set of constructs that can be spread directly from the parameter on which a LNDT is built, to the LNDT itself. These spreadable elements are of two kinds, functions, such as folds and map, and properties, such as the congruence of map or the satisfaction of a given predicate for at least one, or all, elements of the structure. We make use of the dependent type system of both Coq and Agda to model the latter. This paper ends with a discussion about various interesting topics that were raised throughout our development such as the issue of termination, the comparison of our tools and the proof effort required to extend LibNDT with additional elements.

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

↑