Type Inference using Constraint Handling Rules

Sandra Alves, Mário Florido

In Proc. of the International Workshop on Functional and (Constraint) Logic Programming (WFLP 2001) , Report No. 2017, University of Kiel


Abstract

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 more clear 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.