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.
翻译:我们描述的是一种类型系统,其类型包括线性和非线性递归类型,称为LNL-FPC(线性/非线性固定点微积分)。类型系统支持线性打字,以强化程序的安全性,同时也支持非线性打字系统,使类型系统更便于编程。正如在FPC中一样,我们显示,LNL-FPC支持类型级递解,这反过来又会引发定期递解。我们还为LNL-FPC提供了合理和计算充分的绝对模型,以描述所有非线性线性线性线性线性线性线性线性亚结构操作的绝对结构,包括递归性线性线性线性线性线性线性微积分。为了做到这一点,我们描述了一种新的方法,通过在编程前的解决方案中建构,解决卡尔特斯类别中的递归域方程式等。类型系统还具有隐含的削弱和收缩规则,我们通过确定所有非线性型类的罐性共线性线性共质结构结构来建模结构。我们还表明,我们抽象模型的要求是合理的,但通过在正式的模型编程型的模型中建的模型中,也没有将这种正态型号纳入。