...
【24h】

Recursive type generativity

机译:递归类型生成

获取原文
获取原文并翻译 | 示例
   

获取外文期刊封面封底 >>

       

摘要

Existential types provide a simple and elegant foundation for understanding generative abstract data types, of the kind supported by the Standard ML module system. However, in attempting to extend ML with support for recursive modules, we have found that the traditional existential account of type generativity does not work well in the presence of mutually recursive module definitions. The key problem is that, in recursive modules, one may wish to define an abstract type in a context where a name for the type already exists, but the existential type mechanism does not allow one to do so.We propose a novel account of recursive type generativity that resolves this problem. The basic idea is to separate the act of generating a name for an abstract type from the act of defining its underlying representation. To define several abstract types recursively, one may first "forward-declare" them by generating their names, and then define each one secretly within its own defining expression. Intuitively, this can be viewed as a kind of backpatching semantics for recursion at the level of types. Care must be taken to ensure that a type name is not defined more than once, and that cycles do not arise among "transparent" type definitions.In contrast to the usual continuation-passing interpretation of existential types in terms of universal types, our account of type generativity suggests a destination -passing interpretation. Briefly, instead of viewing a value of existential type as something that creates a new abstract type every time it is unpacked, we view it as a function that takes as input a pre-existing undefined abstract type and defines it. By leaving the creation of the abstract type name up to the client of the existential, our approach makes it significantly easier to link abstract data types together recursively.
机译:存在类型为理解生成抽象数据类型提供了简单而优雅的基础,而标准ML模块系统支持这种类型。但是,在尝试使用对递归模块的支持来扩展ML时,我们发现,在存在相互递归模块定义的情况下,类型生成的传统存在帐户无法很好地工作。关键问题在于,在递归模块中,可能希望在已经存在类型名称的上下文中定义抽象类型,但是存在类型机制不允许这样做。我们提出了一种新颖的递归方法解决该问题的类型生成。基本思想是将为抽象类型生成名称的行为与定义其基本表示形式的行为分开。要递归定义几种抽象类型,可以先通过生成它们的名称来“前向声明”它们,然后在其自己的定义表达式中秘密地定义它们。直观上,这可以看作是一种在类型级别进行递归的后修补语义。必须注意确保对类型名称的定义不会被多次定义,并且在“透明”类型定义之间不会出现循环。与在通用类型方面通常对存在类型进行连续传递的解释相反,我们的解释是类型生成论的提出暗示了目的地传递的解释。简而言之,与其将存在类型的值视为每次拆包都会创建一个新抽象类型的东西,不如将它视为一个将预先存在的未定义抽象类型作为输入并对其进行定义的函数。通过将抽象类型名称的创建留给存在对象来解决,我们的方法使递归地将抽象数据类型链接在一起变得非常容易。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号