A Modular Hierarchy of Logical Frameworks
Total Page:16
File Type:pdf, Size:1020Kb
A MODULAR HIERARCHY OF LOGICAL FRAMEWORKS A thesis submitted to the University of Manchester for the degree of Doctor of Philosophy in the Faculty of Engineering and Physical Sciences 2004 By Robin Adams School of Mathematics Contents Abstract 7 Declaration 8 Copyright 9 Acknowledgements 10 1 Introduction 11 1.1 Terminology..................................... 13 1.2 TheUseofaLogicalFramework . 14 1.3 TheCaseforWeakerFrameworks. ..... 19 1.4 Outline ......................................... 23 1.5 Limitations ..................................... 28 1.6 Conclusion ...................................... 28 I Weak Logical Frameworks 30 2 Natural Deduction 31 2.1 Traditional Accounts of Natural Deduction . .......... 31 2.1.1 PropositionalRules . 32 2.1.2 QuantifierRules ................................ 34 2.2 DerivationsasProofExpressions . ........ 37 2.2.1 PredicateLogic................................ 38 2.2.2 Schroeder-Heister’sExtension . ....... 53 3 The Type Framework TF 57 3.1 Arities......................................... 57 3.2 GrammarofTF..................................... 61 3.2.1 Instantiation ................................. 65 3.2.2 Kinds ...................................... 69 3.2.3 SignaturesandContexts. 70 3.3 JudgementForms.................................. 72 3.4 BasicMetatheory................................. 75 2 3.5 AdequacyofPredicateLogicEncoding . ........ 87 4 Object Logics in Weak Frameworks 91 4.1 PropositionalLogic.............................. ..... 91 4.1.1 Grammar .................................... 91 4.1.2 RulesofDeduction.............................. 91 4.1.3 RepresentationinTF ............................ 92 4.2 PredicateLogic.................................. 94 4.3 ExtendedNaturalDeduction . ..... 97 4.4 Martin-L¨ofTypeTheory. ..... 98 4.4.1 Digression — Relating the Theory of Arities and the Grammar of TF . 106 4.5 TheCalculusofConstructions . 112 5 Subsystems of TF 118 5.1 SmallParametrisation . 120 5.2 LargeParametrisation . 121 5.3 SystemswithoutEquations . 124 5.4 TypedAbstractions ............................... 125 5.5 ObjectLogicsintheSubsystemsofTF. .......132 5.5.1 PropositionalLogic. 132 5.5.2 PredicateLogic................................ 133 5.6 ExtendedNaturalDeduction . 135 5.6.1 Martin-L¨ofTypeTheory. 136 5.6.2 CalculusofConstructions . 137 5.6.3 Discussion.................................... 138 6 Lambda-FreeSubsystemsofExistingFrameworks 139 6.1 TheEdinburghLogicalFramework,ELF. .......140 − 6.1.1 SPar (ω)c asasubsystemofELF . .145 6.2 PAL ...........................................155 6.3 AUT-68 .........................................157 6.4 PAL+ ..........................................165 6.5 AdequacyTheorems ................................ 172 II FrameworksBuiltfromFeatures 175 7 Features 176 7.1 TheBasicFramework ............................... 181 7.2 Parametrization................................. 183 7.2.1 ParametersofSmallKind . 183 7.2.2 ParametersofLargeKind . 185 7.3 DeclaringEquations .............................. 186 7.4 SubsystemsofTFrevisited . 187 3 7.5 LambdaAbstraction ............................... 188 7.5.1 Lambda Abstractions with Small Domains. 189 7.5.2 LambdaAbstractionswithLargeDomains . 198 7.6 DeclaringEquations .............................. 201 8 Existing Logical Frameworks Revisited 203 8.1 TheEdinburghLogicalFramework . 203 8.1.1 FamiliesofKinds............................... 203 8.1.2 Discussion — The Reduced Edinburgh Logical Framework .........212 8.2 Martin-L¨of’sLogicalFramework . ........213 9 Conclusion 220 9.1 FurtherFeatures ................................. 221 9.1.1 LocalDefinitions ............................... 221 9.1.2 LogicasPrimitive .............................. 222 9.2 FinalRemarks .................................... 224 Bibliography 225 A List of Features 228 B Judgemental Equality 229 B.1 TheEdinburghLogicalFramework,ELF . .......229 B.1.1 TypedParallelOne-StepReduction . 233 B.1.2 The Translation from Typed Reduction to ELF . 247 B.1.3 The Translation from ELF to Typed Reduction . 250 B.1.4 Metatheory of ELF= ..............................254 B.2 TheAUTOMATHSystems .............................. 254 B.2.1 PAL .......................................254 B.2.2 AUT-68 .....................................255 C Predicate Logic in ELF 260 4 List of Figures 1.1 The Hierarchy of Logical Frameworks in Part I . ......... 24 2.1 Natural Deduction Rules for Classical Predicate Logic . .............. 39 2.2 Definition of Derivations in Natural Deduction . ........... 42 2.3 Equivalence of Derivations in Natural Deduction . ............ 43 2.4 Equivalence of Derivations with Assignment Functions . .............. 45 3.1 RulesofDeductionofTF ............................ 76 5.1 Rules of Deduction of SPar (n)............................122 B.1 Typed Parallel One-Step Reduction for ELF. .........234 B.2 Typed Parallel One-Step Reduction for ELF. .........235 B.3 Typed Parallel One-Step Reduction for PAL. .........257 B.4 Typed Parallel One-Step Reduction for PAL. .........258 B.5 Typed Parallel One-Step Reduction for AUT-68 . ..........258 5 List of Frameworks and Features AUT-68 255 AUT-68= 157 BF 181 ELF 229 ELF= 140 ELF− 212 FELF 205 FELF − 213 FLF 215 FKnd 203 PAL 254 PAL= 155 PAL+ 165 LDec (n) 185 LEq (0, n) 186 LEq (m, n) 201 LF 213 LλR (n) 198 LPar (n) 121 LPar (n)− 124 LPar (n)c 125 − LPar (n)c 125 SDec (n) 183 SEq (0, n) 186 SEq (m, n) 201 SλR (n) 189 SPar (n) 122 SPar (n)c 125 SPar (n)− 124 − SPar (n)c 125 TF 76 6 Abstract Logical frameworks — formal systems for the specification and representation of other formal systems — are now a well-established field of research, and the number and variety of logical frameworks is large and growing continuously. In this thesis, I tie several examples of logical frameworks into a single hierarchy. I begin by introducing an infinite family of new, weak, lambda-free logical frameworks. These systems do not use lambda-abstraction, local definition, or any similar feature; parame- terisation, and the instantiation of parameterisation, is taken as basic. These frameworks form conservative extensions of one another; this structure of extension is what I call the modular hierarchy of logical frameworks. I show how several examples of existing logical frameworks — specifically, the systems PAL and AUT-68 from the AUTOMATH family, the Edinburgh Logical Framework, Martin-L¨of’s Logical Framework, and Luo’s system PAL+ — can be fitted into this hierarchy, in the sense that one of the weak frameworks can be embedded in each as a conservative subsystem. I give several examples of adequacy theorems for object theories in the weak frameworks; these theorems are easier to prove than is usually the case for a logical framework. Adequacy theorems for the systems higher in the hierarchy follow as immediate corollaries. In the second part of this thesis, I investigate an approach to the design of logical frameworks suggested by the existence of such a hierarchy: that a framework could be built by specifying a set of features, the result of adding any of which to a framework is a conservative extension of the same. I show how all of the weak frameworks from the first part, as well as two of the systems we gave there as examples, can indeed be built in this manner. 7 Declaration No portion of the work referred to in this thesis has been submitted in support of an application for another degree or qualification of this or any other university or other institution of learning. 8 Copyright Copyright in text of this thesis rests with the Author. Copies (by any process) either in full, or of extracts, may be made only in accordance with instructions given by the Author and lodged in the John Rylands University Library of Manchester. Details may be obtained from the Librarian. This page must form part of any such copies made. Further copies (by any process) of copies made in accordance with such instructions may not be made without the permission (in writing) of the Author. The ownership of any intellectual property rights which may be described in this thesis is vested in the University of Manchester, subject to any prior agreement to the contrary, and may not be made available for use by third parties without the written permission of the University, which will prescribe the terms and conditions of any such agreement. Further information on the conditions under which disclosures and exploitation may take place is available from the Head of School of Mathematics. 9 Acknowledgements My thanks should first and foremost go to my supervisor, Peter Aczel, for first introducing me to type theory in what now feels like the dim and distant past, for help and support, both technical and , for encouraging me when it seemed everything I tried led to failure, and for restraining my ambition when I had once again found the single idea that would turn the type theory world upside-down. Thanks to Zhaohui Luo for the many helpful suggestions and discussions, both in person and by e-mail, over the course of the last few years. Thanks also to the rest of the CARG group at Durham, especially Paul Callaghan and James McKinna, for their hospitality and helpful discussions on several visits. Likewise, thanks go to the Foundations group at Nijmegen, especially Henk Barendregt and Herman Geuvers, for receiving me as a visitor, and for their suggestions and opinions while I was there. Thanks to many people with whom I have had several fruitful discussions at conferences and over e-mail, particularly Randy Pollack for substantial