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.
翻译:程序模块的理论不仅对语言设计者具有实际意义,而且因为它是语言设计的三个基本关切的关联点:阶段区分、计算效果和类型抽象。我们贡献了一个新的“合成”程序模块,将模块视为基本构件,根据一种新的逻辑关系,将先前模块计算模型(实物、构建器、动态程序)的通常疑点作为参数,即该阶段区别的模型型式理论说明。我们简化了类型抽象化的账户(在模块真菌的遗传性中嵌入了模块真菌的遗传性),通过一种包含计算效果的松散模式。我们的主要结果是将模块的“合成”模块的“合成”模块模块作为基本构件,根据一种新的逻辑关系(种类、构建者、动态程序)作为衍生概念的衍生概念,将模型的模型模型模型模型与证据相关家庭的关系概括起来,在两种程序的相关类型中,可能出现非三重证据,但两个程序的相对关联性则被压缩。 我们的主要结果是( ) 将模型的缩缩略地将一个序列的缩略地分类用于“ ”