Mixed linear and non-linear recursive types

We describe a type system with mixed linear and non-linear recursive types called LNL-FPC (the linear/non-linear fixpoint calculus). The type system supports linear typing which enhances the safety properties of programs, but also supports non-linear typing as well which makes the type system more convenient for programming. Just like in FPC, we show that LNL-FPC supports type-level recursion which in turn induces term-level recursion. We also provide sound and computationally adequate categorical models for LNL-FPC which describe the categorical structure of the substructural operations of Intuitionistic Linear Logic at all non-linear types, including the recursive ones. In order to do so, we describe a new technique for solving recursive domain equations within the category CPO by constructing the solutions over pre-embeddings. The type system also enjoys implicit weakening and contraction rules which we are able to model by identifying the canonical comonoid structure of all non-linear types. We also show that the requirements of our abstract model are reasonable by constructing a large class of concrete models that have found applications not only in classical functional programming, but also in emerging programming paradigms that incorporate linear types, such as quantum programming and circuit description programming languages.

[1]  Daniel Lehmann,et al.  Algebraic specification of data types: A synthetic approach , 1981, Mathematical systems theory.

[2]  Andrew M. Pitts,et al.  Relational Properties of Domains , 1996, Inf. Comput..

[3]  Rasmus Ejlers Møgelberg,et al.  Synthetic Domain Theory and Models of Linear Abadi & Plotkin Logic , 2005, MFPS.

[4]  Jiří Adámek,et al.  Free algebras and automata realizations in the language of categories , 1974 .

[5]  Peter Selinger,et al.  A categorical model for a quantum circuit description language , 2017, QPL.

[6]  Francis Borceux,et al.  Handbook of Categorical Algebra: Bibliography , 1994 .

[7]  Sam Staton,et al.  Classical Control and Quantum Circuits in Enriched Category Theory , 2018, MFPS.

[8]  Torben Braüner,et al.  A General Adequacy Result for a Linear Functional Language , 1994, Theoretical Computer Science.

[9]  Martín Abadi,et al.  Syntactic considerations on recursive types , 1996, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

[10]  Peter Selinger,et al.  Presheaf Models of Quantum Computation: An Outline , 2013, Computation, Logic, Games, and Quantum Foundations.

[11]  Michael W. Mislove,et al.  Enriching a Linear/Non-linear Lambda Calculus: A Programming Language for String Diagrams , 2018, LICS.

[12]  Giuseppe Rosolini,et al.  Using Synthetic Domain Theory to Prove Operational Properties of a Polymorphic Programming Language Based on Strictness , 2004 .

[13]  Gordon D. Plotkin,et al.  The category-theoretic solution of recursive domain equations , 1977, 18th Annual Symposium on Foundations of Computer Science (sfcs 1977).

[14]  Claudio V. Russo,et al.  Operational Properties of Lily, a Polymorphic Linear Lambda Calculus with Recursion , 2001, HOOTS.

[15]  Jean-Yves Girard,et al.  Linear Logic , 1987, Theor. Comput. Sci..

[16]  Nick Benton,et al.  A Mixed Linear and Non-Linear Logic: Proofs, Terms and Models (Extended Abstract) , 1994, CSL.

[17]  J. Garrett Morris The best of both worlds: linear functional programming without compromise , 2016, ICFP.

[18]  Dominic R. Verity,et al.  ∞-Categories for the Working Mathematician , 2018 .

[19]  Adam Eppendahl,et al.  Categories and types for axiomatic domain theory , 2013 .

[20]  Philip Wadler,et al.  Linear Types can Change the World! , 1990, Programming Concepts and Methods.

[21]  Andrew Barber,et al.  Dual Intuitionistic Linear Logic , 1996 .

[22]  Marcelo P. Fiore Axiomatic domain theory in categories of partial maps , 1994 .

[23]  Michele Pagani,et al.  Applying quantitative semantics to higher-order quantum computing , 2013, POPL.

[24]  Philip Wadler,et al.  Linear logic, monads and the lambda calculus , 1996, Proceedings 11th Annual IEEE Symposium on Logic in Computer Science.

[25]  Bernardo Toninho,et al.  Linear logic propositions as session types , 2016, Math. Struct. Comput. Sci..

[26]  Samson Abramsky,et al.  Computational Interpretations of Linear Logic , 1993, Theor. Comput. Sci..

[27]  Simon L. Peyton Jones,et al.  Linear Haskell: practical linearity in a higher-order polymorphic language , 2017, Proc. ACM Program. Lang..

[28]  Rasmus Ejlers Møgelberg,et al.  Synthetic domain theory and models of linear Abadi & Plotkin logic , 2008, Ann. Pure Appl. Log..

[29]  Paul Blain Levy,et al.  Call-By-Push-Value: A Functional/Imperative Synthesis , 2003, Semantics Structures in Computation.

[30]  Gordon D. Plotkin,et al.  An axiomatisation of computationally adequate domain theoretic models of FPC , 1994, Proceedings Ninth Annual IEEE Symposium on Logic in Computer Science.

[31]  Jirí Adámek,et al.  Fixed points of functors , 2018, J. Log. Algebraic Methods Program..

[32]  Riccardo Pucella,et al.  Practical affine types , 2011, POPL '11.

[33]  Francis Borceux Handbook of Categorical Algebra: Topological categories , 1994 .