You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the dependent type:type calculus there is way to modify Girard's paradox to exhibit a diverging type (as opposed to a diverging term). There is some information on this in this 1989 paper by Reinhold: ftp://129.69.211.95/pdf/mit/lcs/tr/MIT-LCS-TR-458.pdf (EDIT: apparently GitHub markdown doesn't like ftp links). It would be interesting to know if this is possible to do in OCaml; for example, it isn't possible in System U.
Of course it is well known that the OCaml subtyping relation is undecidable in the presence of abstract module types, so for this to be interesting the example would need to avoid making use of that fact.
The text was updated successfully, but these errors were encountered:
It would be interesting to know if this is possible to do in OCaml; for example, it isn't possible in System U.
I do not believe it to be possible in current OCaml. The reason that the type does not diverge is that at various points the type is abstracted, which hides the underlying equalities and prevents the type-checker from doing further beta reduction. Many of the abstractions in this code were explicitly inserted for readability, but even if all of them were removed there are some places where OCaml currently forces abstraction on you. For example:
modulde F (X : S) =structmoduleY=Xend
is given type:
moduleF (X : S) : sigmoduleY : Send
which hides the equality between Y and X. If/when OCaml's module aliases are extended to work with functor arguments/results such that F had type
moduleF (X : S) : sigmoduleY=Xend
then I believe it would be possible to produce a diverging type.
Of course it is well known that the OCaml subtyping relation is undecidable in the presence of abstract module types, so for this to be interesting the example would need to avoid making use of that fact.
Whilst I have no strong evidence for this, I believe the two issues are related: I have never seen an example of the subtyping relation diverging that would not have been prevented by having a predicative universe of module types.
In the dependent type:type calculus there is way to modify Girard's paradox to exhibit a diverging type (as opposed to a diverging term). There is some information on this in this 1989 paper by Reinhold: ftp://129.69.211.95/pdf/mit/lcs/tr/MIT-LCS-TR-458.pdf (EDIT: apparently GitHub markdown doesn't like ftp links). It would be interesting to know if this is possible to do in OCaml; for example, it isn't possible in System U.
Of course it is well known that the OCaml subtyping relation is undecidable in the presence of abstract module types, so for this to be interesting the example would need to avoid making use of that fact.
The text was updated successfully, but these errors were encountered: