Abstract
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.
Preview
Unable to display preview. Download preview PDF.
References
J. Gambihler. Syntaktische Analyse polymorpher Spezifikationen. Master's thesis, Technische Universität München, 1994.
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.
R. Hindley. The Principle Type-Scheme of an Object in Combinatory Logic. Trans. Am. Math. Soc., 146:29–60, December 1969.
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.
M. P. Jones. Qualified Types: Theory and Practice. Technical Monograph PRG-106, Oxford University Computing Laboratory, Programming Research Group, July 1992.
M. P. Jones. An Introduction to Gofer, August 1993.
John W. Lloyd. Foundations of Logic Programming. Springer-Verlag, 1987.
R. Milner. A Theory of Type Polymorphism in Programming. Journal of Computer and System Sciences, 17:348–375, 1978.
P.D. Mosses. The Use of Sorts in Algebraic Specifications. In Proceedings of the 8th Workshop on Abstract Data Types, Dourdan, December 1991.
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.
D. Nazareth. A Polymorphic Sort System for Axiomatic Specification Languages. PhD thesis, Technische Universität München, 1995. Technical Report TUM-I9515.
J.A. Robinson. A machine-oriented logic based on the resolution principle. Journal of the ACM, 12:23–41, 1965.
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.
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.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1996 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Nazareth, D. (1996). Specifying type systems. In: Hanus, M., Rodríguez-Artalejo, M. (eds) Algebraic and Logic Programming. ALP 1996. Lecture Notes in Computer Science, vol 1139. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-61735-3_21
Download citation
DOI: https://doi.org/10.1007/3-540-61735-3_21
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-61735-8
Online ISBN: 978-3-540-70672-4
eBook Packages: Springer Book Archive