Type Inference using Constraint Handling Rules

Sandra Aparecida Alves, Mário Florido · Electronic Notes in Theoretical Computer Science · 2002

In this paper we present an implementation of the general system for type inference algorithms HM(X), using Prolog and Constraint Handling Rules. In our implementation the difference between the general aspects of the type inference algorithms and the constraint resolution module becomes clearer, when compared to other implementations of the same systems, usually made in a functional programming language. In the constraint module, solving equality constraints, here implemented by Prolog unification, is completely separated from constraint simplification, which is made by a solver implemented in CHR for each system. CHR rules become a clear and natural way of specifying the simplification mechanism.

Read the paper · More papers on PaperTik