论文标题

作为类型的逻辑关系:程序模块的证明参数

Logical Relations as Types: Proof-Relevant Parametricity for Program Modules

论文作者

Sterling, Jonathan, Harper, Robert

论文摘要

语言设计师不仅对程序对编程的实际重要性,还因为它在语言设计中的三个基本问题:阶段的区别,计算效应和类型抽象的联系。我们对程序模块进行了新的“合成”贡献,该模块将模块视为基本结构,在这种构建体中,先前模块计算的通常嫌疑犯(种类,构造函数,动态程序)以模态类型理论的概念呈现为派生的概念。我们通过封装计算效果的LAX模态简化了类型抽象的说明(体现在模块函子的生成性中)。我们的主要结果是基于一种称为参数结构的新型逻辑关系,对程序模块的计算进行了雷诺抽象定理的(重要)证明与相位敏感的概括。参数性结构概括了经典参数与与证据相关的家庭的证明关系,那里可能有非客气的证据见证了两个程序的相关性 - 简化了对类型的强大款项的元素,因为没有“关系分类的关系”,但一个人可以轻松地构成一个家庭分类”。利用逻辑关系/参数性本身就是句法和语义之间相位区别的一种形式,我们为基于口号“逻辑关系作为类型”的相位分离参数贡献了一种新的合成方法,从而迭代了我们对相位差异的模态性描述。然后,为了在抽象类型的两个实现之间构建模拟,一个简单地编程了第三个实现,其类型组件带有表示不变的。

The theory of program modules is of interest to language designers not only for its practical importance to programming, but also because it lies at the nexus of three fundamental concerns in language design: the phase distinction, computational effects, and type abstraction. We contribute a fresh "synthetic" take on program modules that treats modules as the fundamental constructs, in which the usual suspects of prior module calculi (kinds, constructors, dynamic programs) are rendered as derived notions in terms of a modal type-theoretic account of the phase distinction. We simplify the account of type abstraction (embodied in the generativity of module functors) through a lax modality that encapsulates computational effects. Our main result is a (significant) proof-relevant and phase-sensitive generalization of the Reynolds abstraction theorem for a calculus of program modules, based on a new kind of logical relation called a parametricity structure. Parametricity structures generalize the proof-irrelevant relations of classical parametricity to proof-relevant families, where there may be non-trivial evidence witnessing the relatedness of two programs -- simplifying the metatheory of strong sums over the collection of types, for although there can be no "relation classifying relations", one easily accommodates a "family classifying small families". Using the insight that logical relations/parametricity is itself a form of phase distinction between the syntactic and the semantic, we contribute a new synthetic approach to phase separated parametricity based on the slogan "logical relations as types", iterating our modal account of the phase distinction. Then, to construct a simulation between two implementations of an abstract type, one simply programs a third implementation whose type component carries the representation invariant.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源