In System F, what is the difference between the following 3 types:
Reproduced in text here:
∀X.((X → X) → (X → X)) ∀X.((X → X) → ∀X.(X → X)) ((∀X.X → X) → (∀X.X → X))
Is the second one more general than the first?
Depends on how tight forall quantifier binds. Lets assume that it binds on next terminal expression (variable or ()-block).
forall
()
The first will become (X0 -> X0) -> (X0 -> X0) where X0 is a fresh type variable.
(X0 -> X0) -> (X0 -> X0)
X0
The second will become (X0 -> X0) -> forall X1. (X1 -> X1) where X0 and X1 are fresh.
(X0 -> X0) -> forall X1. (X1 -> X1)
X1
The third - (bot -> X) -> (bot -> X) where X is the old binding and bot is the uninhabited forall X. X.
(bot -> X) -> (bot -> X)
X
forall X. X
Depends on how tight
forallquantifier binds. Lets assume that it binds on next terminal expression (variable or()-block).The first will become
(X0 -> X0) -> (X0 -> X0)whereX0is a fresh type variable.The second will become
(X0 -> X0) -> forall X1. (X1 -> X1)whereX0andX1are fresh.The third -
(bot -> X) -> (bot -> X)whereXis the old binding and bot is the uninhabitedforall X. X.