Hostname: page-component-89b8bd64d-mmrw7 Total loading time: 0 Render date: 2026-05-13T08:47:16.078Z Has data issue: false hasContentIssue false

HM(X) type inference is CLP(X) solving

Published online by Cambridge University Press:  01 March 2008

MARTIN SULZMANN
Affiliation:
School of Computing, National University of Singapore, S16 Level 5, 3 Science Drive 2, Singapore 117543, Singapore (e-mail: sulzmann@comp.nus.edu.sg)
PETER J. STUCKEY
Affiliation:
NICTA Victoria Laboratory, Department of Computer Science and Software Engineering, University of Melbourne, Victoria 3010, Australia (e-mail: pjs@cs.mu.oz.au)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

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.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 2007
Submit a response

Discussions

No Discussions have been published for this article.