Linear Type Theories, Semantics and Action Calculi
Total Page:16
File Type:pdf, Size:1020Kb
Linear Type Theories, Semantics and Action Calculi Andrew Graham Barber LFCS, Department of Computing Science, Edinburgh University Doctor of Philosophy University of Edinburgh 1997 To my wife, for her trust Abstract In this thesis, we study linear type-theories and their semantics. We present a general framework for such type-theories, and prove certain decidability properties of its equality. We also present intuitionistic linear logic and Milner’s action calculi as instances of the framework, and use our results to show decidability of their respective equality judgements. Firstly, we motivate our development by giving a split-context logic and type- theory, called dual intuitionistic linear logic (DILL), which is equivalent at the level of term equality to the familiar type-theory derived from intuitionistic linear logic (ILL). We give a semantics for the type-theory DILL, and prove soundness and completeness for it; we can then deduce these results for the type-theory ILL by virtue of our translation. Secondly, we generalise DILL to obtain a general logic, type-theory and se- mantics based on an arbitrary set of operators, or general natural deduction rules. We again prove soundness and completeness results, augmented in this case by an initiality result. We introduce Milner’s action calculi, and present example instances of our framework which are isomorphic to them. We extend this iso- morphism to three significant higher-order variants of the action calculi, having functional properties, and compare the induced semantics for these action calculi with those given previously. Thirdly, motivated by these functional extensions, we define higher-order in- stances of our general framework, which are equipped with functional structure, proceeding as before to give logic, type-theory and semantics. We show that the logic and type-theory DILL arise as a higher-order instance of our general frame- work. We then define the higher-order extension of any instance of our framework, and use a Yoneda lemma argument to show that the obvious embedding from an instance into its higher-order extension is conservative. This has the corollary that the embeddings from the action calculi into the higher-order action calculi are all conservative, extending a result of Milner. Finally, we introduce relations, a syntax derived from proof-nets, for our gen- eral framework, and use them to show that certain instances of our framework, including some higher-order instances, have decidable equality judgements. This immediately shows that the equalities of DILL, ILL, the action calculi and the higher-order action calculi are decidable. Acknowledgements I am hugely grateful to my supervisor, Gordon Plotkin, for his insight and ability to communicate it, his encouragement, and for his detailed comments at each stage of my thesis. I also thank Philippa Gardner, my second supervisor, for her attention, her enthusiasm and for pointing me in the direction of many interesting problems. Other than my supervisors, I have benefited greatly during my time at Edin- burgh from the insight of many people here, particularly Masahito Hasegawa, John Power, Alex Simpson, Paul-Andre Mellies and Marcello Fiore, whom I thank, and from the good-humour of my office partner Thomas Schreiber. Finally, I thank my wife for all her support, encouragement and proof-reading– her efforts have immeasurably improved this thesis and my time in Edinburgh. Declaration I declare that this thesis was composed by myself and that the work contained therein is my own, except where explicitly stated otherwise in the text. (Andrew Graham Barber LFCS, Department of Computing Science, Edinburgh University) Table of Contents Chapter 1 Introduction 4 1.1MotivatingSketch........................... 5 1.2Background.............................. 11 1.3Development............................. 24 1.4ChapterSummary.......................... 29 1.5HistoricalNotes............................ 31 Chapter 2 An Alternative Formulation of ILL 32 2.1 The Logic DILL ............................ 32 2.2 The Type Theory DILL(C)...................... 35 2.3 The Type Theory ILL(C)....................... 42 2.4 Relating DILL and ILL ........................ 45 Chapter 3 The Semantics of DILL 60 3.1TheInterpretation.......................... 60 3.2 Soundness . 65 3.3TheTermModel........................... 68 3.4Completeness............................. 78 3.5 ILL andOtherModels........................ 79 Chapter 4 Linear Type Theories 81 4.1Introduction.............................. 81 4.2TheGeneralisedLogic........................ 84 4.3 The Typing System Lin(O)...................... 87 4.4 The Type Theory Lin(O, A) ..................... 91 Chapter 5 The Semantics of Lin(O, A) 95 5.1TheInterpretation.......................... 95 5.2 Soundness . 99 5.3TheTermModel........................... 101 1 5.4Completeness............................. 107 5.5Initiality................................ 109 5.6OutputNaturality.......................... 114 Chapter 6 Action Calculi and Extensions 120 6.1ActionCalculi............................. 121 6.2GeneralisedLinearTypeTheory................... 124 6.3TheTranslations........................... 126 6.4Extensions............................... 134 6.5Semantics............................... 143 Chapter 7 Higher-Order Type Theories 148 7.1Higher-OrderTypeTheories..................... 148 7.2Higher-OrderSemantics....................... 153 7.3Conservativity............................. 159 7.4Corollaries............................... 165 7.5ActionCalculi............................. 168 7.6LinearLogic.............................. 170 Chapter 8 Normal Forms for Lin(O, A) 178 8.1ProofNets............................... 178 8.2Relations................................ 185 8.3RelationalEquality.......................... 196 8.4TermstoRelations.......................... 199 8.5RelationstoTerms.......................... 204 Chapter 9 Normal Forms and Decidability 215 9.1Proof-Nets............................... 215 9.2 The F -Equalities........................... 216 9.3DecidingtheEquality......................... 218 9.4TheHigher-OrderCase........................ 227 9.5Corollaries............................... 236 Chapter 10 Conclusions 239 10.1Results................................. 239 10.2 Extending Lin(O, A) ......................... 241 10.3AimsandObjectives......................... 246 10.4FinalRemarks............................. 249 2 Appendix A Basic Definitions 250 A.1SyntacticPreliminaries........................ 250 A.2CategoricalDefinitions........................ 251 Bibliography 255 Index to Notation 265 Index to Definitions 267 3 Chapter 1 Introduction The central concept in this thesis is that of linearity. We can say that linearity is an attribute of systems in which unrestricted duplication of computations or information is not allowed. There are many practical situations in which this is the case—computations with side effects, where duplicating the computation also duplicates the side-effect, manipulating large data-structures, where a duplication may bear an unacceptable computational cost, or simply efficient implementations where duplicating computation is to be avoided except where necessary. Areas as diverse as optimal λ-calculus implementations, the study of process calculi and denotational semantics can all utilise linearity in this broad sense. Although such systems have been studied for many years, a new and striking development occurred when Girard introduced linear logic [Gir87]. Unlike con- ventional intuitionistic and classical logics, linear logic is built on the underlying idea that assumptions should be treated linearly, which is to say that an assump- tion should not be used twice in a deduction. Starting from this basis, Girard built a complete classical linear logic, which, just as in the conventional case, has both minimal and intuitionistic fragments. Since the introduction of linear logic, many researchers have used it as an un- derlying logic for systems which exhibit linearity in our general sense, for example in the study of optimal λ-calculus reductions [GAL92a], in the analysis of imple- mentation issues such as garbage collection, references and others [Wad90, GH90] and to control interference in imperative languages [OTPT95]. It has become the logic of choice for such applications in much the same way as conventional logic underpins a huge range of theory in computer science. In the case of conventional logics, one large section of applications are those which are based on conventional intuitionistic logic as a typing system for a syntax of some sort. A variety of sys- tems can be typed in this way, and the general principles underlying such typings are well understood. 4 In this thesis, we present a first step towards a similar unifying programme for systems with linearity. We give a general operator theory, logic, and type-theory over a linear underlying structure, and show how it can be used to present a number of typing systems exhibiting linearity. We also give a semantics for our theory, and prove some general results about it. As an introduction, we give a motivating summary in a simple setting, provide brief tutorials and summaries of related work on the concepts we work with, and then outline the work contained in the thesis. A chapter summary can be found in section 1.4. We assume a basic understanding of elementary intuitionistic logic, its type theory, simple category theory, and the various relationships of a familiar triangle,