Jump to content

Intersection type discipline: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Mrhaandi (talk | contribs)
m use cite journal template
Mrhaandi (talk | contribs)
m use cite conference template
Line 112: Line 112:
{{Reflist|refs=
{{Reflist|refs=
<ref name=CD78>{{cite journal |doi=10.1007/BF02011875 |title=A new type assignment for &lambda;-terms |journal=Archiv für mathematische Logik und Grundlagenforschung |volume=19 |issue=1 |pages=139-156 |year=1978 |last1=Coppo |first1=Mario |last2=Dezani-Ciancaglini |first2=Mariangiola }}</ref>
<ref name=CD78>{{cite journal |doi=10.1007/BF02011875 |title=A new type assignment for &lambda;-terms |journal=Archiv für mathematische Logik und Grundlagenforschung |volume=19 |issue=1 |pages=139-156 |year=1978 |last1=Coppo |first1=Mario |last2=Dezani-Ciancaglini |first2=Mariangiola }}</ref>
<ref name=CDS79>{{cite conference |title=Functional Characterization of Some Semantic Equalities inside Lambda-Calculus |last1=Coppo |first1=Mario |last2=Dezani-Ciancaglini |first2=Mariangiola |last3=Sallé |first3=Patrick |year=1979 |editor=Hermann A. Maurer |volume=71 |book-title=Automata, Languages and Programming, 6th Colloquium, Graz, Austria, July 16-20, 1979, Proceedings |publisher=Springer |pages=133-146 |isbn=3-540-09510-1 |doi=10.1007/3-540-09510-1_11 }}</ref>
<ref name=CDS79>Coppo, M., Dezani-Ciancaglini, M., & Sallé, P. (1979, July). Functional characterization of some semantic equalities inside &lambda;-calculus. In International Colloquium on Automata, Languages, and Programming (pp. 133-146). Springer, Berlin, Heidelberg.</ref>
<ref name=CD80>{{cite journal |doi=10.1305/ndjfl/1093883253 |title=An extension of the basic functionality theory for the &lambda;-calculus |journal=Notre Dame Journal of Formal Logic |volume=21 |issue=4 |pages=685–693 |year=1980 |last1=Coppo |first1=Mario |last2=Dezani-Ciancaglini |first2=Mariangiola }}</ref>
<ref name=CD80>{{cite journal |doi=10.1305/ndjfl/1093883253 |title=An extension of the basic functionality theory for the &lambda;-calculus |journal=Notre Dame Journal of Formal Logic |volume=21 |issue=4 |pages=685–693 |year=1980 |last1=Coppo |first1=Mario |last2=Dezani-Ciancaglini |first2=Mariangiola }}</ref>
<ref name=P80>Pottinger, G. (1980). A type assignment for the strongly normalizable &lambda;-terms. To HB Curry: essays on combinatory logic, lambda calculus and formalism, 561-577.</ref>
<ref name=P80>Pottinger, G. (1980). A type assignment for the strongly normalizable &lambda;-terms. To HB Curry: essays on combinatory logic, lambda calculus and formalism, 561-577.</ref>

Revision as of 14:35, 5 August 2019

In mathematical logic, the intersection type discipline is a branch of type theory encompassing type systems that use the intersection type constructor to assign multiple types to a single term.[1] In particular, if a term can be assigned both the type and the type , then can be assigned the intersection type (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 can be assigned the type in most intersection type systems, assuming for the term variable both the function type and the corresponding argument type .

Prominent intersection type systems include the Coppo–Dezani type assignment system,[2] the Barendregt-Coppo–Dezani type assignment system,[3] and the essential intersection type assignment system.[4] Most strikingly, intersection type systems are closely related to (and often exactly characterize) normalization properties of λ-terms under β-reduction.

In programming languages, such as TypeSript[5] and Scala,[6] intersection types are used to express ad hoc polymorphism.

History

The intersection type discipline was pioneered by Mario Coppo, Mariangiola Dezani-Ciancaglini, Patrick Sallé, and Garrel Pottinger.[2][7][8] The underlying motivation was to study semantic properties (such as normalization) of the λ-calculus by means of type theory.[9] While the initial work by Coppo and Dezani established a type theoretic characterization of strong normalization for the λI-calculus,[2] Pottinger extended this characterization to the λK-calculus.[7] In addition, Sallé contributed the notion of the universal type that can be assigned to any λ-term, thereby corresponding to the empty intersection.[8] Using the universal type allowed for a fine-grained analysis of head normalization, normalization, and strong normalization.[10] In collaboration with Henk Barendregt, a filter λ-model for an intersection type system was given, tying intersection types ever more closely to λ-calculus semantics.

Coppo–Dezani type assignment system

The Coppo–Dezani type assignment system extends the simply typed λ-calculus by allowing multiple types to be assumed for a term variable.[2]

Term language

The term language of is given by λ-terms (or, lambda expressions):

Type language

The type language of is inductively defined by the following grammar:

The intersection type constructor () is taken modulo associativity, commutativity and idempotence.

Typing rules

The typing rules , , , and of are

Properties

Typability and normalization are closely related in by the following properties:[2]

  • Subject reduction: If and , then .
  • Normalization: If , then has a β-normal form.
  • Typability of strongly normalizing λ-terms: If is strongly normalizing, then for some and .
  • Characterization of λI-normalization: has a normal form in the λI-calculus, if and only if for some and .

If the type language is extended to contain the empty intersection, i.e. , then is closed under β-equality and is sound and complete for inference semantics.[11]

Barendregt–Coppo–Dezani type assignment system

The Barendregt–Coppo–Dezani type assignment system extends the Coppo–Dezani type assignment system in the following three aspects:[3]

  • introduces the universal type constant (akin to the empty intersection) that can be assigned to any λ-term.
  • allows the intersection type constructor to appear on the right-hand side of the arrow type constructor .
  • introduces the intersection type subtyping partial order on types together with a corresponding typing rule.

Term language

The term language of is given by λ-terms (or, lambda expressions):

Type language

The type language of is inductively defined by the following grammar:

Intersection type subtyping

Intersection type subtyping is defined as the smallest preorder (reflexive and transitive relation) over intersection types satisfying the following properties:

Intersection type subtyping is decidable in quadratic time.[12]

Typing rules

The typing rules , , , , , and of are:

Properties

  • Semantics: is sound and complete wrt. a filter λ-model, in which the interpretation of a λ-term coincides with the set of types that can be assigned to it.[3]
  • Subject reduction: If and , then .[3]
  • Subject expansion: If and , then .[3]
  • Characterization of strong normalization: is strongly normalizing wrt. β-reduction, if and only if is derivable without rule for some and .[13]
  • Principal pairs: If is strongly normalizing, then there exists a principal pair such that for any typing the pair can be obtained from the principal pair by means of type expansions, liftings, and substitutions.[14]

References

  1. ^ Henk Barendregt; Wil Dekkers; Richard Statman (20 June 2013). Lambda Calculus with Types. Cambridge University Press. pp. 1–. ISBN 978-0-521-76614-2.
  2. ^ a b c d e Coppo, Mario; Dezani-Ciancaglini, Mariangiola (1980). "An extension of the basic functionality theory for the λ-calculus". Notre Dame Journal of Formal Logic. 21 (4): 685–693. doi:10.1305/ndjfl/1093883253.
  3. ^ a b c d e Barendregt, Henk; Coppo, Mario; Dezani-Ciancaglini, Mariangiola (1983). "A filter lambda model and the completeness of type assignment". Journal of Symbolic Logic. 48 (4): 931–940. doi:10.2307/2273659. JSTOR 2273659.
  4. ^ van Bakel, Steffen (2011). "Strict intersection types for the Lambda calculus". ACM Computing Surveys. 43 (3): 20:1-20:49. doi:10.1145/1922649.1922657.
  5. ^ "Intersection Types in TypeSript". Retrieved 2019-08-01.
  6. ^ "Compound Types in Scala". Retrieved 2019-08-01.
  7. ^ a b Pottinger, G. (1980). A type assignment for the strongly normalizable λ-terms. To HB Curry: essays on combinatory logic, lambda calculus and formalism, 561-577.
  8. ^ a b Coppo, Mario; Dezani-Ciancaglini, Mariangiola; Sallé, Patrick (1979). "Functional Characterization of Some Semantic Equalities inside Lambda-Calculus". In Hermann A. Maurer (ed.). Automata, Languages and Programming, 6th Colloquium, Graz, Austria, July 16-20, 1979, Proceedings. Vol. 71. Springer. pp. 133–146. doi:10.1007/3-540-09510-1_11. ISBN 3-540-09510-1.
  9. ^ Coppo, Mario; Dezani-Ciancaglini, Mariangiola (1978). "A new type assignment for λ-terms". Archiv für mathematische Logik und Grundlagenforschung. 19 (1): 139–156. doi:10.1007/BF02011875.
  10. ^ Coppo, Mario; Dezani-Ciancaglini, Mariangiola; Venneri, Betti (1981). "Functional characters of solvable terms". Mathematical Logic Quarterly. 27 (2–6): 45–58. doi:10.1002/malq.19810270205.
  11. ^ Van Bakel, Steffen (1992). "Complete restrictions of the intersection type discipline". Theoretical Computer Science. 102 (1): 135–163. doi:10.1016/0304-3975(92)90297-S.
  12. ^ Dudenhefner, Andrej; Martens, Moritz; Rehof, Jakob (2017). "The algebraic intersection type unification problem". Logical Methods in Computer Science. 13 (3). doi:10.23638/LMCS-13(3:9)2017.
  13. ^ Ghilezan, Silvia (1996). "Strong normalization and typability with intersection types". Notre Dame Journal of Formal Logic. 37 (1): 44–52. doi:10.1305/ndjfl/1040067315.
  14. ^ Ronchi Della Rocca, Simona; Venneri, Betti (1983). "Principal type schemes for an extended type theory". Theoretical Computer Science. 28 ((1-2)): 151–169. doi:10.1016/0304-3975(83)90069-5.