The logic and expressibility of simply-typed call-by-value and lazy languages

We study the operational, denotational, and axiomatic semantics of lazy and call-by-value functional languages, and use these semantics to build a new expressiveness theory for comparing functional languages. The rst part of the thesis develops the theory of lazy and call-by-value languages separately, following paradigmatic studies of call-by-name functional languages. We rst describe the operational semantics of two simply-typed languages, lazy PCF and call-by-value PCF. These two languages provide enough intuition to describe general deenitions of denotational models and logics for lazy and call-by-value languages. We prove, via a completeness theorem, that the deenitions of models and logic coincide for both the lazy and call-by-value theories. The second part of the thesis compares the two kinds of languages via translations. Speciically, we develop the idea of a fully abstract translation and deene new fully abstract translations from call-by-value PCF to lazy PCF, and vice versa. We then use the ideas to develop an expressiveness theory for languages. The theory shows that call-by-value PCF and lazy PCF are equally expressive, and another language, call-by-name PCF, is strictly less expressive than either of the other two. iii iv v Acknowledgements I owe a great debt to my advisor, Albert R. Meyer. It was his initial question that set me working on logics and translations for the two languages in this thesis, and his technical help and encouragement along the way were invaluable. My only regret of the time I spent at MIT was not having more time to work on research with Albert. His enthusiasm, philosophical wisdom, and good taste have made a deep impression on me, and I hope, through his example, to develop these qualities in myself. It has also been a pleasure working with two other coauthors: Bard Bloom, once a student at MIT and now a faculty member at Cornell, and Stavros Cosmadakis of IBM Research. I learned a lot from Bard and Stavros, including facts not always connected to computer science! I would also like to thank the members of my thesis committee, David Giiord and Rishiyur Nikhil, who provided good comments on a draft of this thesis and during the defense, and Carl Gunter of the University of Pennsylvania, who gave me time to nish the thesis during the rst months of a postdoctoral position. My fellow semantics students (many of whom are now elsewhere) deserve my warmest thanks: They have all, at one time or …

[1]  C.-H. Luke Ong The Lazy Lambda Calculus : an investigation into the foundations of functional programming , 1988 .

[2]  M.N. Sastry,et al.  Structure and interpretation of computer programs , 1986, Proceedings of the IEEE.

[3]  Albert R. Meyer Semantical Paradigms: Notes for an Invited Lecture, with Two Appendices by Stavros S. Cosmadakis , 1988, LICS 1988.

[4]  Simon L. Peyton Jones,et al.  Report on the programming language Haskell: a non-strict, purely functional language version 1.2 , 1992, SIGP.

[5]  Matthias Felleisen,et al.  Reasoning with continuations II: full abstraction for models of control , 1990, LISP and Functional Programming.

[6]  J. Girard Proof Theory and Logical Complexity , 1989 .

[7]  Dana S. Scott,et al.  Data Types as Lattices , 1976, SIAM J. Comput..

[8]  Eugenio Moggi,et al.  Categories of Partial Morphisms and the lambdap - Calculus , 1985, CTCS.

[9]  John C. Mitchell On Abstraction and the Expressive Power of Programming Languages , 1991, Sci. Comput. Program..

[10]  J. Riecke,et al.  SHOULD A FUNCTION CONTINUE , 1989 .

[11]  Val Tannen,et al.  Computing with coercions , 1990, LISP and Functional Programming.

[12]  Kurt Sieber,et al.  Relating Full Abstraction Results for Different Programming Languages , 1990, FSTTCS.

[13]  R. Statman Equality between Functionals Revisited , 1985 .

[14]  Carl A. Gunter,et al.  Semantic Domains , 1991, Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics.

[15]  C.-H. Luke Ong,et al.  Fully abstract models of the lazy lambda calculus , 1988, [Proceedings 1988] 29th Annual Symposium on Foundations of Computer Science.

[16]  Joseph E. Stoy,et al.  Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory , 1981 .

[17]  William W. Tait,et al.  Intensional interpretations of functionals of finite type I , 1967, Journal of Symbolic Logic.

[18]  K. Mulmuley Full Abstraction and Semantic Equivalence , 1987 .

[19]  Jean-Jacques Lévy,et al.  Full abstraction for sequential languages : The states of the art , 1983 .

[20]  Helmat Schwichtenberg,et al.  Complexity of Normalization in the Pure Typed Lambda – Calculus , 1982 .

[21]  G.D. Plotkin,et al.  LCF Considered as a Programming Language , 1977, Theor. Comput. Sci..

[22]  Dana S. Scott,et al.  Some Domain Theory and Denotational Semantics in Coq , 2009, TPHOLs.

[23]  Guy L. Steele,et al.  Common Lisp the Language , 1984 .

[24]  V. Yu. Sazonov Expressibility of functions in D. Scott's LCF language , 1976 .

[25]  Matthias Felleisen,et al.  Models of continuations without continuations , 1991, POPL '91.

[26]  Adam Obtulowicz,et al.  Partiality, Cartesian closedness and Toposes , 1989, Inf. Comput..

[27]  Gordon D. Plotkin,et al.  Call-by-Name, Call-by-Value and the lambda-Calculus , 1975, Theor. Comput. Sci..

[28]  Albert R. Meyer,et al.  Completeness for Typed Lazy Inequalities (Preliminary Report) , 1990 .

[29]  Bent Thomsen,et al.  A calculus of higher order communicating systems , 1989, POPL '89.

[30]  Henk Barendregt,et al.  The Lambda Calculus: Its Syntax and Semantics , 1985 .

[31]  Robin Milner,et al.  Fully Abstract Models of Typed lambda-Calculi , 1977, Theor. Comput. Sci..

[32]  Jon G. Riecke,et al.  Fully abstract translations between functional languages , 1991, POPL '91.

[33]  Ehud Shapiro,et al.  Separating concurrent languages with categories of language embeddings , 1991, STOC '91.

[34]  Bard Bloom Can LCF be topped? Flat lattice models of typed lambda calculus , 1988, [1988] Proceedings. Third Annual Information Symposium on Logic in Computer Science.

[35]  Alley Stoughton,et al.  Fully abstract models of programming languages , 1986, Research Notes in Theoretical Computer Science.

[36]  Robin Milner,et al.  Definition of standard ML , 1990 .

[37]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[38]  Robin Milner,et al.  A proposal for standard ML , 1984, LFP '84.

[39]  S. Abramsky The lazy lambda calculus , 1990 .

[40]  Matthias Felleisen,et al.  On the Expressive Power of Programming Languages , 1990, European Symposium on Programming.

[41]  E. Moggi The partial lambda calculus , 1988 .

[42]  Herbert B. Enderton,et al.  A mathematical introduction to logic , 1972 .

[43]  Jacques Loeckx,et al.  The Foundations of Program Verification, 2nd ed , 1987 .

[44]  Matthias Felleisen,et al.  The calculi of lambda-nu-cs conversion: a syntactic theory of control and state in imperative higher-order programming languages , 1987 .

[45]  G. Kreisel The Collected Papers of Gerhard Gentzen , 1971 .

[46]  Scott F. Smith From Operational to Denotational Semantics , 1991, MFPS.

[47]  Stavros S. Cosmadakis,et al.  Computing with recursive types , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[48]  Eugenio Moggi,et al.  Computational lambda-calculus and monads , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[49]  H. Friedman Equality between functionals , 1975 .

[50]  Richard Statman,et al.  The typed λ-calculus is not elementary recursive , 1977, 18th Annual Symposium on Foundations of Computer Science (sfcs 1977).

[51]  Jon G. Riecke,et al.  A Complete and Decidable Proof System for Call-by-Value Equalities (Preliminary Report) , 1990, ICALP.

[52]  Carolyn L. Talcott,et al.  Axiomatizing operational equivalence in the presence of side effects , 1989, [1989] Proceedings. Fourth Annual Symposium on Logic in Computer Science.

[53]  John C. Mitchell,et al.  Type Systems for Programming Languages , 1991, Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics.