Modeling abstract types in modules with open existential types

We propose F-zip, a calculus of open existential types that is an extension of System F obtained by decomposing the introduction and elimination of existential types into more atomic constructs. Open existential types model modular type abstraction as done in module systems. The static semantics of F-zip adapts standard techniques to deal with linearity of typing contexts, its dynamic semantics is a small-step reduction semantics that performs extrusion of type abstraction as needed during reduction, and the two are related by subject reduction and progress lemmas. Applying the Curry-Howard isomorphism, F-zip can be also read back as a logic with the same expressive power as second-order logic but with more modular ways of assembling partial proofs. We also extend the core calculus to handle the double vision problem as well as type-level and term-level recursion. The resulting language turns out to be a new formalization of (a minor variant of) Dreyer's internal language for recursive and mixin modules.

[1]  John C. Reynolds,et al.  Types, Abstraction and Parametric Polymorphism , 1983, IFIP Congress.

[2]  Matthias Felleisen,et al.  A Syntactic Approach to Type Soundness , 1994, Inf. Comput..

[3]  Mark Lillibridge,et al.  A type-theoretic approach to higher-order modules with sharing , 1994, POPL '94.

[4]  Benjamin C. Pierce,et al.  Design considerations for ML-style module systems , 2005 .

[5]  Luca Cardelli,et al.  Abstract Types and the Dot Notation , 1990, Programming Concepts and Methods.

[6]  Claudio V. Russo Types for Modules , 2004, Electronic Notes in Theoretical Computer Science.

[7]  Andreas Rossberg,et al.  Generativity and dynamic opacity for abstract types , 2003, PPDP '03.

[8]  Robert Harper,et al.  Abstract 1 Introduction , 2022 .

[9]  Derek Dreyer,et al.  A type system for higher-order modules , 2003, POPL '03.

[10]  Karl Crary,et al.  Towards a mechanized metatheory of standard ML , 2007, POPL '07.

[11]  Xavier Leroy The objective caml system release 3 , 2001 .

[12]  Sergei A. Romanenko,et al.  Moscow ML Owner's Manual , 2000 .

[13]  John C. Mitchell,et al.  Higher-order modules and the phase distinction , 1989, POPL '90.

[14]  David B. MacQueen Modules for standard ML , 1984, LFP '84.

[15]  Martin Odersky,et al.  A Nominal Theory of Objects with Dependent Types , 2003, ECOOP.

[16]  Didier Rémy Towards a Simpler Account of Modules and Generativity : Abstract Types have Open Existential Types , 2008 .

[17]  Robin Milner,et al.  Definition of standard ML , 1990 .

[18]  Derek Dreyer Recursive type generativity , 2007, J. Funct. Program..

[19]  Matthias Felleisen,et al.  Units: cool modules for HOT languages , 1998, PLDI.

[20]  Xavier Leroy,et al.  A syntactic theory of type generativity and sharing , 1996, Journal of Functional Programming.

[21]  Derek Dreyer A type system for recursive modules , 2007, ICFP '07.

[22]  John C. Mitchell,et al.  Abstract types have existential types , 1985, POPL.