...
首页> 外文期刊>Journal of Visual Languages & Computing >On declarative rewriting for sound and complete union, intersection and negation types
【24h】

On declarative rewriting for sound and complete union, intersection and negation types

机译:关于声音和完整的并集,交集和求反类型的声明式重写

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

摘要

Implementing the type system of a programming language is a critical task that is often done in an ad-hoc fashion. Whilst this makes it hard to ensure the system is sound, it also makes it difficult to extend as the language evolves. We are interested in describing type systems using rewrite rules from which an implementation can be automatically generated. Whilst not all type systems are easily expressed in this manner, those involving unions, intersections and negations are well-suited for this. For example, subtyping in such systems is naturally expressed as a maximal reduction over the intersection of types involved.In this paper, we consider a relatively complex type system involving unions, intersections and negations developed previously in the context of type checking. This system was not developed with rewriting in mind, though clear parallels are immediately apparent from the original presentation. For example, the system presented required types be first converted into a variation on Disjunctive Normal Form. However, some aspects of the original system are more challenging to express with rewrite rules. We identify that the original system can, for the most part, be reworked to enable a natural expression using rewrite rules. We present an implementation of our rewrite rules in the Whiley Rewrite Language (WyRL), and report performance results compared with a hand-coded solution. We also present an implementation of our system in the Rascal rewriting system, and find different trade offs.
机译:实现编程语言的类型系统是一项关键任务,通常以临时方式完成。尽管这很难确保系统正常运行,但也随着语言的发展而难以扩展。我们对使用重写规则描述类型系统感兴趣,可以根据这些规则自动生成实现。尽管并非所有类型系统都容易以这种方式表示,但是涉及并集,相交和求反的系统非常适合于此。例如,此类系统中的子类型自然表示为所涉及类型的交集的最大减少。在本文中,我们考虑了一个相对复杂的类型系统,该类型系统涉及先前在类型检查的背景下开发的并集,交集和取反。尽管从原始演示文稿中就可以明显看出相似之处,但该系统的开发并没有考虑到重写的问题。例如,提出的系统要求的类型首先要转换为析取范式的变体。但是,使用重写规则来表达原始系统的某些方面更具挑战性。我们确定原始系统可以在很大程度上进行重写,以使用重写规则实现自然表达。我们用Whiley重写语言(WyRL)展示了重写规则的实现,并报告了与手动编码解决方案相比的性能结果。我们还介绍了Rascal重写系统中系统的实现,并找到了不同的权衡。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号