透過您的圖書館登入
IP:3.145.94.251
  • 學位論文

GraphRE: 圖形轉換系統基於正則表達式之搜尋與替換

GraphRE: A Rule-Based Search-and-Replace Graph Transformation System using Regular-Expression-like Patterns

指導教授 : 周百祥

摘要


本論文提出以匹配兼取代方式編輯圖形的一套系統。正如正則表式(regular expressions)廣泛被使用於文字資料的編輯,本論文採取此類搜尋兼替代編輯方式的優點。匹配型樣和取代規則皆可精簡、精準額外描述,即使新增客製功能,也不會影響到改寫器的核心功能,不會需要撰寫新的程式碼,只需要改型樣即可。如此政策與機制的分離可使軟體更容易維護與演進。但是,目前鮮少有此類「圖形文法」的編輯系統,難點在於圖形不是線性結構,不容易以公式表達,而且又分有向與無向,階層或扁平、含權重或其他屬性、有埠或無埠、一體或成叢林、還有許多其他特性,導致一套通用的圖形改寫系統變得很有挑戰性。為了解決這個問題,我們提出一套圖形正則表式(GraphRE)的系統,其RE部份指的是以文字版為比喻的可擴充式、以規則為基準的編輯器。GraphRE遵照我們以自定圖形型樣描述語言所訂規則,將一個圖形轉換成另一個圖形。GraphRE把規則編譯成一個可將讀取的圖形轉換為比子圖同構更通用的演算法。我們認為,這種匹配取代的優勢在於模組化會高於完全依賴命令式語言表達圖形重寫的傳統圖形文法系統。實驗結果顯示,GraphRE的確能夠實作出一個圖形編輯程式的編輯動作。本技術將會朝向可對不同種類示意圖定義以可程式化載入的圖形編輯器邁向一大步,避免把圖形邏輯以手刻程式碼作為唯一的實作方式。

關鍵字

圖形重構 正規表達式 匹配 替換

並列摘要


This thesis describes a graph-transformation system based on the idea of pattern matching and re-placement. Analogous to regular expressions for text editing, this search-and-replace style of graphtransformation has several key advantages. The patterns to match and the replacement rules can bespecified concisely, precisely, and custom-defined by the user or tool without modification to the coreengine or writing imperative program code. This separation of policy and mechanism can also makesoftware more maintainable and evolvable. However, few such “graph grammar”-based transforma-tion systems exist, due to the nonlinear nature of graph data structures, and their diversity such asdirected vs. undirected, hierarchical vs. flat, weighted or attributed, ported vs. non-ported, connectedvs. forest, and many variants make it very challenging to develop a general-purpose graph transfor-mation system.To address these challenges, we propose GraphRE, a extensible graph-rewriting system for rule-based graph editing, analogous to regular expressions for text. GraphRE transforms a graph intoanother according to rules described in our graph-pattern description language. GraphRE generatesa custom parser for the set of rules and can match subgraphs in ways more general than subgraphisomorphism. The use of substitution pattern also makes it more modular than conventional graphgrammar systems that rely entirely on executable code to actually perform the graph rewriting. Ex-perimental results show our GraphRE to be able to implement editing actions for a diagram editor.This technology represents the first step towards enabling programmable diagram editors that can bespecialized to editing different types of diagrams based on loadable rules instead of crafting customcode.

參考文獻


[1] C. Ermel, M. Rudolf, and G. Taentzer, “The AGG approach: Language and environment,” in Handbook Of Graph Grammars And Computing By Graph Transformation: Volume 2: Applica- tions, Languages and Tools, pp. 551–603, World Scientific, 1999.
[2] A. H. Ghamarian, M. de Mol, A. Rensink, E. Zambon, and M. Zimakova, “Modelling and analysis using groove,” International journal on software tools for technology transfer, vol. 14, no. 1, pp. 15–40, 2012.
[3] D.-Q. Zhang and K. Zhang, “Reserved graph grammar: A specification tool for diagrammatic VPLs,” in Proceedings. 1997 IEEE Symposium on Visual Languages (Cat. No. 97TB100180), pp. 284–291, IEEE, 1997.
[4] J. R. Ullmann, “An algorithm for subgraph isomorphism,” Journal of the ACM (JACM), vol. 23, no. 1, pp. 31–42, 1976.
[5] W.-S. Han, J. Lee, and J.-H. Lee, “TurboISO: towards ultrafast and robust subgraph isomorphism search in large graph databases,” in Proceedings of the 2013 ACM SIGMOD International Con- ference on Management of Data, pp. 337–348, 2013.

延伸閱讀