Type Inference with Constrained Types

نویسندگان

  • Martin Odersky
  • Martin Sulzmann
  • Martin Wehr
چکیده

In this paper we present a general framework HM(X) for Hindley/Milner style type systems with constraints. We give a generic type inference algorithm for HM(X). Under suucient conditions on X, type inference will always compute the principal type of a term. We give an extension of our HM(X) systems which deals with subtyping. In particular, the type inference algorithm for subtypes computes principal types. Simpliication of the constraints inferred by the type inference algorithm is discussed in general for HM(X) and in the special case of subtyping.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Subtyping Constrained Types

A constrained type is a type that comes with a set of subtyping constraints on variables occurring in the type. Constrained type inference systems are a natural generalization of Hindley/Milner type inference to languages with subtyping. This paper develops several subtyping relations on polymorphic constrained types of a general form that allows recursive constraints and multiple bounds on typ...

متن کامل

Constrained Types and their

A constrained type consists of both a standard type and a constraint set. Such types enable ee-cient type inference for object-oriented languages with polymorphism and subtyping, as demonstrated by Eifrig, Smith, and Trifonov. Until now, it has been unclear how expressive constrained types are. In this paper we study constrained types without universal quantiication. We prove that they accept t...

متن کامل

Subtyping Constrained Types ( Draft ) Valery Trifonov

Constrained type systems are a natural generalization of Hindley/Milner type inference to languages with subtyping. This paper develops several subtyping relations on constrained types. We establish a full type abstraction property that equates an operational notion of subtyping with a semantic notion based on regular trees. The decidability of this notion of subtyping is open; we present a dec...

متن کامل

Type inference for recursively constrained types and its application to OOP

We de ne a powerful type inference mechanism with application to object oriented programming The types inferred are recursively constrained types types that come with a system of constraints These types may be viewed as generalizations of recur sive types and F bounded polymorphic types the forms of type that are necessary to properly encode object typings The base language we study I Soop inco...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • TAPOS

دوره 5  شماره 

صفحات  -

تاریخ انتشار 1999