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

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

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

Jonathan Sterling, Robert Harper

摘要:

程序模块理论对语言设计者来说很有意义,不仅因为它对编程的实际重要性,还因为它是语言设计中三个基本问题的联系:阶段区分,计算效果和类型抽象。我们贡献了一个新的“合成”采取程序模块,将模块作为基本的结构,在通常的嫌疑人之前的模块演算(种,构造函数,动态程序)呈现为派生概念的模态类型理论帐户的阶段区别。我们简化了类型抽象的帐户(体现在模块函子的生成性)通过一个松散的模态,封装计算效果。我们的主要结果是程序模块演算的雷诺兹抽象定理的(重要的)证明相关和相敏的推广,基于一种称为参数结构的新型逻辑关系。参数化结构将经典参数化的证明无关关系推广到证明相关的家族,其中可能有非平凡的证据证明两个程序的相关性-简化了类型集合上的强和的元理论,因为虽然不可能有“关系分类关系”,但很容易容纳“家族分类小家族”。使用的洞察力,逻辑关系/parametricity本身是一种形式的语法和语义之间的相位区分,我们贡献了一个新的综合方法相分离parametricity的口号“逻辑关系作为类型”的基础上,迭代我们的模态帐户的相位区分。然后,要在一个抽象类型的两个实现之间构造一个模拟,只需编写第三个实现,其类型组件携带表示不变量。

英文摘要:

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.

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

↑