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

基于可判定标记的名词类型、元组和联合的语义子类型

Decidable Tag-Based Semantic Subtyping for Nominal Types, Tuples, and Unions

Julia Belyakova

摘要:

语义子类型化通过将类型解释为其值的集合来实现关于类型的简单的集合理论推理。以前,语义子类型主要是在静态类型语言和结构类型的上下文中研究的。在本文中,我们探讨了语义子类型在动态语言与名词类型的上下文中的适用性。动态语言依赖于与值相关联的类型标记的运行时检查,而不是静态类型检查,因此我们建议使用标记进行语义子类型化。我们的工作基础上的Julia语言的片段,并提出基于标签的语义子类型的名义类型,元组和工会,类型被解释为集理论上,作为一组类型标签。所提出的子类型关系被证明是可判定的,并提供了相应的解析定义。使用语义子类型的多重分派的影响进行了讨论。

英文摘要:

Semantic subtyping enables simple, set-theoretical reasoning about types by interpreting a type as the set of its values. Previously, semantic subtyping has been studied primarily in the context of statically typed languages with structural typing. In this paper, we explore the applicability of semantic subtyping in the context of a dynamic language with nominal types. Instead of static type checking, dynamic languages rely on run-time checking of type tags associated with values, so we propose using the tags for semantic subtyping. We base our work on a fragment of the Julia language and present tag-based semantic subtyping for nominal types, tuples, and unions, where types are interpreted set-theoretically, as sets of type tags. The proposed subtyping relation is shown to be decidable, and a corresponding analytic definition is provided. The implications of using semantic subtyping for multiple dispatch are also discussed.

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

↑