隐式极化F:不可预测性的局部类型推断
Implicit Polarized F: local type inference for impredicativity
摘要:
系统F,多态λ演算,具有不可预测性原则:多态类型可以(显式)在其他类型上实例化,从而实现许多强大的习惯用法,如Church编码和数据抽象。不幸的是,类型应用程序需要是隐式的,这样语言才能被人类使用,并且在系统F中推断所有类型应用程序的问题是不可判定的。因此,语言设计者在历史上避免了非断言的类型推断。令人惊讶的是,这种新的视角产生了一种新的类型推断算法,它是非常简单的实现(甚至不需要统一),推断出许多类型,并有一个简单的声明性规范。此外,我们的方法提供了类型理论的解释,有多少在现有的算法中使用的非谓词多态性出现。
英文摘要:
System F, the polymorphic lambda calculus, features the principle of impredicativity: polymorphic types may be (explicitly) instantiated at other types, enabling many powerful idioms such as Church encoding and data abstraction. Unfortunately, type applications need to be implicit for a language to be human-usable, and the problem of inferring all type applications in System F is undecidable. As a result, language designers have historically avoided impredicative type inference. We reformulate System F in terms of call-by-push-value, and study type inference for it. Surprisingly, this new perspective yields a novel type inference algorithm which is extremely simple to implement (not even requiring unification), infers many types, and has a simple declarative specification. Furthermore, our approach offers type theoretic explanations of how many of the heuristics used in existing algorithms for impredicative polymorphism arise.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。