Publications (47)7.83 Total impact

Article: The Algebra of Expansion
[Show abstract] [Hide abstract]
ABSTRACT: Expansion is an operation on typings pairs of type environments and result types in type systems for the λcalculus. Expansion was originally introduced for calculating possible typings of a λterm in systems with intersection types. This paper aims to clarify expansion and make it more accessible to a wider community by isolating the pure notion of expansion on its own, independent of type systems and types, and thereby make it easier for nonspecialists to obtain type inference with flexible precision by making use of theory and techniques that were originally developed for intersection types. We redefine expansion as a simple algebra on terms with variables, substitutions, composition, and miscellaneous constructors such that the algebra satisfies 8 simple axioms and axiom schemas: the 3 standard axioms of a monoid, 4 standard axioms or axiom schemas of substitutions including one that corresponds to the usual “substitution lemma” that composes substitutions, and 1 very simple axiom schema for expansion itself. Many of the results on the algebra have also been formally checked with the Coq proof assistant. We then take System E, a λcalculus type system with intersection types and expansion variables, and redefine it using the expansion algebra, thereby demonstrating how a single uniform notion of expansion can operate on both typings and proofs. Because we present a simplified version of System E omitting many features, this may be independently useful for those seeking an easiertocomprehend version.  [Show abstract] [Hide abstract]
ABSTRACT: This paper formalizes and proves correct a compilation scheme for mutuallyrecursive definitions in callbyvalue functional languages. This scheme supports a wider range of recursive definitions than previous methods. We formalize our technique as a translation scheme to a lambdacalculus featuring inplace update of memory blocks, and prove the translation to be correct. Comment: 62 pages, uses pic  [Show abstract] [Hide abstract]
ABSTRACT: The operation of expansion on typings was introduced at the end of the 1970s by Coppo, Dezani, and Venneri for reasoning about the possible typings of a term when using intersection types. Until recently, it has remained somewhat mysterious and unfamiliar, even though it is essential for carrying out compositional type inference. The fundamental idea of expansion is to be able to calculate the effect on the final judgement of a typing derivation of inserting a use of the intersectionintroduction typing rule at some (possibly deeply nested) position, without actually needing to build the new derivation. Recently, we have improved on this by introducing expansion variables (Evariables), which make the calculation straightforward and understandable. Evariables make it easy to postpone choices of which typing rules to use until later constraint solving gives enough information to allow making a good choice. Expansion can also be done for type constructors other than intersection, such as the ! of Linear Logic, and Evariables make this easy. There are no significant new technical results in this paper; instead this paper surveys and explains the technical results of a quarter of a century of work on expansion. 
Article: Unknown
[Show abstract] [Hide abstract]
ABSTRACT: Types are often used to control and analyze computer programs. 
Conference Paper: System E: Expansion Variables for Flexible Typing with Linear and Nonlinear Types and Intersection Types
[Show abstract] [Hide abstract]
ABSTRACT: Types are often used to control and analyze computer pro grams. Intersection types give great exibilit y, but have been dicult to implement. The ! operator, used to distinguish between linear and nonlinear types, has good potential for better resourceusage tracking, but has not been as exible as one might want and has been dicult to use in compositional analysis. We introduce System E, a type sys tem with expansion variables, linear intersection types, and the ! type constructor for creating nonlinear types. System E is designed for max imum exibilit y 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 diculties that expansion variables had in the earlier System I and extends expansion variables to work with ! in addition to the inter section type constructor. We present subject reduction for callbyneed evaluation and discuss program analysis in System E.  [Show abstract] [Hide abstract]
ABSTRACT: Principality of typings is the property that for each typable term, there is a typing from which all other typings are obtained via some set of operations. Type inference is the problem of finding a typing for a given term, if possible. We define an intersection type system which has principal typings and types exactly the strongly normalizable λterms. More interestingly, every finiterank restriction of this system (using Leivant's first notion of rank) has principal typings and also has decidable type inference. This is in contrast to System F where the finite rank restriction for every finite rank at 3 and above has neither principal typings nor decidable type inference. Furthermore, the notion of principal typings for our system involves only one operation, substitution, rather than several operations (not all substitutionbased) as in earlier presentations of principality for intersection types (without rank restrictions). In our system the earlier notion of expansion is integrated in the form of expansion variables, which are subject to substitution as are ordinary variables. A unificationbased type inference algorithm is presented using a new form of unification, βunification. 
Article: Unknown
[Show abstract] [Hide abstract]
ABSTRACT: Module systems are important for software engineering: they facilitate code reuse without compromising the correctness of programs. However, they still lack some exibility: rst, they do not allow mutually recursive denitions to span module boundaries ; second, denitions inside modules are bound early, and cannot be overridden later, as opposed to inheritance and overriding in classbased objectoriented languages, which follow the late binding semantics. This paper examines an alternative, hybrid idea of modularization concept, called mixin modules. We develop a language of callbyvalue mixin modules with a reduction semantics, and a sound type system for it, guaranteeing that programs will run correctly. 
Article: CallbyValue Mixin Modules
[Show abstract] [Hide abstract]
ABSTRACT: Mixin modules are a framework for modular programming that supports code parameterization, incremental programming via late binding and rede nitions, and crossmodule recursion. In this paper, we develop a language of mixin modules that supports callbyvalue evaluation, and formalize a reduction semantics and a sound type system for this language.  [Show abstract] [Hide abstract]
ABSTRACT: System E is a recently designed type system for the λcalculus with intersection types and expansion variables. During automatic type inference, expansion variables allow postponing decisions about which nonsyntaxdriven typing rules to use until the right information is available and allow implementing the choices via substitution.This paper uses expansion variables in a unificationbased automatic type inference algorithm for System~E that succeeds for every βnormalizable λterm. We have implemented and tested our algorithm and released our implementation publicly. Each step of our unification algorithm corresponds to exactly one βreduction step, and vice versa. This formally verifies and makes precise a stepforstep correspondence between type inference and βreduction. This also shows that type inference with intersection types and expansion variables can, in effect, carry out an arbitrary amount of partial evaluation of the program being analyzed.  [Show abstract] [Hide abstract]
ABSTRACT: Mixin modules are a framework for modular programming that supports code parameterization, incremental programming via late binding and redefinitions, and crossmodule recursion. In this paper, we develop a language of mixin modules that supports callbyvalue evaluation, and formalize a reduction semantics and a sound type system for this language.  [Show abstract] [Hide abstract]
ABSTRACT: A program analysis is compositional when the analysis result for a particular program fragment is obtained solely from the results for its immediate subfragments via some composition operator. This means the subfragments can be analyzed independently in any order. Many commonly used program analysis techniques (in particular, most abstract interpretations and most uses of the Hindley/Milner type system) are not compositional and require the entire text of a program for sound and complete analysis.  [Show abstract] [Hide abstract]
ABSTRACT: Functional languages encourage the extensive use of recursive fonctions and data structures. It is therefore important that they efficiently implement recursion. In this paper, we formalize and improve a known implementation technique for recursion. The original technique was introduced by Cousineau and Mauny as the «inplace updating trick». Consider a list of mutually recursive definitions. The technique consists in allocating a dummy, uninitialized heap block for each recursive definition. The size of these blocks is guessed from the shape of each definition. Then, the righthand sides of the definitions are computed. Recursivelydefined identifiers thus refer to the corresponding dummy blocks. This leads, for each definition, to a block of the expected size. Eventually, the contents of the obtained blocks are copied to the dummy blocks, updating them in place. The only change we propose to this scheme is to update the dummy blocks as soon as possible, immediately after each definition is computed, thus making it available for further use. At the source language level, the improvement allows to extend the class of expressions allowed as righthand sides of recursive definitions, usually restricted to syntactic functions. We formalize our technique as a translation scheme to a lambdacalculus featuring inplace updating of memory blocks, and prove the translation to be faithful.  [Show abstract] [Hide abstract]
ABSTRACT: Previous methods have generally identified the location of a type error as a particular program point or the program subtree rooted at that point. We present a new approach that identifies the location of a type error as a set of program points (a slice) all of which are necessary for the type error. We identify the criteria of completeness and minimality for type error slices. We discuss the advantages of complete and minimal type error slices over previous methods of presenting type errors. We present and prove the correctness of algorithms for finding complete and minimal type error slices for implicitly typed higherorder languages like Standard ML.  [Show abstract] [Hide abstract]
ABSTRACT: Previous methods have generally identified the location of a type error as a particular program point or the program subtree rooted at that point. We present a new approach that identifies the location of a type error as a set of program points (a slice) all of which are necessary for the type error. We describe algorithms for finding minimal type error slices for implicitly typed higherorder languages like Standard ML. 
Article: Branching Types
[Show abstract] [Hide abstract]
ABSTRACT: Although systems with intersection types have many unique capabilities, there has never been a fully satisfactory explicitly typed system with intersection types. We introduce and prove the basic properties of # , a typed #calculus with branching types and types with quantification over type selection parameters. The new system # an explicitly typed system with the same expressiveness as a system with intersection types. Typing derivations in # use branching types to squash together what would be separate parallel derivations in earlier systems with intersection types.  [Show abstract] [Hide abstract]
ABSTRACT: We present # CIL , a typed #calculus which serves as the foundation for a typed intermediate language for optimizing compilers for higherorder polymorphic programming languages. The key innovation of # CIL is a novel formulation of intersection and union types and flow labels on both terms and types. These flow types can encode polyvariant control and data flow information within a polymorphically typed program representation. Flow types can guide a compiler in generating customized data representations in a strongly typed setting. Since # CIL enjoys confluence, standardization, and subject reduction properties, it is a valuable tool for reasoning about programs and program transformations. 
 [Show abstract] [Hide abstract]
ABSTRACT: The CIL compiler for core Standard ML compiles whole ML programs using a novel typed intermediate language that supports the generation of typesafe customized data representations. In this paper, we present empirical data comparing the relative e#cacy of several di#erent flowbased customization strategies for function representations. We develop a cost model to interpret dynamic counts of operations required for each strategy. In this cost model, customizing the representation of closed functions gives a 1217% improvement on average over uniform closure representations, depending on the layout of the closure. We also present data on the relative e#ectiveness of various strategies for reducing representation pollution, i.e., situations where flow constraints require the representation of a value to be less e#cient than it would be in ideal circumstances. For the benchmarks tested and the types of representation pollution detected by our compiler, the pollution removal strategies we consider often cost more in overhead than they gain via enabled customizations. Notable exceptions are selective defunctionalization, a function representation strategy that often achieves significant customization benefits via aggressive pollution removal, and a simple form of flowdirected inlining, in which pollution removal allows multiple functions to be inlined at the same call site. 
Conference Paper: Functioning without closure
[Show abstract] [Hide abstract]
ABSTRACT: The CIL compiler for core Standard ML compiles whole ML programs using a novel typed intermediate language that supports the generation of typesafe customized data representations. In this paper, we present empirical data comparing the relative efficacy of several different flowbased customization strategies for function representations. We develop a cost model to interpret dynamic counts of operations required for each strategy. In this cost model, customizing the representation of closed functions gives a 1217% improvement on average over uniform closure representations, depending on the layout of the closure. We also present data on the relative effectiveness of various strategies for reducing representation pollution, i.e., situations where flow constraints require the representation of a value to be less efficient than it would be in ideal circumstances. For the benchmarks tested and the types of representation pollution detected by our compiler, the pollution removal strategies we consider often cost more in overhead than they gain via enabled customizations. Notable exceptions are selective defunctionalization, a function representation strategy that often achieves significant customization benefits via aggressive pollution removal, and a simple form of flowdirected inlining, in which pollution removal allows multiple functions to be inlined at the same call site.  [Show abstract] [Hide abstract]
ABSTRACT: We present a typed intermediate language # CIL for optimizing compilers for functionoriented and polymorphically typed programming languages (e.g., ML). The language # CIL is a typed lambda calculus with product, sum, intersection, and union types as well as function types annotated with flow labels. A novel formulation of intersection and union types supports encoding flow information in the typed program representation. This flow information can direct optimization.
Publication Stats
790  Citations  
7.83  Total Impact Points  
Top Journals
Institutions

19992012

HeriotWatt University
Edinburgh, Scotland, United Kingdom


19941999

Boston University
 Department of Computer Science
Boston, Massachusetts, United States


19971998

University of Glasgow
 School of Computing Science
Glasgow, Scotland, United Kingdom
