论文标题
libndt:朝着链接的嵌套数据类型上的可扩展属性的正式库
LibNDT: Towards a Formal Library on Spreadable Properties over Linked Nested Datatypes
论文作者
论文摘要
在过去的25年中,嵌套的数据类型在理论上使用类别理论进行了广泛研究,并且实际上是在诸如Haskell之类的编程语言中进行了研究。它们由递归多态性数据类型组成,其中类型参数在整个递归中都会发生变化。它们具有多种应用程序,例如建模内存或对常规数据类型的建模约束,而不依赖于依赖类型。在这项工作中,我们专注于嵌套数据类型的特定子集,我们称之为链接的嵌套数据类型(LNDT)。我们表明,这样的一些常规数据类型具有列表,也许还有一些众所周知的嵌套数据类型,例如Nest,甚至可以作为LNDT的各种实例构建。我们通过在AGDA和COQ中介绍Libndt(一个库Libndt)来进行,该图书馆既着重于可以直接从lndt构建的参数,lndt本身传播的一组构造。这些可传播的元素具有两种,函数,例如折叠和地图,以及属性,例如MAP的一致性或给定谓词的满意度至少一种或所有结构的元素。我们利用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.