• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

J4 ›› 2010, Vol. 32 ›› Issue (3): 104-110.doi: 10.3969/j.issn.1007130X.2010.

• 论文 • 上一篇    下一篇

图文法EGG在设计模式中的应用

 韩秀清, 曾晓勤, 邹阳   

  1. (河海大学计算机及信息工程学院,江苏 南京 210098)
  • 收稿日期:2008-11-22 修回日期:2009-02-03 出版日期:2010-03-10 发布日期:2010-03-10
  • 通讯作者: 韩秀清, E-mail:xzeng@hhu.edu.cn
  • 作者简介:韩秀清(1981), 男,山东泰安人,硕士生,研究方向为图文法及其应用;曾晓勤,教授,博士生导师,研究方向为人工神经网络和图文法;邹阳,讲师,研究方向为图文法、非单调推理和逻辑程序。

Application of Graph Grammar EGG in Design Patterns

HAN Xiu-Qing, CENG Xiao-Qi, JU Yang   

  1. (School of Computer and Information Engineering,Hohai University,Nanjing 210098,China)
  • Received:2008-11-22 Revised:2009-02-03 Online:2010-03-10 Published:2010-03-10
  • Contact: HAN Xiu-Qing E-mail:xzeng@hhu.edu.cn

摘要: 对图变换和可视化语言的研究激发并促进了图文法的研究和发展。作为一维字符文法的扩展,图文法可以形式化描述二维空间中的对象,如图像、图形和表格等,为它们的定义、生成、变换及分析提供理论和技术上的支持。设计模式是可复用面向对象软件的基础,通常以二维图的形式来表示。为了与用户多样化的需求相适应,设计模式经常需要在不改变系统基本结构的情况下进行演化。本文讨论了图文法EGG及其形式化方法在设计模式的演化中的应用,聚焦在图变换和图解析两方面。前者用EGG格式的产生式作为图重写式来指导图的每一次变换,以确保相应设计模式演化每一步的正确性;后者用EGG文法机制来对图进行归约,以检查随意演化后的设计模式是否合法。

关键词: 可视化语言, 图文法, 图变换, 图重写, EGG, 设计模式

Abstract: Researches on graph transformation and visual language motivate and promote the research and development of graph grammars. As the extension of one dimensional string grammars, graph grammars can be used to formally describe objects in a two dimensional apace, such as images, graphs, and tables etc., and supply theoretical and technical supports for their definition, generation, transformation, and parsing. The design pattern, with an appearance of a two dimensional graph, is the basis of reusable objectoriented software. In order to suit to the various requirements of users, a design pattern usually needs to evolve under the condition of unchanging some basic structure criterions. It is discussed in this paper the application of graph grammar EGG and its formalism to the evolution of design patterns. The discussions are mainly focused on two aspects of graph transformation and graph parsing. The former is to make use of the EGG productions as graphrewriting rules to guide every graph transformation for guaranteeing the validity of corresponding the design pattern’s evolution in each step; and the latter is to make use of the grammar mechanism of the EGG to parse the given graphs for checking the validity of any freely evolved design patterns.

Key words: visual language;graph grammar;graph transformation;graph rewriting;EGG;design pattern

中图分类号: