首页> 外文会议>ACM SIGPLAN-SIGACT symposium on Principles of programming languages >Algorithmic aspects of type inference with subtypes
【24h】

Algorithmic aspects of type inference with subtypes

机译:带有子类型的类型推断的算法方面

获取原文

摘要

We study the complexity of type inference for programming languages with subtypes. There are three language variations that effect the problem: (i) basic functions may have polymorphic or more limited types, (ii) the subtype hierarchy may be fixed or vary as a result of subtype declarations within a program, and (iii) the subtype hierarchy may be an arbitrary partial order or may have a more restricted form, such as a tree or lattice. The naive algorithm for infering a most general polymorphic type, undervariable subtype hypotheses, requires deterministic exponential time. If we fix the subtype ordering, this upper bound grows to nondeterministic exponential time. We show that it is NP-hard to decide whether a lambda term has a type with respect to a fixed subtype hierarchy (involving only atomic type names). This lower bound applies to monomorphic or polymorphic languages. We give PSPACE upper bounds for deciding polymorphic typability if the subtype hierarchy has a lattice structure or the subtype hierarchy varies arbitrarily. We also give a polynomial time algorithm for the limited case where there are of no function constants and the type hierarchy is either variable or any fixed lattice.

机译:

我们研究带有子类型的编程语言的类型推断的复杂性。有三种语言变体会影响该问题:(i)基本函数可能具有多态或更多受限制的类型,(ii)子类型层次结构可能是固定的,或者由于程序中的子类型声明而有所不同,并且(iii)子类型层次结构可以是任意的部分顺序,也可以具有更严格的形式,例如树或格子。用于推断最通用的多态类型(即可变亚型假设)的朴素算法需要确定性的指数时间。如果我们固定子类型的排序,则该上限将增长到不确定的指数时间。我们证明,决定lambda术语是否具有相对于固定子类型层次结构(仅涉及原子类型名称)的类型是NP的。此下限适用于单态或多态语言。如果子类型层次结构具有格结构或子类型层次结构任意变化,则为确定多态可键入性提供PSPACE上限。对于没有函数常数且类型层次结构为可变或固定格的有限情况,我们还给出了多项式时间算法。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号