There are several ways to formally represent families of data, such as lambda terms, in a type theory such as the dependent type theory of Coq. Mathematical representations are very compact ones and usually rely on the use of dependent types, but they tend to be difficult to handle in practice. On the contrary, implementations based on a larger (and simpler) data structure combined with a restriction property are much easier to deal with. In this work, we study several families related to lambda terms, among which Motzkin trees, seen as lambda term skeletons, closable Motzkin trees, corresponding to closed lambda terms, and a parameterized family of open lambda terms. For each of these families, we define two different representations, show that they are isomorphic and provide tools to switch from one representation to another. All these datatypes and their associated transformations are implemented in the Coq proof assistant. Furthermore we implement random generators for each representation, using the QuickChick plugin.
翻译:有几种方式可以正式代表数据家庭,例如羊羔术语,在一种类型的理论中,如Coq的依附类型理论。数学表现非常紧凑,通常依赖依赖类型,但在实践中往往难以处理。相反,基于更大(更简单的)数据结构以及限制属性的执行则容易处理。在这项工作中,我们研究与羊羔条件有关的若干家庭,其中莫茨金树被视为羊羔术语骨架,可渗透的莫茨金树,与封闭的羊羔术语相对应,以及开放的羊羔术语参数组合。我们为其中每一个家庭定义了两种不同的表达方式,表明它们都是无形态的,提供了从一个代表方式转换到另一个代表方式的工具。所有这些数据类型及其相关的转换都是在Coq证明助理中实施的。此外,我们使用快速精液插件对每个表达方式实施随机生成器。