In mathematical logic, the intersection type discipline is a branch of type theory encompassing type systems that use the intersection type constructor
(\cap)
M
\varphi1
\varphi2
M
\varphi1\cap\varphi2
λx.(x x)
((\alpha\to\beta)\cap\alpha)\to\beta
x
\alpha\to\beta
\alpha
Prominent intersection type systems include the Coppo–Dezani type assignment system, the Barendregt-Coppo–Dezani type assignment system, and the essential intersection type assignment system.Most strikingly, intersection type systems are closely related to (and often exactly characterize) normalization properties of λ-terms under β-reduction.
In programming languages, such as TypeScript[1] and Scala,[2] intersection types are used to express ad hoc polymorphism.
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.While the initial work by Coppo and Dezani established a type theoretic characterization of strong normalization for the λI-calculus, Pottinger extended this characterization to the λK-calculus.In addition, Sallé contributed the notion of the universal type
\omega
\omega
Due to the correspondence with normalization, typability in prominent intersection type systems (excluding the universal type) is undecidable.Complementarily, undecidability of the dual problem of type inhabitation in prominent intersection type systems was proven by Paweł Urzyczyn.Later, this result was refined showing exponential space completeness of rank 2 intersection type inhabitation and undecidability of rank 3 intersection type inhabitation.Remarkably, principal type inhabitation is decidable in polynomial time.
The Coppo–Dezani type assignment system
(\vdashCD)
The term language of
(\vdashCD)
\begin{align} M,N&::=x\mid(λx.M)\mid(M N)&&wherexrangesovertermvariables\\ \end{align}
The type language of
(\vdashCD)
\begin{align} \varphi&::=\alpha\mid\sigma\to\varphi&&where\alpharangesovertypevariables\\ \sigma&::=\varphi1\cap … \cap\varphin&&wheren\geq1 \end{align}
\cap
The typing rules
(\toI)
(\toE)
(\capI)
(\capE)
(\vdashCD)
\begin{array}{cc} \dfrac{\Gamma,x:\sigma\vdashCDM:\varphi}{\Gamma\vdashCDλx.M:\sigma\to\varphi}(\toI) &\dfrac{\Gamma\vdashCDM:\sigma\to\varphi \Gamma\vdashCDN:\sigma}{\Gamma\vdashCDM N:\varphi}(\toE)\\\\ \dfrac{\Gamma\vdashCDM:\varphi1 \ldots \Gamma\vdashCDM:\varphin}{\Gamma\vdashCDM:\varphi1\cap … \cap\varphin}(\capI) &\dfrac{(1\leqi\leqn)}{\Gamma,x:\varphi1\cap … \cap\varphin\vdashCDx:\varphii}(\capE) \end{array}
Typability and normalization are closely related in
(\vdashCD)
\Gamma\vdashCDM:\sigma
M\to\betaN
\Gamma\vdashCDN:\sigma
\Gamma\vdashCDM:\sigma
M
M
\Gamma\vdashCDM:\sigma
\Gamma
\sigma
M
\Gamma\vdashCDM:\sigma
\Gamma
\sigma
\sigma=\varphi1\cap … \cap\varphinwheren=0
(\vdashCD)
The Barendregt–Coppo–Dezani type assignment system
(\vdashBCD)
(\vdashBCD)
\omega
(\vdashBCD)
(\cap)
(\to)
(\vdashBCD)
(\leq)
The term language of
(\vdashBCD)
\begin{align} M,N&::=x\mid(λx.M)\mid(M N)&&wherexrangesovertermvariables\\ \end{align}
The type language of
(\vdashBCD)
\begin{align} \sigma,\tau&::=\alpha\mid\omega\mid\sigma\to\tau\mid\sigma\cap\tau&&where\alpharangesovertypevariables \end{align}
(\leq)
\begin{align} &\sigma\leq\omega, \omega\leq\omega\to\omega, \sigma\cap\tau\leq\sigma, \sigma\cap\tau\leq\tau,\\ &(\sigma\to\tau1)\cap(\sigma\to\tau2)\leq\sigma\to\tau1\cap\tau2,\\ &if\sigma\leq\tau1and\sigma\leq\tau2,then\sigma\leq\tau1\cap\tau2,\\ &if\sigma2\leq\sigma1and\tau1\leq\tau2,then\sigma1\to\tau1\leq\sigma2\to\tau2 \end{align}
The typing rules
(\toI)
(\toE)
(\capI)
(\leq)
(A)
(\omega)
(\vdashBCD)
\begin{array}{cc} \dfrac{\Gamma,x:\sigma\vdashBCDM:\tau}{\Gamma\vdashBCDλx.M:\sigma\to\tau}(\toI) &\dfrac{\Gamma\vdashBCDM:\sigma\to\tau \Gamma\vdashBCDN:\sigma}{\Gamma\vdashBCDM N:\tau}(\toE)\\\\ \dfrac{\Gamma\vdashBCDM:\sigma \Gamma\vdashBCDM:\tau}{\Gamma\vdashBCDM:\sigma\cap\tau}(\capI) &\dfrac{\Gamma\vdashBCDM:\sigma (\sigma\leq\tau)}{\Gamma\vdashBCDM:\tau}(\leq)\\\\ \dfrac{}{\Gamma,x:\sigma\vdashBCDx:\sigma}(A) &\dfrac{}{\Gamma\vdashBCDM:\omega}(\omega) \end{array}
(\vdashBCD)
\Gamma\vdashBCDM:\sigma
M\to\betaN
\Gamma\vdashBCDN:\sigma
\Gamma\vdashBCDN:\sigma
M\to\betaN
\Gamma\vdashBCDM:\sigma
M
\Gamma\vdashBCDM:\sigma
(\omega)
\Gamma
\sigma
M
(\Gamma,\sigma)
\Gamma'\vdashBCDM:\sigma'
(\Gamma',\sigma')
(\Gamma,\sigma)