首页> 外文会议>International Symposium on Symbolic and Numeric Algorithms for Scientific Computing >An Extension of the Interpreter Pattern to Define Domain-Parametric Rewriting Systems
【24h】

An Extension of the Interpreter Pattern to Define Domain-Parametric Rewriting Systems

机译:解释器模式的扩展以定义域参数重写系统

获取原文

摘要

The Interpreter design pattern providesan elegant and natural way of implementing systemsbased on term-rewriting in a OO fashion. The ideais simply associating each term of a language, eitherterminal or non-terminal, with a correspondingclass provided with a suitable simplify() method.Reducing a term to a normal form is thus performedthrough a series of recursive calls to such a method.The main weakness of this approach is that it does nottake into account similarities existing among differentdomains, thus enforcing programmers to pollutegeneric and domain-specific rules. The resulting codeif often wordy, hard to maintain, non-reusable. In thispaper we adapt the Interpreter pattern so that a cleanseparation between generic (common to differentdomains) and domain-specific rules is possible. Thenew pattern significantly helps design even complexrewriting systems. A running example which refersto a generic Logical domain is used throughout thepaper. An application to High Level Petri nets analysisis sketched. Without any loss of generality we refer toJava as representative of a large class of languages.
机译:解释器设计模式提供了一种优雅且自然的方式来实现基于OO方式的基于术语重写的系统。这个想法只是简单地将语言的每个术语(无论是终端术语还是非终端术语)与对应的类提供了合适的simple()方法,因此可以通过一系列递归调用该方法来将术语简化为普通形式。这种方法的弱点在于,它没有考虑到不同域之间存在的相似性,从而迫使程序员污染通用的和特定于域的规则。所产生的代码通常罗word,难以维护,不可重用。在本文中,我们采用了Interpreter模式,从而可以在通用规则(特定于不同域)和特定于域的规则之间进行清晰的分隔。新模式极大地帮助设计了甚至复杂的重写系统。本文通篇使用了一个涉及通用逻辑域的运行示例。概述了在高级Petri网分析中的应用。不失一般性,我们将Java称为一大类语言的代表。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号