Formal Aspects of Computing

, Volume 8, Issue 3, pp 247–293 | Cite as

Integration of parametric and “ad hoc” second order polymorphism in a calculus with subtyping

Article

Abstract

In this paper we define an extension ofF [CUG92] to which we add functions that dispatch on different terms according to the type they receive as argument. In other words, we enrich the explicit parametric polymorphism ofF by an explicit “ad hoc” polymorphism (according the classification of [Str67]). We prove that the calculus we obtain, calledF & , enjoys the properties of Church-Rosser and Subject Reduction and that its proof system is coherent. We also define a significant subcalculus for which the subtyping is decidable. This extension has not only a logical interest but it is strongly motivated by the foundation of a broadly used programming style: object-oriented programming. The connections betweenF & and object-oriented languages are widely stressed, and the modelling byF & of some features of the object-oriented style is described, continuing the work of [CGL96].

Keywords

Type theory Typed foundation of object-oriented programming Second order λ-calculus Bounded polymorphism 

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. [App92]
    Apple Computer Inc., Eastern Research and Technology.Dylan: an object-oriented dynamic language, April 1992.Google Scholar
  2. [Bar84]
    Barendregt, H.P.:The Lambda Calculus Its Syntax and Semantics. North-Holland, 1984. Revised edition.Google Scholar
  3. [Bru94]
    Bruce, K.B.: A paradigmatic object-oriented programming language: Design, static typing and semantics.Journal of Functional Programming, 4(2):127–206, 1994.CrossRefMATHMathSciNetGoogle Scholar
  4. [BTC91]
    Breazu-Tannen, V., Coquand, T., Gunter, G., Scedrov, A.: Inheritance as implicit coercion.Information and Computation, 93(1):172–221, July 1991.CrossRefMATHMathSciNetGoogle Scholar
  5. [Car88]
    Luca Cardelli.: A semantics of multiple inheritance.Information and Computation, 76:138–164, 1988. A previous version can be found in Semantics of Data Types, LNCS 173, 51–67, Springer-Verlag, 1984.CrossRefMATHMathSciNetGoogle Scholar
  6. [Cas92]
    Castagna, G.: Strong typing in object-oriented paradigms. Technical Report 92-11, Laboratoire d'Informatique, Ecole Normale Supérieure-Paris, June 1992.Google Scholar
  7. [Cas94]
    Castagna, G.:Overloading, subtyping and late binding: functional foundation of object-oriented programming. PhD thesis, Université Paris 7, January 1994. Appeared as LIENS technical report.Google Scholar
  8. [Cas95a]
    Castagna, G.: Covariance and contravariance: conflict without a cause.ACM Transactions on Programming Languages and Systems, 17(3):431–447, 1995.CrossRefGoogle Scholar
  9. [Cas95b]
    Castagna, G.: A meta-language for typed object-oriented languages.Theoretical Computer Science, 151(2):297–352, 1995.CrossRefMATHMathSciNetGoogle Scholar
  10. [CCH89]
    Canning, P.S., Cook, W.R., Hill, W.L., Mitchell, J., Olthoff, W.G.: F-bounded quantification for object-oriented programming. InACM Conference on Functional Programming and Computer Architecture, September 1989. Also in [GuM94].Google Scholar
  11. [CuG92]
    Curien, P. L., Ghelli, G.: Coherence of subsumption, minimum typing and the type checking inF≤. Mathematical Structures in Computer Science, 2(1), 1992.Google Scholar
  12. [CGL96]
    Castagna, G., Ghelli, G., Longo, G.: A calculus for overloaded functions with subtyping,Information and Computation. 117(2):115–135, 1996 An extended abstract has appeared in the proceedings of theACM Conference on LISP and Functional Programming, pp.182–192; San Francisco, June 1992.MathSciNetGoogle Scholar
  13. [CGL93]
    Castagna, G., Ghelli, G., Longo, G.: A semantics for λ&-early: a calculus with overloading and early binding. In M. Bezem and J.F. Groote, editors,International Conference on Typed Lambda Calculi and Applications, number 664 in LNCS, pages 107–123, Utrecht, The Netherlands, March 1993. Springer.CrossRefGoogle Scholar
  14. [Cha92]
    Chambers, C: Object-oriented multi-methods in Cecil. InECOOP'92, number 615 in LNCS. Springer, 1992.Google Scholar
  15. [CHC90]
    Cook, W.R., Hill, W.L., Canning, P.S.: Inheritance is not subtyping.17th Ann. ACM Symp. on Principles of Programming Languages, January 1990.Google Scholar
  16. [CaL91]
    Cardelli, L., Longo, G.: A semantic basis for Quest.Journal of Functional Programming, 1(4):417–458, 1991.CrossRefMATHMathSciNetGoogle Scholar
  17. [CaL95]
    Chambers, C., Leavens, G.T.: Typechecking and modules for multi-methods. ACM Transactions on Programming Languages and Systems 17(6):805–843, 1995.CrossRefGoogle Scholar
  18. [CMM94]
    Cardelli, L., Martini, S., Mitchell, J.C., Scedrov, A.: An extension of system F with subtyping. Information and Computation 109(1/2):4–56, 1994.CrossRefMATHMathSciNetGoogle Scholar
  19. [CoP96]
    Compagnoni, A., Pierce, B.C.: Multiple inheritance via intersection types. MSCS to appear.Google Scholar
  20. [CaP94]
    Castagna, G., Pierce, B.C.: Decidable bounded quantification. In21 st Annual Symposium on Principles Of Programming Languages, pages 151–162, Portland, Oregon, January 1994. ACM Press. POPL'94.Google Scholar
  21. [CaP95]
    Castagna, G., Pierce, B.C.: Corrigendum: Decidable bounded quantification. In22nd Annual Symposium on Principles Of Programming Languages, San Francisco, January 1995. ACM Press.Google Scholar
  22. [CaW85]
    Cardelli, L., Wegner, P.: On understanding types, data abstraction, and polymorphism.Computing Surveys, 17(4):471–522, December 1985.CrossRefGoogle Scholar
  23. [DMG87]
    DeMichiel, L.G., Gabriel, R.P.: Common lisp object system overview. In Bézivin, Hullot, Cointe, and Lieberman, editors,Proc. of ECOOP '87 European Conference on Object-Oriented Programming, number 276 in LNCS, pages 151–170, Paris, France, June 1987, Springer.CrossRefGoogle Scholar
  24. [Ghe90]
    Ghelli, G.:Proof Theoretic Studies about a Minimal Type System Integrating Inclusion and Parametric Polymorphism. PhD thesis, Dipartimento di Informatica, Universitá di Pisa, March 1990. Tech. Rep. TD-6/90.Google Scholar
  25. [Ghe91]
    Ghelli, G.: A static type system for message passing. InProc. of OOPSLA '91, 1991.Google Scholar
  26. [GuM94]
    Gunter, C.A., Mitchell, J.C.:Theoretical Aspects of Object-Oriented Programming: Types,Semantics, and Language Design. The MIT Press, 1994.Google Scholar
  27. [Hin64]
    Hindley, R.: The Church-Rosser property and a result of combinatory logic. Dissertation, 1964. University of Newcastle-upon-Tyne.Google Scholar
  28. [How80]
    Howard, W.A.: The formulae-as-types notion of construction. In J.R. Hindley and J.P. Seldin, editors,To H.B. Curry: Essays in Combinatory Logic, Lambda Calculus and formalism. Academic Press, 1980.Google Scholar
  29. [KnB70]
    Knuth, D.E., Bendix, P.B.: Simple word problems in universal algebras. In J. Leech, editor,Computational Problems in Abstract Algebra, pages 263–297. Pergamon Press, 1970.Google Scholar
  30. [Mey88]
    Bertrand Meyer.Object-Oriented Software Construction. Prentice-Hall International Series, 1988.Google Scholar
  31. [MiH88]
    Mitchell, J.C., Harper, R.: The essence of ML.15th Ann. ACM Symp. on Principles of Programming Languages, January 1988.Google Scholar
  32. [New42]
    Newman, M.H.A.: On theories with a combinatorial definition of “equivalence”.Annals of Math., 43(2):223–243, 1942.CrossRefMATHGoogle Scholar
  33. [NeX91]
    NeXT Computer Inc.NeXTStep-concepts. Chapter 3: Object-Oriented Programming and Objective-C, 2.0 edition, 1991.Google Scholar
  34. [Pie93]
    Pierce, B.C.: Bounded quantification is undecidable.Information and Computation, 1993. To appear. Also in [GuM94]. Preliminary version in proceedings of POPL '92.Google Scholar
  35. [PiT94]
    Pierce, B.C., Turner, D.N.: Simple type-theoretic foundations for object-oriented programming.Journal of Functional Programming 4(2):207–247, 1994.CrossRefMATHGoogle Scholar
  36. [Ros73]
    Rosen, B.K.: Tree manipulation systems and Church-Rosser theorems.Journal of ACM, 20:160–187, 1973.CrossRefMATHGoogle Scholar
  37. [Str67]
    Strachey, C.: Fundamental concepts in programming languages. Lecture notes for International Summer School in Computer Programming, Copenhagen, August 1967.Google Scholar

Copyright information

© BCS 1996

Authors and Affiliations

  1. 1.Laboratoire d'Informatique de l'École Normale SupérieureC.N.R.S.ParisFrance

Personalised recommendations