J. B. Wells

Heriot-Watt University, Edinburgh, Scotland, United Kingdom

Are you J. B. Wells?

Claim your profile

Publications (46)4.19 Total impact

  • Sébastien Carlier, J. B. Wells
    [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 non-specialists 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 easier-to-comprehend version.
    Fundamenta Informaticae 01/2012; 121(1-4):43-82. DOI:10.3233/FI-2012-771 · 0.48 Impact Factor
  • Source
    [Show abstract] [Hide abstract]
    ABSTRACT: This paper formalizes and proves correct a compilation scheme for mutually-recursive definitions in call-by-value functional languages. This scheme supports a wider range of recursive definitions than previous methods. We formalize our technique as a translation scheme to a lambda-calculus featuring in-place update of memory blocks, and prove the translation to be correct. Comment: 62 pages, uses pic
    Higher-Order and Symbolic Computation 02/2009; DOI:10.1007/s10990-009-9042-z
  • Source
    Sébastien Carlier, J.B. Wells
    [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 intersection-introduction 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 (E-variables), which make the calculation straightforward and understandable. E-variables 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 E-variables 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.
    Electronic Notes in Theoretical Computer Science 07/2005; DOI:10.1016/j.entcs.2005.03.026
  • Article: Unknown
    [Show abstract] [Hide abstract]
    ABSTRACT: Types are often used to control and analyze computer programs.
  • Source
    A.J. Kfoury, J.B. Wells
    [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 finite-rank 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 substitution-based) 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 unification-based type inference algorithm is presented using a new form of unification, β-unification.
    Theoretical Computer Science 02/2004; DOI:10.1016/j.tcs.2003.10.032 · 0.52 Impact Factor
  • 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 class-based object-oriented 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 call-by-value mixin modules with a reduction semantics, and a sound type system for it, guaranteeing that programs will run correctly.
  • Source
    [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 cross-module recursion. In this paper, we develop a language of mixin modules that supports call-by-value evaluation, and formalize a reduction semantics and a sound type system for this language.
  • Source
    [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 cross-module recursion. In this paper, we develop a language of mixin modules that supports call-by-value evaluation, and formalize a reduction semantics and a sound type system for this language.
  • Source
    [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 non-linear types, has good potential for better resource-usage 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 non-linear 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 call-by-need evaluation and discuss program analysis in System E.
    Programming Languages and Systems, 13th European Symposium on Programming, ESOP 2004, Held as Part of the Joint European Conferences on Theory and Practice of Software, ETAPS 2004, Barcelona, Spain, March 29 - April 2, 2004, Proceedings; 01/2004
  • Source
    Sébastien Carlier, J. B. Wells
    [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 non-syntax-driven typing rules to use until the right information is available and allow implementing the choices via substitution.This paper uses expansion variables in a unification-based 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 step-for-step 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: 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.
  • Source
    [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 cross-module recursion. In this paper, we develop a language of mixin modules that supports call-by-value evaluation, and formalize a reduction semantics and a sound type system for this language.
  • Source
    Christian Haack, J.B. Wells
    [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 higher-order languages like Standard ML.
    Science of Computer Programming 01/2003; DOI:10.1016/j.scico.2004.01.004 · 0.55 Impact Factor
  • Source
    Christian Haack, J. B. Wells
    [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 higher-order languages like Standard ML.
    12/2002: pages 284-301;
  • Source
    J. B. Wells, Christian Haack
    [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.
  • Source
    [Show abstract] [Hide abstract]
    ABSTRACT: We present -calculus which serves as the foundation for a typed intermediate language for optimizing compilers for higher-order polymorphic programming languages. The key innovation of CIL enjoys confluence, standardization, and subject reduction properties, it is a valuable tool for reasoning about programs and program transformations.
    Journal of Functional Programming 05/2002; 12(03). DOI:10.1017/S0956796801004245 · 0.78 Impact Factor
  • Source
    Algebraic Methodology and Software Technology, 9th International Conference, AMAST 2002, Saint-Gilles-les-Bains, Reunion Island, France, September 9-13, 2002, Proceedings; 01/2002
  • Source
    [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 type-safe customized data representations. In this paper, we present empirical data comparing the relative e#cacy of several di#erent flow-based 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 12--17% 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 flow-directed inlining, in which pollution removal allows multiple functions to be inlined at the same call site.
  • [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 type-safe customized data representations. In this paper, we present empirical data comparing the relative efficacy of several different flow-based 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 12-17% 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 flow-directed inlining, in which pollution removal allows multiple functions to be inlined at the same call site.
    the sixth ACM SIGPLAN international conference; 10/2001
  • Source
    [Show abstract] [Hide abstract]
    ABSTRACT: We present a typed intermediate language # CIL for optimizing compilers for function-oriented 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.