Affiliation:
1. The University of Hong Kong, China
2. The University of Hong Kong, Hong Kong, China
3. KU Leuven, Leuven, Belgium
Abstract
Consistent subtyping is employed in some gradual type systems to validate type conversions. The original definition by Siek and Taha serves as a guideline for designing gradual type systems with subtyping. Polymorphic types à la System F also induce a subtyping relation that relates polymorphic types to their instantiations. However, Siek and Taha’s definition is not adequate for polymorphic subtyping. The first goal of this article is to propose a generalization of consistent subtyping that is adequate for polymorphic subtyping and subsumes the original definition by Siek and Taha. The new definition of consistent subtyping provides novel insights with respect to previous polymorphic gradual type systems, which did not employ consistent subtyping. The second goal of this article is to present a gradually typed calculus for implicit (higher-rank) polymorphism that uses our new notion of consistent subtyping. We develop both declarative and (bidirectional) algorithmic versions for the type system. The algorithmic version employs techniques developed by Dunfield and Krishnaswami for higher-rank polymorphism to deal with instantiation. We prove that the new calculus satisfies all static aspects of the refined criteria for gradual typing. We also study an extension of the type system with static and gradual type parameters, in an attempt to support a variant of the dynamic criterion for gradual typing. Assuming a coherence conjecture for the extended calculus, we show that the dynamic gradual guarantee of our source language can be reduced to that of λ B, which, at the time of writing, is still an open question. Most of the metatheory of this article, except some manual proofs for the algorithmic type system and extensions, has been mechanically formalized using the Coq proof assistant.
Funder
Research Foundation - Flanders
Hong Kong Research Grant Council
Publisher
Association for Computing Machinery (ACM)
Cited by
5 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. Static Blame for gradual typing;Journal of Functional Programming;2024
2. Greedy Implicit Bounded Quantification;Proceedings of the ACM on Programming Languages;2023-10-16
3. Pragmatic Gradual Polymorphism with References;Programming Languages and Systems;2023
4. Putting Gradual Types to Work;Practical Aspects of Declarative Languages;2021
5. A Declarative Gradualizer with Language Transformations;IFL 2020: Proceedings of the 32nd Symposium on Implementation and Application of Functional Languages;2020-09-02