WIPIVERSE All articles

Intersection type discipline

Intersection type discipline is a branch of type theory in mathematical logic that encompasses type systems using the intersection type constructor (∩) to assign multiple types to a single term. It extends Curry's basic functionality system for the untyped lambda calculus by introducing the intersection type constructor alongside the standard function type constructor (→).

Overview

If a term M can be assigned both the type φ₁ and the type φ₂, then M can be assigned the intersection type φ₁ ∩ φ₂ (and vice versa). The intersection type constructor thus expresses finite heterogeneous ad hoc polymorphism, as opposed to parametric polymorphism. For example, the λ-term λx.(x x) can be assigned the type ((α → β) ∩ α) → β in most intersection type systems, assuming for the term variable x both the function type α → β and the corresponding argument type α.

History

The intersection type discipline was pioneered by Mario Coppo, Mariangiola Dezani-Ciancaglini, Patrick Sallé, and Garrel Pottinger. The underlying motivation was to study semantic properties (such as normalization) of the λ-calculus by means of type theory. Coppo and Dezani established a type theoretic characterization of strong normalization for the λI-calculus, while Pottinger extended this to the λK-calculus. Sallé contributed the notion of the universal type ω (the empty intersection) that can be assigned to any λ-term. In collaboration with Henk Barendregt, a filter λ-model for an intersection type system was developed, tying intersection types closely to λ-calculus semantics.

Prominent Systems

Coppo–Dezani (⊢CD): Extends the simply typed λ-calculus by allowing multiple types to be assumed for a term variable. In this system, typability and normalization are closely related: if a term is typable, it has a β-normal form, and strongly normalizing λ-terms are typable.

Barendregt–Coppo–Dezani (⊢BCD): Extends the Coppo–Dezani system by introducing the universal type constant ω (akin to the empty intersection), allowing the intersection type constructor to appear on the right-hand side of the arrow type constructor, and introducing an intersection type subtyping partial order (≤) with a corresponding typing rule. This system is sound and complete with respect to a filter λ-model, and it exactly characterizes strong normalization.

Essential intersection type assignment system: A further refinement that focuses on principal typing properties.

Properties and Decidability

  • Normalization characterization: Intersection type systems are closely related to (and often exactly characterize) normalization properties of λ-terms under β-reduction.
  • Undecidability: Typability in infinite intersection type systems is undecidable. However, restricting intersection types to finite rank makes typability decidable for any finite rank — in contrast to System F, where quantifier restrictions to finite ranks above 3 still yield undecidable typability.
  • Inhabitation: The dual problem of type inhabitation was proven undecidable for prominent intersection type systems by Paweł Urzyczyn. Rank-2 intersection type inhabitation is EXPSPACE-complete, while rank-3 and higher is undecidable.
  • Subtyping: Intersection type subtyping is decidable in quadratic time.

Practical Usage

In programming languages such as TypeScript and Scala, intersection types are used to express ad hoc polymorphism, allowing a value to have multiple types simultaneously.

Browse

More topics to explore

    Browse all articles