arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1704.09026cs.LOcs.PL
收藏

有效的路径多态类型检测

Efficient Type Checking for Path Polymorphism

Juan Edi, Andrés Viso, Eduardo Bonelli

摘要:

一个类型系统组合类型应用,常量类型,联合类型(关联,交换和幂等)和递归类型最近已被提出的静态类型路径多态性,能够定义函数,可以统一操作递归指定的应用数据结构。这样的函数所采用的典型模式是$x\,y$,它将一个复合物(换句话说,任何适用的树结构)分解成它的部分。我们分两个阶段来研究这个类型系统的类型检查。首先,我们提出了算法检查类型等价和子类型的基础上,这些关系的共归纳特征。然后,我们制定了一个语法导向的演示文稿,并证明其与原来的等价。这产生了一个类型检查算法,不幸的是,在最坏的情况下,它具有指数级的时间复杂度。第二个算法,然后提出,自动机技术的基础上,产生一个多项式时间的类型检查算法。

英文摘要:

A type system combining type application, constants as types, union types (associative, commutative and idempotent) and recursive types has recently been proposed for statically typing path polymorphism, the ability to define functions that can operate uniformly over recursively specified applicative data structures. A typical pattern such functions resort to is $x\,y$ which decomposes a compound, in other words any applicative tree structure, into its parts. We study type-checking for this type system in two stages. First we propose algorithms for checking type equivalence and subtyping based on coinductive characterizations of those relations. We then formulate a syntax-directed presentation and prove its equivalence with the original one. This yields a type-checking algorithm which unfortunately has exponential time complexity in the worst case. A second algorithm is then proposed, based on automata techniques, which yields a polynomial-time type-checking algorithm.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑