An abstract interpretation for ML equality kinds

  • Carl A. Gunter
  • Elsa L. Gunter
  • David B. MacQueen
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 526)


The definition of Standard ML provides a form of generic equality which is inferred for certain types, called equality types, on which it is possible to define a computable equality relation. However, the standard definition is incomplete in the sense that there are interesting and useful types which are not inferred to be equality types but which nevertheless have a computable equality relation. In this paper, a refinement of the Standard ML system of equality types is introduced and is proven sound and complete with respect to the existence of a computable equality. The technique used here is based on an abstract interpretation of ML operators as monotone functions over a three point lattice. It is shown how the equality relation can be defined (as an ML program) from the definition of a type with our equality property. Finally, a sound, efficient algorithm for inferring the equality property which corrects the limitations of the standard definition in all cases of practical interest is demonstrated.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. [BGS89]
    V. Breazu-Tannen, C. Gunter, and A. Scedrov. Denotational Semantics for Subtyping between Recursive Types. Research Report MS-CIS-89-63/Logic & Computation 12, Department of Computer and Information Science, University of Pennsylvania, 1989.Google Scholar
  2. [GS90]
    C. A. Gunter and D. S. Scott. Semantic domains. In J. van Leeuwen, editor, Handbook of Theoretical Computer Science, pages 633–674, North Holland, 1990.Google Scholar
  3. [MT91]
    R. Milner and M. Tofte. Commentary on Standard ML. MIT Press, 1991.Google Scholar
  4. [MTH90]
    R. Milner, M. Tofte, and R. Harper. The Definition of Standard ML. MIT Press, 1990.Google Scholar
  5. [Sco76]
    D. S. Scott. Data types as lattices. SIAM Journal of Computing, 5:522–587, 1976.CrossRefGoogle Scholar
  6. [Sco82a]
    D. S. Scott. Domains for denotational semantics. In M. Nielsen and E. M. Schmidt, editors, International Colloquium on Automata, Languages and Programs, pages 577–613, Lecture Notes in Computer Science vol. 140, Springer, 1982.Google Scholar
  7. [Sco82b]
    D. S. Scott. Lectures on a mathematical theory of computation. In M. Broy and G. Schmidt, editors, Theoretical Foundations of Programming Methodology, pages 145–292, NATO Advanced Study Institutes Series, D. Reidel, 1982.Google Scholar
  8. [SP82]
    M. Smyth and G. D. Plotkin. The category-theoretic solution of recursive domain equations. SIAM Journal of Computing, 11:761–783, 1982.CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 1991

Authors and Affiliations

  • Carl A. Gunter
    • 1
  • Elsa L. Gunter
    • 2
  • David B. MacQueen
    • 3
  1. 1.Dept. of Computer and Information ScienceUniversity of PennsylvaniaPhiladelphia
  2. 2.AT&T Bell Laboratories, Room 2C-454Murray Hill
  3. 3.AT&T Bell Laboratories, Room 2C-322Murray Hill

Personalised recommendations