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上限。对于没有函数常数且类型层次结构为可变或固定格的有限情况,我们还给出了多项式时间算法。 P>
机译:由B型亚型病毒构建的基因型算法可预测HIV 1型C型亚型的嗜性。
机译:用于多模式生物特征的模块化神经网络中作为集成方法的Type-1和Type-2模糊推理系统及其遗传算法的优化
机译:Pysustain:子类型和阶段推理算法的Python实现
机译:存在重载,子类型和递归类型时的类型推断
机译:从基因组变异数据推断人口统计学的统计,算法和稳健性方面。
机译:评估HIV 1型亚型C型发病率的多重分析算法的近期错误分类率评估
机译:带有子类型的类型推断的算法方面