Greedy Implicit Bounded Quantification

Chen Cui, Shengyi Jiang,Bruno C. D. S. Oliveira

Proceedings of the ACM on Programming Languages(2023)

引用 1|浏览2
暂无评分
摘要
Mainstream object-oriented programming languages such as Java, Scala, C#, or TypeScript have polymorphic type systems with subtyping and bounded quantification. Bounded quantification, despite being a pervasive and widely used feature, has attracted little research work on type-inference algorithms to support it. A notable exception is local type inference, which is the basis of most current implementations of type inference for mainstream languages. However, support for bounded quantification in local type inference has important restrictions, and its non-algorithmic specification is complex. In this paper, we present a variant of kernel F-<=, which is the canonical calculus with bounded quantification, with implicit polymorphism. Our variant, called F-<=(b), comes with a declarative and an algorithmic formulation of the type system. The declarative type system is based on previous work on bidirectional typing for predicative higher-rank polymorphism and a greedy approach to implicit instantiation. This allows for a clear declarative specification where programs require few type annotations and enables implicit polymorphism where applications omit type parameters. Just as local type inference, explicit type applications are also available in F-<=(b) if desired. This is useful to deal with impredicative instantiations, which would not be allowed otherwise in F-<=(b). Due to the support for impredicative instantiations, we can obtain a completeness result with respect to kernel F-<=, showing that all the well-typed kernel F-<= programs can type-check in F-<=(b). The corresponding algorithmic version of the type system is shown to be sound, complete, and decidable. All the results have been mechanically formalized in the Abella theorem prover.
更多
查看译文
关键词
quantification
AI 理解论文
溯源树
样例
生成溯源树,研究论文发展脉络
Chat Paper
正在生成论文摘要