Specifying type systems

  • Dieter Nazareth
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1139)


This paper presents a flexible type system developed for an axiomatic specification language. The type system can be dynamically adapted to different application areas. In particular, it allows the modelling of different kinds of polymorphism, like type classes or subtyping. The type system is based on the concept of qualified types. It allows one to abstract from concrete types by using type variables and to qualify these type variables by type predicates. The properties of the type predicates are described by a specification language based on Horn clauses. The notion of well-typedness is defined via a type inference calculus. We investigate the implementation of the type inference calculus and present an inference algorithm which splits into two phases. The first phase checks the well-formedness of the given term and computes the necessary type predicate restrictions, The second phase uses resolution to prove the computed restrictions to be correct with respect to the type predicate specification. We show that the inference algorithm is correct and complete with respect to the type inference calculus.


polymorphic type system type inference qualified types axiomatic specification 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    J. Gambihler. Syntaktische Analyse polymorpher Spezifikationen. Master's thesis, Technische Universität München, 1994.Google Scholar
  2. 2.
    J.A. Goguen and J. Meseguer, Order-Sorted Algebra Solves the Constructor-Selector, Multiple Representation and Coercion Problems. In Logic in Computer Science, IEEE, 1987.Google Scholar
  3. 3.
    R. Hindley. The Principle Type-Scheme of an Object in Combinatory Logic. Trans. Am. Math. Soc., 146:29–60, December 1969.Google Scholar
  4. 4.
    P. Hudak, S. Peyton Jones, and P. Wadler, editors. Report on the Programming Language Haskell, A Non-strict Purely Functional Language (Version 1.2). ACM SIGPLAN Notices, May 1992.Google Scholar
  5. 5.
    M. P. Jones. Qualified Types: Theory and Practice. Technical Monograph PRG-106, Oxford University Computing Laboratory, Programming Research Group, July 1992.Google Scholar
  6. 6.
    M. P. Jones. An Introduction to Gofer, August 1993.Google Scholar
  7. 7.
    John W. Lloyd. Foundations of Logic Programming. Springer-Verlag, 1987.Google Scholar
  8. 8.
    R. Milner. A Theory of Type Polymorphism in Programming. Journal of Computer and System Sciences, 17:348–375, 1978.Google Scholar
  9. 9.
    P.D. Mosses. The Use of Sorts in Algebraic Specifications. In Proceedings of the 8th Workshop on Abstract Data Types, Dourdan, December 1991.Google Scholar
  10. 10.
    D. Nazareth. Modelling Inheritance in an Algebraic Specification Language. In Jianping Wu et al., editor, Proceedings of the Third International Conference for Young Computer Scientists, Beijing, pages 9.05–9.08. Tsinghua University Press, July 1993.Google Scholar
  11. 11.
    D. Nazareth. A Polymorphic Sort System for Axiomatic Specification Languages. PhD thesis, Technische Universität München, 1995. Technical Report TUM-I9515.Google Scholar
  12. 12.
    J.A. Robinson. A machine-oriented logic based on the resolution principle. Journal of the ACM, 12:23–41, 1965.Google Scholar
  13. 13.
    S. Thatte. Coercive type isomorphism. In J. Hughes, editor, 5th ACM Conference on Functional Programming Languages and Computer Architektur, volume 523 of Lecture Notes in Computer Science, pages 29–48. Cambridge, MA, Springer-Verlag, 1991.Google Scholar
  14. 14.
    P. Wadler and S. Blott. How to Make Ad-hoc Polymorphism Less Ad hoc. In 16th ACM Symposium on Principles of Programming Languages, pages 60–76, 1989.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1996

Authors and Affiliations

  • Dieter Nazareth
    • 1
  1. 1.Institut für InformatikTechnische Universität MünchenMünchenGermany

Personalised recommendations