A Type Inference System Based on Saturation of Subtyping Constraints
Un système d'inférence de types fondé sur la saturation des contraintes de sous-typage
Résumé
This paper presents a powerful and flexible technique for defining type inference algorithms, on an ML-like language, that involve subtyping and whose soundness can be proved. We define a typing algorithm as a set of inference rules of three distinct forms: typing rules collect subtyping constraints to be satisfied, instantiation rules instantiate type schemes, and saturation rules specify how to check the validity and consistency of collected constraints. Essentially, type inference then proceeds in two intertwined phases: one that extracts constraints and the other that saturates the sets of constraints. Our technique extends easily to the treatment of high-level features such as polymorphism, overloading, variants and pattern-matching, or generalized algebraic data types (GADTs).
Origine | Fichiers produits par l'(les) auteur(s) |
---|
Loading...