LNL-FPC: The Linear/Non-linear Fixpoint Calculus

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 as 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 cartesian categories 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]  J. Garrett Morris The best of both worlds: linear functional programming without compromise , 2016, ICFP.

[2]  Simon Perdrix,et al.  Quantum Programming with Inductive Datatypes , 2020 .

[3]  Vladimir Zamdzhiev,et al.  Semantics for a Lambda Calculus for String Diagrams , 2020 .

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

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

[6]  Vladimir Zamdzhiev,et al.  Mixed linear and non-linear recursive types , 2019, Proc. ACM Program. Lang..

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

[8]  B. Day On closed categories of functors , 1970 .

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

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

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

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

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

[14]  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.

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

[16]  Simon Perdrix,et al.  Quantum Programming with Inductive Datatypes: Causality and Affine Type Theory , 2019, FoSSaCS.

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

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

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

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

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

[22]  Patrick Lincoln,et al.  Linear logic , 1992, SIGA.

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

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

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

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

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

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

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

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

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

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

[33]  Samson Abramsky,et al.  Handbook of logic in computer science. , 1992 .

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

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