GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

Intersection type discipline

In mathematical logic, the intersection type discipline is a branch of type theory encompassing type systems that use the intersection type constructor (\cap) to assign multiple types to a single term. In particular, if a term M can be assigned both the type \varphi_1 and the type \varphi_2 , then M can be assigned the intersection type \varphi_1 \cap \varphi_2 (and vice versa). Therefore, the intersection type constructor can be used to express finite heterogeneous ad hoc polymorphism (as opposed to parametric polymorphism). For example, the λ-term \lambda x.\ (x\;x) can be assigned the type ((\alpha \to \beta) \cap \alpha) \to \beta in most intersection type systems, assuming for the term... Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

In mathematical logic, the intersection type discipline is a branch of type theory encompassing type systems that use the intersection type constructor (\cap) to assign multiple types to a single term. In particular, if a term M can be assigned both the type \varphi_1 and the type \varphi_2 , then M can be assigned the intersection type \varphi_1 \cap \varphi_2 (and vice versa). Therefore, the intersection type constructor can be used to express finite heterogeneous ad hoc polymorphism (as opposed to parametric polymorphism). For example, the λ-term \lambda x.\!(x\;x) can be assigned the type ((\alpha \to \beta) \cap \alpha) \to \beta in most intersection type systems, assuming for the term variable x both the function type \alpha \to \beta and the corresponding argument type \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 and Scala, intersection types are used to express ad hoc polymorphism. M, N & ::= x \mid (\lambda x.\!M) \mid (M\;N) && \text{ where } x \text{ ranges over term variables}\\ \end{align} \varphi & ::= \alpha \mid \sigma \to \varphi && \text{ where } \alpha \text{ ranges over type variables}\\ \sigma & ::= \varphi_1 \cap \cdots \cap \varphi_n && \text{ where } n \geq 1 \end{align} The intersection type constructor ( \cap ) is taken modulo associativity, commutativity and idempotence. If the type language is extended to contain the empty intersection, i.e. \sigma = \varphi_1 \cap \cdots \cap \varphi_n \text{ where } n = 0 , then (\vdash_{\text{CD}}) is closed under β-equality and is sound and complete for inference semantics. M, N & ::= x \mid (\lambda x.\!M) \mid (M\;N) && \text{ where } x \text{ ranges over term variables}\\ \end{align} \sigma, \tau & ::= \alpha \mid \omega \mid \sigma \to \tau \mid \sigma \cap \tau && \text{ where } \alpha \text{ ranges over type variables} \end{align} ==References==

source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Intersection type discipline". 1788994245. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1374126807

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·