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