Abstract. Types are often used to control and analyze computer programs. Intersection types give great flexibility, but have been difficult to implement. The ! operator, used to distinguish between linear and non-linear types, has good potential for better resource-usage tracking, but has not been as flexible as one might want and has been difficult to use in compositional analysis. We introduce System E, a type system with expansion variables, linear intersection types, and the ! type constructor for creating non-linear types. System E is designed for maximum flexibility in automatic type inference and for ease of automatic manipulation of type information. Expansion variables allow postponing the choice of which typing rules to use until later constraint solving gives enough information to allow making a good choice. System E removes many difficulties that expansion variables had in the earlier System I and extends expansion variables to work with ! in addition to the intersection type constructor. We present subject reduction for call-by-need evaluation and discuss program analysis in System E.
Discussion
Background and MotivationMany current forms of program analysis, including many type-based analyses, work best when given the entire program to be analyzed [21,7]. However, by their very nature, large software systems are assembled from components that are designed separately and updated at different times. Hence, for large software systems, a program analysis methodology will benefit greatly from being compositional, and thereby usable in a modular and incremental fashion.Type systems for programming languages that are flexible enough to allow safe code reuse and abstract datatypes must support some kind of polymorphic types. Theoretical models for type polymorphism in existing programming languages (starting in the 1980s through now) have generally obtained type polymorphism via ∀ ("for all") [15,6] and ∃ ("there exists") quantifiers [13] or closely related methods. Type systems with ∀ and ∃ quantifiers alone tend to