Skip to main content

A Calculus for Overloaded Functions with Subtyping

  • Chapter
Fully Integrated Data Environments

Part of the book series: Esprit Basic Research Series ((ESPRIT BASIC))

  • 71 Accesses

Abstract

We present a simple extension of typed λ-calculus where functions can be overloaded by putting different “branches of code” together. When the function is applied, the branch to execute is chosen according to a particular selection rule which depends on the type of the argument. The crucial feature of the present approach is that the branch selection depends on the “run-time type” of the argument, which may differ from its compile-time type, because of the existence of a subtyping relation among types. Hence overloading cannot be eliminated by a static analysis of code, but is an essential feature to be dealt with during computation. We obtain in this way a type-dependent calculus, which differs from the various λ-calculi where types do not play any role during computation. We prove Confluence and a generalized Subject-Reduction theorem for this calculus. We prove Strong Normalization for a “stratified” subcalculus. The definition of this calculus is guided by the understanding of object-oriented features and the connections between our calculus and object-orientedness are extensively stressed. We show that this calculus provides a foundation for typed object- oriented languages which solves some of the problems of the standard record-based approach.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

eBook
USD 16.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 109.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 109.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. M Abadi L Cardelli P-L Curien Formal parametric polymorphismIn Dezani, Ronchi, and VenturinieditorsBöhm Festschr1993.

    Google Scholar 

  2. Roberto M. Amadio, Luca Cardelli. Subtyping recursive types. ACM Transactions on Programming Languages and Systems, 15(4):575–631, 1993. A preliminary version appeared in POPL’91 (pp. 104–118), and as DEC Systems Research Center Research Report number 62, August 1990.

    Article  Google Scholar 

  3. H.P. Barendregt. The Lambda Calculus Its Syntax and Semantics. North-Holland, 1984. Revised edition.

    Google Scholar 

  4. Kim B. Bruce. The equivalence of two semantic definitions for inheritance in object- oriented languages. In Proceedings of Mathematical Foundations of Programming Semantics, Pittsburgh, PA, March 1991.

    Google Scholar 

  5. Peter Canning, William Cook, Walter Hill, Walter Olthoff, John Mitchell. F-bounded quantification for object-oriented programming. In Fourth International Conference on Functional Programming Languages and Computer Architecture, pages 273–280, September 1989.

    Google Scholar 

  6. L. Cardelli, J.C. Mitchell. Operations on records. Mathematical Structures in Computer Science, l(l):3–48, 1991.

    Google Scholar 

  7. L. Cardelli, P. Wegner. On understanding types, data abstraction, and polymorphism. Computing Surveys, 17(4):471–522, December 1985.

    Article  Google Scholar 

  8. L Cardelli. A semantics of multiple inheritance. Information and Computation, 76:138–164, 1988. A previous version can be found in Semantics of Data Types, volume 173 of Lecture Notes in Computer Science, pages 51–67. Springer-Verlag, 1984.

    Article  MathSciNet  MATH  Google Scholar 

  9. G. Castagna. Strong typing in object-oriented paradigms. Technical Report 92–11, Lab- oratoire d’Informatique, Ecole Normale Supérieure — Paris, June 1992.

    Google Scholar 

  10. G. Castagna, G. Ghelli, G. Longo. A semantics for λ&-early: a calculus with overloading and early binding. In M. Bezen, J.F. Groote, editorsProc. of the International Conference on Typed Lambda Calculi and Applications (TLCA), Utrecht, The Netherlands, volume 664 of Lecture Notes in Computer Science, pages 107–123, Berlin, March 1993. Springer-Verlag.

    Google Scholar 

  11. G. Castagna, G. Longo. From inheritance to Quest’s type theory. In Ecole Jeunes Chercheurs du GRECO de Programmation, Sophia-Antipolis (Nice), April 1991. Talk given at the 5th Jumelage on Typed Lambda Calculus — Paris — January 1990.

    Google Scholar 

  12. W. R. Cook, W. L. Hill, P. S. Canning. Inheritance is not subtyping. 17th Ann. ACM Symp. on Principles of Programming Languages, January 1990.

    Google Scholar 

  13. M. Coppo, M. Denzani-Ciancaglini, B. Vernieri. Functional characters of solvable terms. Zeit. Math. Logik, 27:45–58, 1981.

    Article  MATH  Google Scholar 

  14. P.-L. Curien, G. Ghelli. Coherence of subsumption, minimum typing and the type checking in F≤. Mathematical Structures in Computer Science, 2(1):55–91, 1992.

    Article  MathSciNet  MATH  Google Scholar 

  15. P.-L. Curien, G. Ghelli. Confluence and decidability of βηtop≤ reduction in F≤. Information and Computation, 109(1, 2):57–114, 1994.

    Article  MathSciNet  MATH  Google Scholar 

  16. L. G. DeMichiel, R. P. Gabriel. Common lisp object system overview. In Proc. of ECOOP’87 European Conference on Object Oriented Programming, 1987.

    Google Scholar 

  17. G. Ghelli. 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 

  18. G. Ghelli Modelling features of object-oriented languages in second order functional languages with subtypes. In J. W. de Bakker, W. P. de Roever, G. Rozenberg, editors, Foundations of Object-Oriented Languages, volume 489 of Lecture Notes in Computer Science, pages 311–340. Springer-Verlag, 1991.

    Google Scholar 

  19. G. Ghelli. A static type system for late binding overloading. In A. Paepcke, editor, Proc. of the Sixth Intl. ACM Conference on Object-Oriented Programming Systems Languages and Applications (OOPSLA), Phoenix, Arizona, number 26 (11) in ACM SIGPLAN Notices, pages 129–145, Reading, MA, 1991. Addison-Wesley.

    Google Scholar 

  20. Jean-Yves Girard, Yves Lafont, Paul Taylor. Proofs and Types, volume 7 of Cambridge Tracts in Theoretical Computer Science. Cambridge University Press, Cambridge, 1989.

    Google Scholar 

  21. R. Hindley. The Church-Rosser property and a result of combinatory logic. Dissertation, 1964. University of Newcastle-upon-Tyne.

    Google Scholar 

  22. G. Longo. Parametric and type-dependent polymorphism. Fundamenta Informaticae, 1994. To appear.

    Google Scholar 

  23. G Longo, K. Milsted, S. Soloviev. The genericity theorem and parametricity in functional languages. In 8th Annual IEEE Symposium on Logic in Computer Science, Montreal, June 1993.

    Google Scholar 

  24. G. Longo, E. Moggi. Constructive natural deduction and its ω-set interpretation. Mathematical Structures in Computer Science, 1 (2):215–253, 1991.

    Article  MathSciNet  MATH  Google Scholar 

  25. QingMing Ma, John C. Reynolds. Types, abstraction, and parametric polymorphism, part 2. In Stephen Brookes, Michael Main, Austin Melton, Michael Mislove, David A. Schmidt, editors, Mathematical Foundations of Programming Semantics, volume 598 of Lecture Notes in Computer Science, pages 1–40. Springer-Verlag, 1992.

    Google Scholar 

  26. N. Martí-Oliet, J. Meseguer. Inclusions and subtypes. Technical report, SRI International, Computer Science Laboratory, December 1990.

    Google Scholar 

  27. J. C. Mitchell. Toward a typed foundation for method specialization and inheritance. Proc. of 17th Ann. ACM Symp. on Principles of Programming Languages, pages 109–124, January 1990.

    Google Scholar 

  28. John C. Mitchell. A type-inference approach to reduction properties and semantics of polymorphic expressions. In Gérard Huet, editor, Logical Foundations of Functional Programming, University of Texas at Austin Year of Programming Series, pages 195–212. Addison-Wesley, 1990.

    Google Scholar 

  29. B.C. Pierce. Intersection and union types. Technical report, Carnegie Mellon University.

    Google Scholar 

  30. BC Pierce DN. Turner. Simple type-theoretic foundations for object- oriented programming. Journal of Functional Programming, 4(2):207–247, April 1994. A preliminary version appeared in Principles of Programming Languages, 1993, and as University of Edinburgh technical report ECS–LFCS–92–225, under the title “Object-Oriented Programming Without Recursive Types”

    Article  MATH  Google Scholar 

  31. J. C. Reynolds. Preliminary design of the programming language Forsythe. Technical Report CMU–CS–88–159, Carnegie Mellon University, June 1988.

    Google Scholar 

  32. J. C. Reynolds. The coherence of languages with intersection types. In T. Ito, A. R. Meyer, editors, Theoretical Aspects of Computer Software (Sendai, Japan), volume 526 of Lecture Notes in Computer Science, pages 675–700. Springer-Verlag, September.

    Google Scholar 

  33. B. K. Rosen. Tree manipulation systems and Church-Rosser theorems. Journal of the ACM, 20:160–187, 1973.

    Article  MATH  Google Scholar 

  34. F. Rouaix. ALCOOL-90, Typage de la surcharge dans un langage fonctionnel. PhD thesis, Université PARIS VII, December 1990.

    Google Scholar 

  35. Philip Wadler, Stephen Blott. How to make “ad-hoc” polymorphism less “ad-hoc”. In 16th Ann. ACM Symp. on Principles of Programming Languages, pages 60–76, 1989.

    Google Scholar 

  36. M Wand Type inference for record concatenation and multiple inheritance. Information and Computation, 93(1): 1–15, 1991.

    Article  MathSciNet  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2000 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Castagna, G., Ghelli, G., Longo, G. (2000). A Calculus for Overloaded Functions with Subtyping. In: Atkinson, M.P., Welland, R. (eds) Fully Integrated Data Environments. Esprit Basic Research Series. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-59623-0_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-59623-0_11

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-64055-1

  • Online ISBN: 978-3-642-59623-0

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics