A record calculus with principal types

  • Andreas V. Hense
  • Gert Smolka
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 845)

Abstract

Record calculi and their type disciplines are of great interest because they can be the basis for modelling object-oriented languages. We present a record calculus that has neither concatenation nor adjunction but is still sufficient for object-oriented languages with top-level classes. The type discipline features extensible record types and recursive types. For the formalization of the type inference algorithm and for the proofs showing its correctness, we use order-sorted logic. The order-sorted formalization is able to incorporate the constraints upon variables occurring in extensible record types. Previous approaches either lacked the principal type property or had to resort to adapting the types to the algorithm. The simplicity of our record calculus gives us principal types without having to make the types more complicated.

Keywords

Proof Obligation Type Inference Type Environment Principal Type Type Term 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    L. Cardelli. A semantics of multiple inheritance. Lecture Notes in Computer Science, 173:51–67, 1984. revised in: Information and Computation, Vol. 76, 1988, pp. 138–164.Google Scholar
  2. 2.
    L. Cardelli. Structural subtyping and the notion of power type. In Symposium on Principles of Programming Languages, pages 70–79. ACM, Jan. 1988.Google Scholar
  3. 3.
    L. Cardelli and P. Wegner. On understanding types, data abstraction, and polymorphism. ACM Comput. Surv., 17(4):471–522, Dec. 1985.Google Scholar
  4. 4.
    L. Damas and R. Milner. Principal type-schemes for functional programs. In Symposium on Principles of Programming Languages, pages 207–212. ACM, 1982.Google Scholar
  5. 5.
    A. V. Hense. Wrapper semantics of an object-oriented programming language with state. In T. Ito and A. R. Meyer, editors, Theoretical Aspects of Computer Software, volume 526 of Lecture Notes in Computer Science, pages 548–568. Springer-Verlag, Sept. 1991.Google Scholar
  6. 6.
    A. V. Hense. Polymorphic Type Inference for Object-Oriented Programming Languages. Pirrot Verlag, Trierer Str. 7, D-66125 Saarbrücken-Dudweiler, 1994. ISBN 3-930714-00-0.Google Scholar
  7. 7.
    M. Höhfeld and G. Smolka. Definite relations over constraint languages. LILOG-Report 53, IBM Deutschland, Oct. 1988.Google Scholar
  8. 8.
    D. MacQueen, G. Plotkin, and R. Sethi. An ideal model for recursive polymorphic types. Information and Control, 71:95–130, 1986.Google Scholar
  9. 9.
    M. J. Maher. Complete axiomatizations of the algebras of finite, rational and infinite trees. In Logic in Computer Science, Edinburgh, 1988.Google Scholar
  10. 10.
    J. C. Mitchell. Coercion and type inference. In Symposium on Principles of Programming Languages. ACM, 1984.Google Scholar
  11. 11.
    D. Rémy. Typechecking records and variants in a natural extension of ML. In Symposium on Principles of Programming Languages, pages 77–88. ACM, 1989.Google Scholar
  12. 12.
    D. Rémy. Typing record concatenation for free. In Symposium on Principles of Programming Languages, pages 166–176. ACM, 1992.Google Scholar
  13. 13.
    G. Smolka, W. Nutt, J. Goguen, and J. Meseguer. Order-Sorted Equational Computation, volume 2 of Resolution of Equations in Algebraic Structures, chapter 10, pages 297–367. Academic Press, 1989.Google Scholar
  14. 14.
    R. Stansifer. Type inference with subtypes. In Symposium on Principles of Programming Languages, pages 88–97. ACM, Jan. 1988.Google Scholar
  15. 15.
    J.-P. Talpin and P. Jouvelot. The type and effect discipline. In Logic in Computer Science, pages 162–173, 1992.Google Scholar
  16. 16.
    M. Tofte. Type inference for polymorphic references. Information and Computation, 89(1): 1–34, 1990.Google Scholar
  17. 17.
    M. Wand. Complete type inference for simple objects. In Logic in Computer Science, pages 37–44, 1987.Google Scholar
  18. 18.
    M. Wand. Type inference for record concatenation and multiple inheritance. Information and Computation, 93(1):1–15, July 1991.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1994

Authors and Affiliations

  • Andreas V. Hense
    • 1
  • Gert Smolka
    • 2
  1. 1.Universität des SaarlandesSaarbrücken
  2. 2.Universität des Saarlandes and DFKISaarbrücken

Personalised recommendations