Affiliation:
1. Carnegie Mellon University, Pittsburgh, Pennsylvania, USA
Abstract
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, placing
projectibility
of module expressions on a type-theoretic basis.
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
, by iterating our modal account of the phase distinction. We axiomatize a dependent type theory of parametricity structures using two pairs of complementary modalities (syntactic, semantic) and (static, dynamic), substantiated using the topos theoretic
Artin gluing
construction. 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.
Publisher
Association for Computing Machinery (ACM)
Subject
Artificial Intelligence,Hardware and Architecture,Information Systems,Control and Systems Engineering,Software
Cited by
9 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Formalizing the ∞-Categorical Yoneda Lemma;Proceedings of the 13th ACM SIGPLAN International Conference on Certified Programs and Proofs;2024-01-09
2. Internalizing Indistinguishability with Dependent Types;Proceedings of the ACM on Programming Languages;2024-01-05
3. Decalf: A Directed, Effectful Cost-Aware Logical Framework;Proceedings of the ACM on Programming Languages;2024-01-05
4. Explicit Refinement Types;Proceedings of the ACM on Programming Languages;2023-08-30
5. SSProve: A Foundational Framework for Modular Cryptographic Proofs in Coq;ACM Transactions on Programming Languages and Systems;2023-07-20