Precise typing of abstract data type specifications

  • Authors:
  • Richard B. Kieburtz

  • Affiliations:
  • The Oregon Graduate Center, Beaverton, OR

  • Venue:
  • POPL '83 Proceedings of the 10th ACM SIGACT-SIGPLAN symposium on Principles of programming languages
  • Year:
  • 1983

Quantified Score

Hi-index 0.00

Visualization

Abstract

There are two important notions of data types being used in programming languages today. In the concept called abstract data types, types are algebras; the semantics of programs is described in terms of operations in these algebras. Another notion of type found in most of the "typed" programming languages in actual use regards types as sets of objects; the elements of types are the objects manipulated by the operators of a programming language. I shall be careful to use "abstract data type" when I mean the algebraic notion, and "data type" or simply "type" to mean the set-based concept.This paper presents a formal theory of types as an approximation to the exact semantics of a language, following the lead of Milner [Mil78]. The semantics is based upon multi-sorted algebras [ADJ73, 76, 77, 78] and is applied to a language consisting of equational specifications that define an abstract data type. The principal results of the paper are to characterize a class of typings as uniform approximations to an exact semantics, to extend Milner's theory of types to include types formed by coproduct construction, and to explicate typing as an (approximate) semantics for an equational theory.In developing a formal theory of abstract data types as multi-sorted algebras, the word "sort" is used to designate names used to distinguish various sets of objects that may constitute the domains of operators. Sorts are thus analogous to data types in programming languages. However, the sort signatures given to operators of abstract data types do not themselves constitute a very richly descriptive language. Sort names can be formed into sequences, corresponding to product construction in an object domain, but the theory (multi-sorted Σ-algebras) does not seem to allow alternation sequences of sorts, corresponding to coproduct construction in an object domain. If this were possible, then sort signatures could actually fulfill the role of data types. We shall see that alternation sequences in type signatures arise naturally as a consequence of the semantics given to an equational theory.