Type-Theoretic Methodology for Practical Programming Languages

Type-Theoretic Methodology for Practical Programming Languages

TYPETHEORETIC METHODOLOGY FOR PRACTICAL PROGRAMMING LANGUAGES A Dissertation Presented to the Faculty of the Graduate Scho ol of Cornell University in Partial Fulllmentofthe Requirements for the Degree of Do ctor of Philosophy by Karl Fredrick Crary August c Karl Fredrick Crary ALL RIGHTS RESERVED TYPETHEORETIC METHODOLOGY FOR PRACTICAL PROGRAMMING LANGUAGES Karl FredrickCrary PhD Cornell University The signicance of typ e theory to the theory of programming languages has long been recog nized Advances in programming languages have often derived from understanding that stems from typ e theory However these applications of typ e theory to practical programming lan guages have b een indirect the dierences between practical languages and typ e theory have prevented direct connections b etween the two This dissertation presents systematic techniques directly relating practical programming languages to typ e theory These techniques allow programming languages to b e interpreted in h mathematical domain of typ e theory Suchinterpretations lead to semantics that are the ric at once denotational and op erational combining the advantages of each and they also lay the foundation for formal verication of computer programs in typ e theory Previous typ e theories either have not provided adequate expressiveness to interpret prac tical languages or haveprovided such expressiveness at the exp ense of essential features of the typ e theory In particular no previous typ e theory has supp orted a notion of partial functions needed to interpret recursion in practical languages and a notion of total functions and ob jects needed to reason ab out data values and an intrinsic notion of equality needed for most interesting results This dissertation presents the rst typ e theory incorp orating all three and discusses issues arising in the design of that typ e theory This typ e theory is used as the target of a typ etheoretic semantics for a expressive pro gramming calculus This calculus may serveasaninternal language for a variety of functional stated as a syntaxdirected emb edding of the pro programming languages The semantics is gramming calculus into typ e theory A critical p oint arising in b oth the typ e theory and the typ etheoretic semantics is the issue of admissibility Admissibilitygoverns what typ es it is legal to form recursive functions over To build a useful typ e theory for partial functions it is necessary to have a wide class of admissible typ es In particular it is necessary for all the typ es arising in the typ etheoretic semantics to be admissible In this dissertation I present a class of admissible typ es that is considerably wider than any previously known class Biographical Sketch Karl Crary was born in Madison Wisconsin in In he moved with his family to Seattle Washington where he grew up He started college at Carnegie Mellon University in and earned bachelors degrees in Computer Science and Economics in He then b egan graduate scho ol at Cornell University where he remained until iii Acknowledgements I wish to thank my parents Fred and Betsy for their constant love and supp ort throughout my childho o d and adultho o d More than anyone else they have shap ed the way I see and think ab out the world Iwant to thank Ross Willard for intro ducing me to logic and mo dern mathematics and John Reynolds for intro ducing me to the world of typ e theory I also am very grateful to Rob ert Harp er for serving as my undergraduate thesis advisor for teaching me so much and for all his encouragement while I was his student and continuing even to day Particular thanks go to Rob ert Constable my graduate advisor and to Greg Morrisett The least they did was to teach me most of the material on which this dissertation and the rest of mywork is based More imp ortantly they were a constant source of ideas sound advice and encouragement I also wish to thanks Dexter Kozen for all his help and inuence I also wish to thank all the many teachers family and friends who help ed me get where I am to day and who made it pleasant getting here Finally I want to thank Go d for creating the world and for showing me the life b eyond iv Table of Contents Intro duction The KML Programming Language Features Comparison The Role of Typ e Theory in the Design Principals Typ e Theory LambdaK Overview Lamb daK The Core Calculus The Mo dule Calculus Static Semantics Design Issues The Phase Distinction Top and Bottom Typ es Typ eTheoretic Semantics A Computational Denotational Semantics The Language of Typ e Theory Domain and Category Theory ATyp eTheoretic Semantics Basic Emb edding Emb edding Recursion Emb edding Kinds Emb edding Mo dules Prop erties of the Emb edding Prosp ects for Extension Conclusions Foundational Typ e Theory Nuprl Basic Typ es and Op erators EqualityandWellformedness Prop ositions as Typ es Equality Subtyping and Inequality v Constructivity Constructing New Typ es using Logic Computation P artial Typ es Sequents and Pro of Functionality ExtractStyle Pro of Issues in Partial Ob ject Typ e Theory Partial Computation Computation in ActivePositions Fixp oint Induction Computational Induction Other Contributions Semantics Typ e Semantics Judgement Semantics Classical Reasoning Admissibility The Fixp oint Principle Computational Lemmas Computational Approximation Finite Approximations Least Upp er Bound Theorem Admissibility PredicateAdmissibility Monotonicity Set and QuotientTyp es Summary Conclusions Conclusion A Lamb daK Typing Rules B Nuprl Pro of Rules C Pro ofs Bibliography vi List of Figures Lamb daK Syntax Lamb daK Shorthand Higher Order Power and Singleton Kinds ATypical Mo dule Enco ding Typ e Theory Syntax The Typ e Triangle Emb edding Kinds and Typ es Emb edding Terms Emb edding Signatures Emb edding Mo dules Basic Nuprl Typ es Derived Forms Op erational Semantics for Nuprl Primitive Nuprl Typ es Typ e Sp ecications Typ e Denitions Data Typ es Typ e Denitions Assertions Typ e Denitions Set and Quotient Admissibility coadmissibility and monotonicity conditions vii Chapter Intro duction The distance between theory and practice is shorter in theory than in practice Unknown The development of practical programming languages has lagged far b ehind the stateofthe art of theoretical programming language.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    112 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us