Graphic Type Constraints and Efficient Type Inference : from ML to MLF Draft Long Version
نویسندگان
چکیده
MLF is a type system that seamlessly merges ML-style type inference with System-F polymorphism. We propose a system of graphic (type) constraints that can be used to perform type inference in both ML or MLF. We show that this constraint system is a small extension of the formalism of graphic types, originally introduced to represent MLF types. We give a few semantic preserving transformations on constraints and propose a strategy for applying them to solve constraints. We show that the resulting algorithm has optimal complexity for MLF type inference, and argue that, as for ML, this complexity is linear under reasonable assumptions.
منابع مشابه
Graphic Type Constraints and Efficient Type Inference : from ML to MLF
MLF is a type system that seamlessly merges ML-style type inference with System-F polymorphism. We propose a system of graphic (type) constraints that can be used to perform type inference in both ML or MLF. We show that this constraint system is a small extension of the formalism of graphic types, originally introduced to represent MLF types. We give a few semantic preserving transformations o...
متن کاملRecasting MLF
The language MLF has been proposed as an alternative to System F that permits partial type inference a la ML. It differs from System F by its types and type-instance relation. Unfortunately, the definition of type instance is only syntactic, and not underpinned by some underlying semantics. It has so far only been justified a posteriori by the type soundness result. In this work, we revisit MLF...
متن کاملA graphical presentation of MLF types with a linear - time local unification algorithm . Draft
MLF is a language that extends ML and System F and combines the benefits of both. We propose a dag representation of MLF types that superposes a term-dag, encoding the underlying term structure with sharing, and a tree encoding the binding structure. Compared to the original definition, this representation is more canonical, as it factors out most of the notational details; it is also closely r...
متن کاملMLF: An extension of ML with first-class polymorphism and implicit instantiation. (MLF : Une extension de ML avec polymorphisme de second ordre et instanciation implicite)
We propose a type system MLF that generalizes ML with first-class polymorphism as in System F. Expressions may contain second-order type annotations. Every typable expression admits a principal type, which however depends on type annotations. Principal types capture all other types that can be obtained by implicit type instantiation and they can be inferred. All expressions of ML are well-typed...
متن کاملHarnessing MLF with the Power of System F
We provide a strong normalization result for ML, a type system generalizing ML with first-class polymorphism as in system F. The proof is achieved by translating ML into a calculus of coercions, and showing that this calculus is just a decorated version of system F.
متن کامل