Pure type system explained

In the branches of mathematical logic known as proof theory and type theory, a pure type system (PTS), previously known as a generalized type system (GTS), is a form of typed lambda calculus that allows an arbitrary number of sorts and dependencies between any of these. The framework can be seen as a generalisation of Barendregt's lambda cube, in the sense that all corners of the cube can be represented as instances of a PTS with just two sorts.[1] [2] In fact, Barendregt (1991) framed his cube in this setting.[3] Pure type systems may obscure the distinction between types and terms and collapse the type hierarchy, as is the case with the calculus of constructions, but this is not generally the case, e.g. the simply typed lambda calculus allows only terms to depend on terms.

Pure type systems were independently introduced by Stefano Berardi (1988) and Jan Terlouw (1989).[1] [2] Barendregt discussed them at length in his subsequent papers.[4] In his PhD thesis,[5] Berardi defined a cube of constructive logics akin to the lambda cube (these specifications are non-dependent). A modification of this cube was later called the L-cube by Herman Geuvers, who in his PhD thesis extended the Curry–Howard correspondence to this setting.[6] Based on these ideas, G. Barthe and others defined classical pure type systems (CPTS) by adding a double negation operator.[7] Similarly, in 1998, Tijn Borghuis introduced modal pure type systems (MPTS).[8] Roorda has discussed the application of pure type systems to functional programming; and Roorda and Jeuring have proposed a programming language based on pure type systems.[9]

The systems from the lambda cube are all known to be strongly normalizing. Pure type systems in general need not be, for example System U from Girard's paradox is not. (Roughly speaking, Girard found pure systems in which one can express the sentence "the types form a type".) Furthermore, all known examples of pure type systems that are not strongly normalizing are not even (weakly) normalizing: they contain expressions that do not have normal forms, just like the untyped lambda calculus. It is a major open problem in the field whether this is always the case, i.e. whether a (weakly) normalizing PTS always has the strong normalization property. This is known as the Barendregt–Geuvers–Klop conjecture[10] (named after Henk Barendregt, Herman Geuvers, and Jan Willem Klop).

Definition

A pure type system is defined by a triple (\mathcal, \mathcal, \mathcal) where \mathcal is the set of sorts, \mathcal \subseteq \mathcal^2 is the set of axioms, and \mathcal \subseteq \mathcal^3 is the set of rules. Typing in pure type systems is determined by the following rules, where s is any sort:[4]

(s1,s2)\inl{A
}\quad \text
\Gamma\vdashA:sx\notindom(\Gamma)
\Gamma,x:A\vdashx:A

(start)

\Gamma\vdashA:B\Gamma\vdashC:sx\notindom(\Gamma)
\Gamma,x:C\vdashA:B

(weakening)

\Gamma\vdashA:s1\Gamma,x:A\vdashB:s2(s1,s2,s3)\inl{R
}\quad\text
\Gamma\vdashC:\Pix:A.B\Gamma\vdasha:A
\Gamma\vdashCa:B[x:=a]

(application)

\Gamma,x:A\vdashb:B\Gamma\vdash\Pix:A.B:s
\Gamma\vdashλx:A.b:\Pix:A.B

(abstraction)

\Gamma\vdashA:BB=\betaB'\Gamma\vdashB':s
\Gamma\vdashA:B'

(conversion)

Implementations

The following programming languages have pure type systems:

See also

References

Further reading

External links

Notes and References

  1. Book: Pierce, Benjamin. Types and Programming Languages. limited. MIT Press. 2002. 0-262-16209-1. 466.
  2. Book: Fairouz D. . Kamareddine . Twan . Laan . Rob P. . Nederpelt . A modern perspective on type theory: from its origins until today . Springer . 2004 . 1-4020-2334-0 . Section 4c: Pure type systems . 116 .
  3. H.P. Barendregt . H. P. . Barendregt . Introduction to generalized type systems . . 1 . 2 . 125–154 . 1991 . 10.1017/s0956796800020025 . 2066/17240 . 44757552 . free .
  4. Book: Barendregt, H. . S. . Abramsky . D. . Gabbay . T. . Maibaum . Lambda calculi with types. ftp://ftp.cs.ru.nl/pub/CompMath.Found/HBK.ps. Handbook of Logic in Computer Science. Oxford Science Publications. 1992.
  5. S. . Berardi . Type dependence and Constructive Mathematics . PhD . . 1990 .
  6. H. . Geuvers . Logics and Type Systems . 10.1.1.56.7045 . PhD . . 1993 .
  7. G. . Barthe . J. . Hatcliff . M. H. . Sørensen . A Notion of Classical Pure Type System. 10.1.1.32.1371. Electronic Notes in Theoretical Computer Science. 6. 1997. 4–59. 10.1016/S1571-0661(05)80170-7.
  8. Tijn . Borghuis . Modal Pure Type Systems . . 7 . 3 . 1998 . 265–296 . 10.1023/A:1008254612284 . 5067584 .
  9. Web site: Pure Type Systems for Functional Programming. Jan-Willem Roorda. Johan Jeuring. 2010-08-29. https://web.archive.org/web/20111002055103/http://people.cs.uu.nl/johanj/MSc/jwroorda/. 2011-10-02. dead. Roorda's masters' thesis (linked from the cited page) also contains a general introduction to pure type systems.
  10. Book: Morten Heine . Sørensen . Paweł . Urzyczyn . Lectures on the Curry–Howard isomorphism . Elsevier . 2006 . 0-444-52077-5 . Pure type systems and the lambda cube § 14.7 . https://books.google.com/books?id=_mtnm-9KtbEC&pg=PA358 . 358.
  11. http://sage.soe.ucsc.edu/ SAGE
  12. https://www.cs.ru.nl/~janz/yarrow/ Yarrow
  13. https://web.archive.org/web/20111002055103/http://people.cs.uu.nl/johanj/MSc/jwroorda/ Henk 2000