Lectures onType Theory
System F
appendix sectionrules

System F

The type-variable context Δ is a list of distinct variables; every type in Γ is formed under Δ. Formation and Church typing are the following complete rules.

 typectx
F-Δ-Emp
Δ typectxXΔ
Δ,X typectx
F-Δ-Ext
Δ typectx
Δ ctx
F-Γ-Emp
ΔΓ ctxΔA typexdom(Γ)
ΔΓ,x:A ctx
F-Γ-Ext
XΔ
ΔX type
F-Ty-Var
ΔA typeΔB type
ΔAB type
F-Ty-Arr
Δ,XA typeXΔ
ΔX.A type
F-Ty-All
x:AΓ
Δ;Γx:A
F-Var
Δ;Γ,x:At:B
Δ;Γλx:A.t:AB
F-Arr-I
Δ;Γt:ABΔ;Γu:A
Δ;Γtu:B
F-Arr-E
Δ,X;Γt:AXΔ
Δ;ΓΛX.t:X.A
F-All-I
Δ;Γt:X.AΔB type
Δ;Γt[B]:A[B/X]
F-All-E

The two compatible beta roots are (λx:A.t)uβt[u/x],(ΛX.t)[B]βt[B/X]. The relation β is closed under both sides of application, the bodies of λ and Λ, and the operator of type application. Equivalently, from tβt one may infer λx:A.tβλx:A.t,ΛX.tβΛX.t,t[B]βt[B],tuβtu,utβut. The call-by-value subrelation instead uses v::=λx:A.tΛX.t,E::=[]EtvEE[A], closes the two beta roots only under E, and requires a value argument at the term-beta root. This is the operational system of definition 5.8. For confluence, the complete parallel beta relation is

xβx
P-Var
sβs
λx:A.sβλx:A.s
P-Lam
sβsuβu
suβsu
P-App
sβs
ΛX.sβΛX.s
P-TLam
sβs
s[A]βs[A]
P-TApp
sβsuβu
(λx:A.s)uβs[u/x]
P-Beta
sβs
(ΛX.s)[A]βs[A/X]
P-TBeta

For Curry System F, erase the annotations, Λ, and type application from the term grammar. Its complete typing rules are

x:AΓ
Δ;ΓCx:A
C-Var
Δ;Γ,x:ACm:B
Δ;ΓCλx.m:AB
C-Arr-I
Δ;ΓCm:ABΔ;ΓCn:A
Δ;ΓCmn:B
C-Arr-E
Δ,X;ΓCm:AXΔ
Δ;ΓCm:X.A
C-All-I
Δ;ΓCm:X.AΔB type
Δ;ΓCm:A[B/X]
C-All-E

Chapter 6 changes none of these syntax, formation, typing, or reduction rules. Its relations live in the metatheory over closed typed beta-classes; the relational interpretation and abstraction theorem are therefore recorded in appendix C, appendix D rather than as a second object-language rule table.

Search the book

Type to search the local edition.