Reynolds’ Parametricity
Patricia Johann Appalachian State University
cs.appstate.edu/
∼johannp
Based on joint work with Neil Ghani, Fredrik Nordvall Forsberg, Federico Orsanigo, and Tim Revell
OPLSS 2016
Reynolds Parametricity Patricia Johann Appalachian State University - - PowerPoint PPT Presentation
Reynolds Parametricity Patricia Johann Appalachian State University cs.appstate.edu/ johannp Based on joint work with Neil Ghani, Fredrik Nordvall Forsberg, Federico Orsanigo, and Tim Revell OPLSS 2016 Course Outline Topic:
cs.appstate.edu/
∼johannp
OPLSS 2016
Topic: Reynolds’ theory of parametric polymorphism for System F Goals: - extract the fibrational essence of Reynolds’ theory
Topic: Reynolds’ theory of parametric polymorphism for System F Goals: - extract the fibrational essence of Reynolds’ theory
functions across all type instantiations
functions across all type instantiations
functions across all type instantiations
– must be given by a single algorithm that works across all types
functions across all type instantiations
– must be given by a single algorithm that works across all types – cannot make use of any type-specific operations (e.g., +, ¬)
functions across all type instantiations
– must be given by a single algorithm that works across all types – cannot make use of any type-specific operations (e.g., +, ¬) – must map related inputs to related outputs
(and similarly for f : τ1 → τ2)
(and similarly for f : τ1 → τ2)
metric polymorphism do not contain ad hoc functions
(and similarly for f : τ1 → τ2)
metric polymorphism do not contain ad hoc functions
tem F by giving, compositionally:
tem F by giving, compositionally: – a set interpretation for every type
tem F by giving, compositionally: – a set interpretation for every type – a relational interpretation for every type
tem F by giving, compositionally: – a set interpretation for every type – a relational interpretation for every type – a set interpretation for every term
tem F by giving, compositionally: – a set interpretation for every type – a relational interpretation for every type – a set interpretation for every term
tem F by giving, compositionally: – a set interpretation for every type – a relational interpretation for every type – a set interpretation for every term
– Intuitively, if the arguments to a function are related at the rela- tional interpretations of their types, then applying the function to them yields results that are related at the relational interpretation
... Reynolds discovered that his own construction was flawed!
... Reynolds discovered that his own construction was flawed!
phism for System F can exist in classical set theory
... Reynolds discovered that his own construction was flawed!
phism for System F can exist in classical set theory
we work in a constructive set theory
... Reynolds discovered that his own construction was flawed!
phism for System F can exist in classical set theory
we work in a constructive set theory
System F have been constructed
... Reynolds discovered that his own construction was flawed!
phism for System F can exist in classical set theory
we work in a constructive set theory
System F have been constructed
... Reynolds discovered that his own construction was flawed!
phism for System F can exist in classical set theory
we work in a constructive set theory
System F have been constructed
– having the simplicity of functorial models, and
... Reynolds discovered that his own construction was flawed!
phism for System F can exist in classical set theory
we work in a constructive set theory
System F have been constructed
– having the simplicity of functorial models, and – having enough structure to derive consequences of parametricity that serve as gold standard properties for “good” models
– ∆ a type context – τ a type
– ∆ a type context – τ a type
αi ∈ ∆ ∆ ⊢ αi ∆ ⊢ τ1 ∆ ⊢ τ2 ∆ ⊢ τ1 → τ2 ∆, α ⊢ τ ∆ ⊢ ∀α.τ
– ∆ a type context – τ a type
αi ∈ ∆ ∆ ⊢ αi ∆ ⊢ τ1 ∆ ⊢ τ2 ∆ ⊢ τ1 → τ2 ∆, α ⊢ τ ∆ ⊢ ∀α.τ
– ∆ a type context – x1, ..., xm term variables – Γ of the form x1 : τ1, ..., xm : τm – ∆ ⊢ τi for each i ∈ {1, ..., m}
– ∆ a type context – x1, ..., xm term variables – Γ of the form x1 : τ1, ..., xm : τm – ∆ ⊢ τi for each i ∈ {1, ..., m}
– ∆ a type context – ∆ ⊢ Γ a term context – ∆ ⊢ τ a type judgement – t a term
∆ ⊢ τi xi : τi ∈ Γ ∆; Γ ⊢ xi : τi ∆; Γ, x : τ1 ⊢ t : τ2 ∆; Γ ⊢ λx.t : τ1 → τ2 ∆; Γ ⊢ t1 : τ1 ∆; Γ ⊢ t2 : τ1 → τ2 ∆; Γ ⊢ t2 t1 : τ2 ∆, α; Γ ⊢ t : τ ∆; Γ ⊢ Λα.t : ∀α.τ ∆; Γ ⊢ t : ∀α.τ2 ∆ ⊢ τ1 ∆; Γ ⊢ t τ1 : τ2[α → τ1]
∆ ⊢ τi xi : τi ∈ Γ ∆; Γ ⊢ xi : τi ∆; Γ, x : τ1 ⊢ t : τ2 ∆; Γ ⊢ λx.t : τ1 → τ2 ∆; Γ ⊢ t1 : τ1 ∆; Γ ⊢ t2 : τ1 → τ2 ∆; Γ ⊢ t2 t1 : τ2 ∆, α; Γ ⊢ t : τ ∆; Γ ⊢ Λα.t : ∀α.τ ∆; Γ ⊢ t : ∀α.τ2 ∆ ⊢ τ1 ∆; Γ ⊢ t τ1 : τ2[α → τ1]
∆ ⊢ τi xi : τi ∈ Γ ∆; Γ ⊢ xi : τi ∆; Γ, x : τ1 ⊢ t : τ2 ∆; Γ ⊢ λx.t : τ1 → τ2 ∆; Γ ⊢ t1 : τ1 ∆; Γ ⊢ t2 : τ1 → τ2 ∆; Γ ⊢ t2 t1 : τ2 ∆, α; Γ ⊢ t : τ ∆; Γ ⊢ Λα.t : ∀α.τ ∆; Γ ⊢ t : ∀α.τ2 ∆ ⊢ τ1 ∆; Γ ⊢ t τ1 : τ2[α → τ1]
∆; Γ ⊢ λx. t = λy. t[x → y] : τ1 → τ2 (αλ) ∆; Γ ⊢ Λα1. t = Λα2. t[α1 → α2] : ∀α1.τ (αΛ) ∆; Γ ⊢ (λx. t) s = t[x → s] : τ2 (βλ) ∆; Γ ⊢ (Λα. t)τ1 = t : τ2[α → τ1] (βΛ) x / ∈ F V (t) ∆; Γ ⊢ t = λx. t x : τ1 → τ2 (ηλ) α / ∈ F T V (t) ∆; Γ ⊢ t = Λα. t α : ∀α.τ (ηΛ) ∆; Γ, x : τ1 ⊢ t1 = t2 : τ2 ∆; Γ ⊢ λx. t1 = λx. t2 : τ1 → τ2 (ξλ) ∆, α; Γ ⊢ t1 = t2 : τ ∆; Γ ⊢ Λα. t1 = Λα. t2 : ∀α.τ (ξΛ)
∆; Γ ⊢ t1 = t2 : τ1 → τ2 ∆; Γ ⊢ s1 = s2 : τ1 ∆; Γ ⊢ t1 s1 = t2 s2 : τ2 (congλ) ∆; Γ ⊢ t1 = t2 : ∀α.τ2 ∆; Γ ⊢ t1 τ1 = t2 τ1 : τ2[α → τ1] (congΛ) ∆; Γ ⊢ t = t : τ (refl) ∆; Γ ⊢ s = t : τ ∆; Γ ⊢ t = s : τ (sym) ∆; Γ ⊢ t = s : τ Γ; ∆ ⊢ s = u : τ ∆; Γ ⊢ t = u : τ (trans)
– an object semantics [ [∆ ⊢ τ] ]o : Set|∆| → Set
– an object semantics [ [∆ ⊢ τ] ]o : Set|∆| → Set – a relational semantics [ [∆ ⊢ τ] ]r : Rel|∆| → Rel
– an object semantics [ [∆ ⊢ τ] ]o : Set|∆| → Set – a relational semantics [ [∆ ⊢ τ] ]r : Rel|∆| → Rel
– S : Set if S is a set – R : Rel if R is a relation – R : Rel(X, Y ) if R is a relation on sets X and Y (i.e., R ⊆ X × Y )
– an object semantics [ [∆ ⊢ τ] ]o : Set|∆| → Set – a relational semantics [ [∆ ⊢ τ] ]r : Rel|∆| → Rel
– S : Set if S is a set – R : Rel if R is a relation – R : Rel(X, Y ) if R is a relation on sets X and Y (i.e., R ⊆ X × Y )
– X be a |∆|-tuple of sets – R be a |∆|-tuple of relations – Ri : Rel(Xi, Yi) for i = 1, ..., |∆| – Eq X = {(x, x) | x ∈ X}
[∆ ⊢ αi] ]oX = Xi and [ [∆ ⊢ αi] ]rR = Ri
[∆ ⊢ αi] ]oX = Xi and [ [∆ ⊢ αi] ]rR = Ri
− [ [∆ ⊢ τ1 → τ2] ]oX = [ [∆ ⊢ τ1] ]oX → [ [∆ ⊢ τ2] ]oX
[∆ ⊢ αi] ]oX = Xi and [ [∆ ⊢ αi] ]rR = Ri
− [ [∆ ⊢ τ1 → τ2] ]oX = [ [∆ ⊢ τ1] ]oX → [ [∆ ⊢ τ2] ]oX − [ [∆ ⊢ τ1 → τ2] ]rR = {(f, g) | (a, b) ∈ [ [∆ ⊢ τ1] ]rR ⇒ (f a, g b) ∈ [ [∆ ⊢ τ2] ]rR}
[∆ ⊢ αi] ]oX = Xi and [ [∆ ⊢ αi] ]rR = Ri
− [ [∆ ⊢ τ1 → τ2] ]oX = [ [∆ ⊢ τ1] ]oX → [ [∆ ⊢ τ2] ]oX − [ [∆ ⊢ τ1 → τ2] ]rR = {(f, g) | (a, b) ∈ [ [∆ ⊢ τ1] ]rR ⇒ (f a, g b) ∈ [ [∆ ⊢ τ2] ]rR} Here, f ∈ [ [∆ ⊢ τ1 → τ2] ]oX and g ∈ [ [∆ ⊢ τ1 → τ2] ]oY
[∆ ⊢ αi] ]oX = Xi and [ [∆ ⊢ αi] ]rR = Ri
− [ [∆ ⊢ τ1 → τ2] ]oX = [ [∆ ⊢ τ1] ]oX → [ [∆ ⊢ τ2] ]oX − [ [∆ ⊢ τ1 → τ2] ]rR = {(f, g) | (a, b) ∈ [ [∆ ⊢ τ1] ]rR ⇒ (f a, g b) ∈ [ [∆ ⊢ τ2] ]rR} Here, f ∈ [ [∆ ⊢ τ1 → τ2] ]oX and g ∈ [ [∆ ⊢ τ1 → τ2] ]oY
− [ [∆ ⊢ ∀α.τ] ]oX = {f :
[ [∆, α ⊢ τ] ]o(X, S) | ∀R′ : Rel(X′, Y ′) .(fX′, fY ′) ∈ [ [∆, α ⊢ τ] ]r(Eq X, R′)}
[∆ ⊢ αi] ]oX = Xi and [ [∆ ⊢ αi] ]rR = Ri
− [ [∆ ⊢ τ1 → τ2] ]oX = [ [∆ ⊢ τ1] ]oX → [ [∆ ⊢ τ2] ]oX − [ [∆ ⊢ τ1 → τ2] ]rR = {(f, g) | (a, b) ∈ [ [∆ ⊢ τ1] ]rR ⇒ (f a, g b) ∈ [ [∆ ⊢ τ2] ]rR} Here, f ∈ [ [∆ ⊢ τ1 → τ2] ]oX and g ∈ [ [∆ ⊢ τ1 → τ2] ]oY
− [ [∆ ⊢ ∀α.τ] ]oX = {f :
[ [∆, α ⊢ τ] ]o(X, S) | ∀R′ : Rel(X′, Y ′) .(fX′, fY ′) ∈ [ [∆, α ⊢ τ] ]r(Eq X, R′)} − [ [∆ ⊢ ∀α.τ] ]rR = {(f, g) | ∀R′ : Rel(X′, Y ′) . (fX′, gY ′) ∈ [ [∆, α ⊢ τ] ]r(R, R′)}
[∆ ⊢ αi] ]oX = Xi and [ [∆ ⊢ αi] ]rR = Ri
− [ [∆ ⊢ τ1 → τ2] ]oX = [ [∆ ⊢ τ1] ]oX → [ [∆ ⊢ τ2] ]oX − [ [∆ ⊢ τ1 → τ2] ]rR = {(f, g) | (a, b) ∈ [ [∆ ⊢ τ1] ]rR ⇒ (f a, g b) ∈ [ [∆ ⊢ τ2] ]rR} Here, f ∈ [ [∆ ⊢ τ1 → τ2] ]oX and g ∈ [ [∆ ⊢ τ1 → τ2] ]oY
− [ [∆ ⊢ ∀α.τ] ]oX = {f :
[ [∆, α ⊢ τ] ]o(X, S) | ∀R′ : Rel(X′, Y ′) .(fX′, fY ′) ∈ [ [∆, α ⊢ τ] ]r(Eq X, R′)} − [ [∆ ⊢ ∀α.τ] ]rR = {(f, g) | ∀R′ : Rel(X′, Y ′) . (fX′, gY ′) ∈ [ [∆, α ⊢ τ] ]r(R, R′)} Here, f ∈ [ [∆ ⊢ ∀α.τ] ]oX and g ∈ [ [∆ ⊢ ∀α.τ] ]oY
[∆ ⊢ τ] ]rR : Rel([ [∆ ⊢ τ] ]oX, [ [∆ ⊢ τ] ]oY )
[∆ ⊢ τ] ]rR : Rel([ [∆ ⊢ τ] ]oX, [ [∆ ⊢ τ] ]oY )
[∆ ⊢ τ] ]rR : Rel([ [∆ ⊢ τ] ]oX, [ [∆ ⊢ τ] ]oY )
– The object and relational interpretations of type variables are inde- pendent of one another
[∆ ⊢ τ] ]rR : Rel([ [∆ ⊢ τ] ]oX, [ [∆ ⊢ τ] ]oY )
– The object and relational interpretations of type variables are inde- pendent of one another – The object interpretation of an arrow type does not depend on its relational interpretation, but the relational interpretation of an arrow type does depend on its object interpretation
[∆ ⊢ τ] ]rR : Rel([ [∆ ⊢ τ] ]oX, [ [∆ ⊢ τ] ]oY )
– The object and relational interpretations of type variables are inde- pendent of one another – The object interpretation of an arrow type does not depend on its relational interpretation, but the relational interpretation of an arrow type does depend on its object interpretation – The object and relational interpretations of forall types depend crucially on one another
[∆ ⊢ τ] ]rR : Rel([ [∆ ⊢ τ] ]oX, [ [∆ ⊢ τ] ]oY )
– The object and relational interpretations of type variables are inde- pendent of one another – The object interpretation of an arrow type does not depend on its relational interpretation, but the relational interpretation of an arrow type does depend on its object interpretation – The object and relational interpretations of forall types depend crucially on one another
nected semantics!
[ [∆ ⊢ τ] ]r (Eq X1, ..., Eq X|∆|) = Eq ([ [∆ ⊢ τ] ]o(X1, ..., X|∆|))
Γ = x1 : τ1, . . . , xm : τm are given by [ [∆ ⊢ Γ] ]o = [ [∆ ⊢ τ1] ]o × · · · × [ [∆ ⊢ τm] ]o and [ [∆ ⊢ Γ] ]r = [ [∆ ⊢ τ1] ]r × · · · × [ [∆ ⊢ τm] ]r
Γ = x1 : τ1, . . . , xm : τm are given by [ [∆ ⊢ Γ] ]o = [ [∆ ⊢ τ1] ]o × · · · × [ [∆ ⊢ τm] ]o and [ [∆ ⊢ Γ] ]r = [ [∆ ⊢ τ1] ]r × · · · × [ [∆ ⊢ τm] ]r
[ [∆; Γ ⊢ t : τ] ]oX : [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ] ]oX parameterized over a set environment X
Γ = x1 : τ1, . . . , xm : τm are given by [ [∆ ⊢ Γ] ]o = [ [∆ ⊢ τ1] ]o × · · · × [ [∆ ⊢ τm] ]o and [ [∆ ⊢ Γ] ]r = [ [∆ ⊢ τ1] ]r × · · · × [ [∆ ⊢ τm] ]r
[ [∆; Γ ⊢ t : τ] ]oX : [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ] ]oX parameterized over a set environment X
∆; Γ ⊢ xi : τi then [ [∆; Γ ⊢ xi : τi] ]o X A = Ai
∆; Γ ⊢ xi : τi then [ [∆; Γ ⊢ xi : τi] ]o X A = Ai
[ [∆; Γ ⊢ xi : τi] ]o X : [ [∆ ⊢ Γ] ]o X → [ [∆ ⊢ τi] ]o X
∆; Γ ⊢ xi : τi then [ [∆; Γ ⊢ xi : τi] ]o X A = Ai
[ [∆; Γ ⊢ xi : τi] ]o X : [ [∆ ⊢ Γ] ]o X → [ [∆ ⊢ τi] ]o X and because if A : [ [∆ ⊢ Γ] ]o X, then Ai : [ [∆ ⊢ τi] ]oX
∆; Γ, x : τ1 ⊢ t : τ2 ∆; Γ ⊢ λx.t : τ1 → τ2 then [ [∆; Γ ⊢ λx.t : τ1 → τ2] ]o X A A = [ [∆; Γ, x : τ1 ⊢ t : τ2] ]o X (A, A)
∆; Γ, x : τ1 ⊢ t : τ2 ∆; Γ ⊢ λx.t : τ1 → τ2 then [ [∆; Γ ⊢ λx.t : τ1 → τ2] ]o X A A = [ [∆; Γ, x : τ1 ⊢ t : τ2] ]o X (A, A)
[ [∆; Γ ⊢ λx.t : τ1 → τ2] ]o X : [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ1 → τ2] ]oX = [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ1] ]oX → [ [∆ ⊢ τ2] ]oX
∆; Γ, x : τ1 ⊢ t : τ2 ∆; Γ ⊢ λx.t : τ1 → τ2 then [ [∆; Γ ⊢ λx.t : τ1 → τ2] ]o X A A = [ [∆; Γ, x : τ1 ⊢ t : τ2] ]o X (A, A)
[ [∆; Γ ⊢ λx.t : τ1 → τ2] ]o X : [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ1 → τ2] ]oX = [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ1] ]oX → [ [∆ ⊢ τ2] ]oX and because the IH gives [ [∆; Γ, x : τ1 ⊢ t : τ2] ]oX : [ [∆ ⊢ Γ] ]oX × [ [∆ ⊢ τ1] ]oX → [ [∆ ⊢ τ2] ]oX
∆; Γ ⊢ t1 : τ1 ∆; Γ ⊢ t2 : τ1 → τ2 ∆; Γ ⊢ t2 t1 : τ2 then [ [∆; Γ ⊢ t2 t1 : τ2] ]o X A = [ [∆; Γ ⊢ t2 : τ1 → τ2] ]o X A ([ [∆; Γ ⊢ t1 : τ1] ]o X A)
∆; Γ ⊢ t1 : τ1 ∆; Γ ⊢ t2 : τ1 → τ2 ∆; Γ ⊢ t2 t1 : τ2 then [ [∆; Γ ⊢ t2 t1 : τ2] ]o X A = [ [∆; Γ ⊢ t2 : τ1 → τ2] ]o X A ([ [∆; Γ ⊢ t1 : τ1] ]o X A)
[ [∆; Γ ⊢ t2 t1 : τ2] ]o X : [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ2] ]oX
∆; Γ ⊢ t1 : τ1 ∆; Γ ⊢ t2 : τ1 → τ2 ∆; Γ ⊢ t2 t1 : τ2 then [ [∆; Γ ⊢ t2 t1 : τ2] ]o X A = [ [∆; Γ ⊢ t2 : τ1 → τ2] ]o X A ([ [∆; Γ ⊢ t1 : τ1] ]o X A)
[ [∆; Γ ⊢ t2 t1 : τ2] ]o X : [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ2] ]oX and because the IH gives [ [∆; Γ ⊢ t2 : τ1 → τ2] ]o X : [ [∆ ⊢ Γ] ]o X → [ [∆ ⊢ τ1 → τ2] ]o X = [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ1] ]o X → [ [∆ ⊢ τ2] ]o X
∆; Γ ⊢ t1 : τ1 ∆; Γ ⊢ t2 : τ1 → τ2 ∆; Γ ⊢ t2 t1 : τ2 then [ [∆; Γ ⊢ t2 t1 : τ2] ]o X A = [ [∆; Γ ⊢ t2 : τ1 → τ2] ]o X A ([ [∆; Γ ⊢ t1 : τ1] ]o X A)
[ [∆; Γ ⊢ t2 t1 : τ2] ]o X : [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ2] ]oX and because the IH gives [ [∆; Γ ⊢ t2 : τ1 → τ2] ]o X : [ [∆ ⊢ Γ] ]o X → [ [∆ ⊢ τ1 → τ2] ]o X = [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ1] ]o X → [ [∆ ⊢ τ2] ]o X and [ [∆; Γ ⊢ t1 : τ1] ]o X : [ [∆ ⊢ Γ] ]o X → [ [∆ ⊢ τ1] ]oX
... and tried to show that term interpretations are in the required sets
... and tried to show that term interpretations are in the required sets ... he ran into problems
∆, α; Γ ⊢ t : τ ∆; Γ ⊢ Λα.t : ∀α.τ then [ [∆; Γ ⊢ Λα.t : ∀α.τ] ]o X A = ΠS:Set[ [∆, α; Γ ⊢ t : τ] ]o (X, S) A
∆, α; Γ ⊢ t : τ ∆; Γ ⊢ Λα.t : ∀α.τ then [ [∆; Γ ⊢ Λα.t : ∀α.τ] ]o X A = ΠS:Set[ [∆, α; Γ ⊢ t : τ] ]o (X, S) A
[ [∆; Γ ⊢ Λα.t : ∀α.τ] ]o X : [ [∆ ⊢ Γ] ]o X → [ [∆ ⊢ ∀α.τ] ]o X = [ [∆ ⊢ Γ] ]o X → {f : ΠS:Set[ [∆, α ⊢ τ] ]o(X, S) | ...}
∆, α; Γ ⊢ t : τ ∆; Γ ⊢ Λα.t : ∀α.τ then [ [∆; Γ ⊢ Λα.t : ∀α.τ] ]o X A = ΠS:Set[ [∆, α; Γ ⊢ t : τ] ]o (X, S) A
[ [∆; Γ ⊢ Λα.t : ∀α.τ] ]o X : [ [∆ ⊢ Γ] ]o X → [ [∆ ⊢ ∀α.τ] ]o X = [ [∆ ⊢ Γ] ]o X → {f : ΠS:Set[ [∆, α ⊢ τ] ]o(X, S) | ...} and because α not free in Γ implies [ [∆, α; Γ ⊢ t : τ] ]o (X, S) : [ [∆, α ⊢ Γ] ]o (X, S) → [ [∆, α ⊢ τ] ]o (X, S) = [ [∆ ⊢ Γ] ]o X → [ [∆, α ⊢ τ] ]o (X, S)
∆, α; Γ ⊢ t : τ ∆; Γ ⊢ Λα.t : ∀α.τ then [ [∆; Γ ⊢ Λα.t : ∀α.τ] ]o X A = ΠS:Set[ [∆, α; Γ ⊢ t : τ] ]o (X, S) A
[ [∆; Γ ⊢ Λα.t : ∀α.τ] ]o X : [ [∆ ⊢ Γ] ]o X → [ [∆ ⊢ ∀α.τ] ]o X = [ [∆ ⊢ Γ] ]o X → {f : ΠS:Set[ [∆, α ⊢ τ] ]o(X, S) | ...} and because α not free in Γ implies [ [∆, α; Γ ⊢ t : τ] ]o (X, S) : [ [∆, α ⊢ Γ] ]o (X, S) → [ [∆, α ⊢ τ] ]o (X, S) = [ [∆ ⊢ Γ] ]o X → [ [∆, α ⊢ τ] ]o (X, S)
in the set interpretation of a ∀-type holds...
∆; Γ ⊢ t : ∀α.τ2 ∆ ⊢ τ1 ∆; Γ ⊢ t τ1 : τ2[α → τ1] then [ [∆; Γ ⊢ t τ1 : τ2[α → τ1]] ]o X A = [ [∆; Γ ⊢ t : ∀α.τ2] ]o X A ([ [∆ ⊢ τ1] ]o X)
∆; Γ ⊢ t : ∀α.τ2 ∆ ⊢ τ1 ∆; Γ ⊢ t τ1 : τ2[α → τ1] then [ [∆; Γ ⊢ t τ1 : τ2[α → τ1]] ]o X A = [ [∆; Γ ⊢ t : ∀α.τ2] ]o X A ([ [∆ ⊢ τ1] ]o X)
[ [∆; Γ ⊢ t τ1 : τ2[α → τ1]] ]oX : [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ2[α → τ1]] ]oX
∆; Γ ⊢ t : ∀α.τ2 ∆ ⊢ τ1 ∆; Γ ⊢ t τ1 : τ2[α → τ1] then [ [∆; Γ ⊢ t τ1 : τ2[α → τ1]] ]o X A = [ [∆; Γ ⊢ t : ∀α.τ2] ]o X A ([ [∆ ⊢ τ1] ]o X)
[ [∆; Γ ⊢ t τ1 : τ2[α → τ1]] ]oX : [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ2[α → τ1]] ]oX and because [ [∆; Γ ⊢ t : ∀α.τ2] ]o X : [ [∆ ⊢ Γ] ]o X → [ [∆ ⊢ ∀α.τ2] ]o X = [ [∆ ⊢ Γ] ]o X → {f : ΠS:Set[ [∆, α ⊢ τ2] ]o(X, S)|...}
∆; Γ ⊢ t : ∀α.τ2 ∆ ⊢ τ1 ∆; Γ ⊢ t τ1 : τ2[α → τ1] then [ [∆; Γ ⊢ t τ1 : τ2[α → τ1]] ]o X A = [ [∆; Γ ⊢ t : ∀α.τ2] ]o X A ([ [∆ ⊢ τ1] ]o X)
[ [∆; Γ ⊢ t τ1 : τ2[α → τ1]] ]oX : [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ2[α → τ1]] ]oX and because [ [∆; Γ ⊢ t : ∀α.τ2] ]o X : [ [∆ ⊢ Γ] ]o X → [ [∆ ⊢ ∀α.τ2] ]o X = [ [∆ ⊢ Γ] ]o X → {f : ΠS:Set[ [∆, α ⊢ τ2] ]o(X, S)|...}
[ [∆; Γ ⊢ t : ∀α.τ2] ]o X A ([ [∆ ⊢ τ1] ]o X) : [ [∆ ⊢ τ2[α → τ1]] ]o X
∆; Γ ⊢ t : ∀α.τ2 ∆ ⊢ τ1 ∆; Γ ⊢ t τ1 : τ2[α → τ1] then [ [∆; Γ ⊢ t τ1 : τ2[α → τ1]] ]o X A = [ [∆; Γ ⊢ t : ∀α.τ2] ]o X A ([ [∆ ⊢ τ1] ]o X)
[ [∆; Γ ⊢ t τ1 : τ2[α → τ1]] ]oX : [ [∆ ⊢ Γ] ]oX → [ [∆ ⊢ τ2[α → τ1]] ]oX and because [ [∆; Γ ⊢ t : ∀α.τ2] ]o X : [ [∆ ⊢ Γ] ]o X → [ [∆ ⊢ ∀α.τ2] ]o X = [ [∆ ⊢ Γ] ]o X → {f : ΠS:Set[ [∆, α ⊢ τ2] ]o (X, S)|...}
[ [∆; Γ ⊢ t : ∀α.τ2] ]o X A ([ [∆ ⊢ τ1] ]o X) : [ [∆ ⊢ τ2[α → τ1]] ]o X
the form ΠS∈SetS for the usual set-theoretic product
the form ΠS∈SetS for the usual set-theoretic product – α would have to range over all sets interpreting types... including the set interpreting ∀α.τ!
the form ΠS∈SetS for the usual set-theoretic product – α would have to range over all sets interpreting types... including the set interpreting ∀α.τ! – This is impossible!
the form ΠS∈SetS for the usual set-theoretic product – α would have to range over all sets interpreting types... including the set interpreting ∀α.τ! – This is impossible!
while still preserving the usual binary product and function space?
the form ΠS∈SetS for the usual set-theoretic product – α would have to range over all sets interpreting types... including the set interpreting ∀α.τ! – This is impossible!
while still preserving the usual binary product and function space?
Reynolds restricts it by imposing a so-called parametricity property
the form ΠS∈SetS for the usual set-theoretic product – α would have to range over all sets interpreting types... including the set interpreting ∀α.τ! – This is impossible!
while still preserving the usual binary product and function space?
Reynolds restricts it by imposing a so-called parametricity property
the form ΠS∈SetS for the usual set-theoretic product – α would have to range over all sets interpreting types... including the set interpreting ∀α.τ! – This is impossible!
while still preserving the usual binary product and function space?
Reynolds restricts it by imposing a so-called parametricity property
proves his Abstraction Theorem
System F in which – × is interpreted as the usual binary product – → is the interpreted as the usual function space – ∀α.τ is interpreted as a possibly restricted “large” product
System F in which – × is interpreted as the usual binary product – → is the interpreted as the usual function space – ∀α.τ is interpreted as a possibly restricted “large” product
restrict “large” products to exclude ad hoc functions!
System F in which – × is interpreted as the usual binary product – → is the interpreted as the usual function space – ∀α.τ is interpreted as a possibly restricted “large” product
restrict “large” products to exclude ad hoc functions!
System F in which – × is interpreted as the usual binary product – → is the interpreted as the usual function space – ∀α.τ is interpreted as a possibly restricted “large” product
restrict “large” products to exclude ad hoc functions!
constructive set theories
System F in which – × is interpreted as the usual binary product – → is the interpreted as the usual function space – ∀α.τ is interpreted as a possibly restricted “large” product
restrict “large” products to exclude ad hoc functions!
constructive set theories
System F in which – × is interpreted as the usual binary product – → is the interpreted as the usual function space – ∀α.τ is interpreted as a possibly restricted “large” product
restrict “large” products to exclude ad hoc functions!
constructive set theories
the relational interpretation of its type
the relational interpretation of its type
A ∈ [ [∆ ⊢ Γ] ]oX, and B ∈ [ [∆ ⊢ Γ] ]oY . For all ∆; Γ ⊢ t : τ, if (A, B) ∈ [ [∆ ⊢ Γ] ]rR then ([ [∆; Γ ⊢ t : τ] ]o X A, [ [∆; Γ ⊢ t : τ] ]o Y B) ∈ [ [∆ ⊢ τ] ]rR
the relational interpretation of its type
A ∈ [ [∆ ⊢ Γ] ]oX, and B ∈ [ [∆ ⊢ Γ] ]oY . For all ∆; Γ ⊢ t : τ, if (A, B) ∈ [ [∆ ⊢ Γ] ]rR then ([ [∆; Γ ⊢ t : τ] ]o X A, [ [∆; Γ ⊢ t : τ] ]o Y B) ∈ [ [∆ ⊢ τ] ]rR
the relational interpretation of its type
A ∈ [ [∆ ⊢ Γ] ]oX, and B ∈ [ [∆ ⊢ Γ] ]oY . For all ∆; Γ ⊢ t : τ, if (A, B) ∈ [ [∆ ⊢ Γ] ]rR then ([ [∆; Γ ⊢ t : τ] ]o X A, [ [∆; Γ ⊢ t : τ] ]o Y B) ∈ [ [∆ ⊢ τ] ]rR
Identity Extension Lemma hold is what Reynolds was aiming for
tions (bi)fibration on Set
tions (bi)fibration on Set
tem F for which we can prove (fibrational versions of) the IEL and Abstraction Theorem
tions (bi)fibration on Set
tem F for which we can prove (fibrational versions of) the IEL and Abstraction Theorem
formation Processing, 1983.
Types, 1984.