Visual type inference

  • Authors:
  • Martin Erwig

  • Affiliations:
  • School of EECS, Oregon State University, Corvallis, OR 97331, USA

  • Venue:
  • Journal of Visual Languages and Computing
  • Year:
  • 2006

Quantified Score

Hi-index 0.00

Visualization

Abstract

We describe a type-inference algorithm that is based on labeling nodes with type information in a graph that represents type constraints. This algorithm produces the same results as the famous algorithm of Milner, but is much simpler to use, which is of importance especially for teaching type systems and type inference. The proposed algorithm employs a more concise notation and yields inferences that are shorter than applications of the traditional algorithm. Simplifications result, in particular, from three facts: (1) We do not have to maintain an explicit type environment throughout the algorithm because the type environment is represented implicitly through node labels. (2) The use of unification is simplified through label propagation along graph edges. (3) The typing decisions in our algorithm are dependency-driven (and not syntax-directed), which reduces notational overhead and bookkeeping.