Hm(x) type inference is clp(x) solving

  • Authors:
  • Martin Sulzmann;Peter j. Stuckey

  • Affiliations:
  • School of computing, national university of singapore, s16 level 5, 3 science drive 2, singapore 117543, singapore (e-mail: sulzmann@comp.nus.edu.sg);Nicta victoria laboratory, department of computer science and software engineering, university of melbourne, victoria 3010, australia (e-mail: pjs@cs.mu.oz.au)

  • Venue:
  • Journal of Functional Programming
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

The HM(X) system is a generalization of the Hindley/Milner system parameterized in the constraint domain X. Type inference is performed by generating constraints out of the program text, which are then solved by the domain-specific constraint solver X. The solver has to be invoked at the latest when type inference reaches a let node so that we can build a polymorphic type. A typical example of such an inference approach is Milner's algorithm W. We formalize an inference approach where the HM(X) type inference problem is first mapped to a CLP(X) program. The actual type inference is achieved by executing the CLP(X) program. Such an inference approach supports the uniform construction of type inference algorithms and has important practical consequences when it comes to reporting type errors. The CLP(X) style inference system, where X is defined by Constraint Handling Rules, is implemented as part of the Chameleon system.