轻量级泛型Java的全局类型推断
Global Type Inference for Featherweight Generic Java
摘要:
Java的类型系统主要依赖于通过局部类型推断增强的类型检查,以提高程序员的便利性。本文研究了Featherweight Generic Java(FGJ)的全局类型推断。给定通用类头和字段规范,如果类不使用多态递归,则我们的推理算法推断所有方法类型。该算法是基于约束的,并在几个方面改进了以前的工作。尽管设置受限,但FGJ的全局类型推断是NP完全的。
英文摘要:
Java's type system mostly relies on type checking augmented with local type inference to improve programmer convenience. We study global type inference for Featherweight Generic Java (FGJ), a functional Java core language. Given generic class headers and field specifications, our inference algorithm infers all method types if classes do not make use of polymorphic recursion. The algorithm is constraint-based and improves on prior work in several respects. Despite the restricted setting, global type inference for FGJ is NP-complete.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。