Linear Calculi: University of Porto, Department of Computer Science, Faculty of Science, Portugal

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Linear Calculi

M ario Florido
University of Porto, Department of Computer Science, Faculty of Science, Portugal

Abstract In this tutorial we will present several linear calculi, and study in detail their properties and relations with corresponding non-linear models. The rst models are the ane and linear lambda calculus. Here we are interested in the relation between the ane calculus and a subset of the (non-linear) -calculus, yielding to the notion of linearisation of a -term [9, 6]. We will rst show what is meant by linear version for the strongly normalizable terms. With this precise denition we show how to characterize a large class of functions (the functions denable by the strongly normalizable terms) with a rather simple class: the linear -terms. Now consider the following question: is there a way of simulating the standard -calculus by the linear -calculus? If simulation means transforming the original standard term into a linear term with the same normal form then it is not possible, in general, to dene such transformation. We show a restricted class of -terms, with the same nice properties of the linear -calculus and such that we can simulate the standard -calculus by terms of that class: the weak linear -calculus [5, 2]. A -term M is weak linear if in any reduction sequence of M , when there is a contraction of a -redex (x.P )Q, then x occurs free in P at most once, i.e., when a function x.P is applied, its formal parameter x must occur at most once in the function body. Then we will present a transformation of general terms into weak linear terms preserving normal forms. Finally we study linear typed calculi. One of the many strands of work stemming from linear logic [7] is the area of linear functional programming languages [1, 10]. These languages are based on a version of the -calculus with a type system corresponding to intuitionistic linear logic. One of the main features of this calculus is that it provides explicit syntactical constructs for copying and erasing terms (corresponding to the exponentials in linear logic). A question that arises from this work is what exactly is the computational power of a linear calculus without the exponentials, i.e., a calculus that is syntactically linear: all variables occur exactly once. This is a severely restricted form of the (simply typed) -calculus, and is summarised by just the following three typing rules, where denotes a set of assumptions of the form x : A. , x : A x:A x:A t:B t : A B , tu : B u:A

x.t : A B

In the last rule, and are assumptions for disjoint sets of variables. Due to these typing constraints (there is no contraction or weakening rule), each variable occurs at most once in a term and the bound variable must occur in the body of the abstraction, therefore terms are linear. The computation in this calculus is given by the usual -reduction rule, but since there is no duplication or erasing of terms during reduction, this calculus has a very limited computational powerit can be shown that all functions terminate in linear time [8]. G odels System T is a formalism built from the simply typed -calculus, adding numbers and booleans, and a recursion operator. It is a very simple system, yet has an enormous expressive power. We will show that its power comes essentially from primitive recursion

combined with linear higher-order functionswe can achieve the same power in a calculus that has just these two ingredients: System L [3, 4, 2]. System L can be seen as establishing another calculus with good computational properties which does not need the full power of the exponentials, and introduces the non-linear features (copying and erasing). We will present System L and establish its main features and characteristics.

References
1. S. Abramsky. Computational Interpretations of Linear Logic. Theoretical Computer Science, 111:357, 1993. 2. S. Alves. Linearization of the Lambda Calculus. PhD thesis, Faculty of Science - University of Porto, 2007. 3. S. Alves, M. Fern andez, M. Florido, and I. Mackie. The power of linear functions. In Proceedings of CSL 2006, Computer Science Logic, volume 4207 of Lecture Notes in Computer Science. Springer-Verlag, 2006. 4. S. Alves, M. Fern andez, M. Florido, and I. Mackie. The power of closed-reduction strategies. In Proceedings of WRS 2006, 6th International Workshop on Reduction Strategies in Rewriting and Programming, FLOC 2006, Seattle, Electronic Notes in Theoretical Computer Science. Elsevier, 2007. 5. S. Alves and M. Florido. Weak linearization of the lambda calculus. Theoretical Computer Science, 342(1):79103, 2005. 6. M. Florido and L. Damas. Linearization of the lambda-calculus and its relation with intersection type systems. Journal of Functional Programming, 14(5):519546, 2004. 7. J.-Y. Girard. Linear Logic. Theoretical Computer Science, 50(1):1102, 1987. 8. J. Hindley. BCK-combinators and linear lambda-terms have types. Theoretical Computer Science, 64(1):97105, 1989. 9. A. J. Kfoury. A linearization of the lambda-calculus. Journal of Logic and Computation, 2000. 10. I. Mackie. Lilac: A functional programming language based on linear logic. Journal of Functional Programming, 4(4):395433, 1994.

You might also like