[3]\fnmLisa \surMathew
1]\orgdivDepartment of Computer Science and Engineering, \orgnameAmal Jyothi College of Engineering, \orgaddress\streetKanjirappally, \cityKottayam, \postcode686 518, \stateKerala, \countryIndia
2]\orgdivResearch scholar, \orgnameAPJ Abdul Kalam Technological University, \orgaddress\streetCET Campus, \cityThiruvananthapuram, \postcode695 016, \stateKerala, \countryIndia
3]\orgdivDepartment of Basic Sciences , \orgnameAmal Jyothi College of Engineering, \orgaddress\streetKanjirappally, \cityKottayam, \postcode686 518, \stateKerala, \countryIndia
On Some Closure Properties of nc-eNCE Graph Grammars
Abstract
In the study of automata and grammars, closure properties of the associated languages have been studied extensively. In particular, closure properties of various types of graph grammars have been examined in (Rozenberg and Welzl, Inf. and Control,1986) and (Rozenberg and Welzl, Acta Informatica,1986). In this paper we examine some critical closure properties of the nc-eNCE graph grammars discussed in (Jayakrishna and Mathew, Symmetry 2023) and (Jayakrishna and Mathew, ICMICDS 2022).
keywords:
Graph Grammars, Confluence, Connection Instructions, Regular Control, Jumping Graph Grammars, Closure Properties, Disjoint Sum, Kleene Sum, Union, Star Concatenation, Chain Concatenation1 Introduction
Graph grammars have been a challenging area of research in theoretical computer science since their introduction in the sixties [1, 2, 3, 4, 5, 6, 7]. They provide a framework for specifying the structure and transformation of graphs and hence are capable of generating a wide range of graphs using a small set of rules. Thus the creation of complex structures that would be difficult to specify using other methods becomes possible. They are often used in computer science to specify the structural and behavioral aspects of software systems. For instance, they can be used to specify the structure of a database schema [1], a programming language or a software architecture. They also find application in other fields, such as biology, to model the structure and behavior of biological systems. Moreover, they can be used to specify the behavior of a system over time, thus facilitating the modeling of dynamic systems.
Graph grammars consist primarily of a set of rules which specify how to iteratively transform a graph by adding, deleting, or modifying its nodes and edges- [7, 8]. A typical graph grammar consists of a start graph and a set of transformation rules (productions). These rules help to convert the host graph (initially the host graph is ) to the desired transformed graph. The rules have an crucial role in the transformation and are of the form , where is the mother graph to be replaced (present in ), (daughter graph) is the graph which replaces , and is the embedding mechanism which describes how the daughter graph is connected to the the remaining portion of the host graph .
On the other hand, a class of graph languages can have two types of operations defined on it- set operations and operations on graphs belonging to the language. Set operations include union, intersection and complementation while operations on graphs include disjoint sum (graph theoretical union), graph complementation and others including some new operations which we define here. Closure properties of some special types types of graph grammars have been examined in [9, 10] Here, we examine some salient closure properties of the nc-eNCE graph grammars discussed in [11]and [12].
In Section 2 we recall some preliminary notions about nc-eNCE. Section 3 of this paper introduces a variety of operations on Graph Languages and a few other related concepts. In Section 4 we prove that these languages are closed under the operations of union, disjoint sum and Kleene sum. Closure properties under two more operations - Chain concatenation and star concatenation are also discussed. Since the proofs of the closure properties with respect to these two operations employ jumping connection instructions the class of jumping nc-eNCE graph grammars are closed under these operations. We conclude our discussion in Section 5
2 Preliminaries
Gluing and connecting are the two popular mechanisms used to embed the daughter graph in the mother graph.In the gluing approach [1, 2, 3, 5], certain nodes and edges of and of are identified for fusion. The edges thus identified are those which were originally incident to in . There are different ways of identifying the corresponding nodes in the host and daughter graphs. One way is to use labels or attributes attached to the nodes/edges. Another way is to use a mapping function that associates each node/edge in the daughter graph with a node in the host graph.
Hierarchical gluing is a technique that allows us to glue multiple graphs in a hierarchical manner. In this approach, we first glue two or more graphs to form a larger graph and then repeat the process with the remaining graphs until the desired graph is obtained. The gluing approach is commonly used in graph compression and graph visualization, where it can simplify the display of complex graphs by representing subgraphs with a single node.
The connecting approach is another way of embedding daughter graphs in the host graph. In this approach, the daughter graph is connected to the host graph by adding edges between designated nodes in the two graphs. The edges represent the relationships between the nodes in the daughter graph and the nodes in the host graph.
The connecting approach is suitable when the embedded graph is small compared to the host graph. In this case, it may not be necessary to replace nodes in the host graph with the daughter graph. Instead, the relationships between the nodes in the daughter graph and the nodes in the host graph can be represented using edges. This is known as edge replacement. The connecting approach is usually used in graph query processing, where it is used to match smaller graphs against a larger graph. It may also be used in graph editing tools, where it can be used to insert and delete subgraphs within a larger graph.
The gluing approach is advantageous when the embedded graph needs to be modified frequently or when the embedded graph is large compared to the host graph. The gluing approach is generally more expensive than the connecting approach in terms of computational complexity, since it requires the replacement of nodes in the host graph with the daughter graph. The connecting approach, on the other hand, only requires the addition of edges between the daughter graph and the host graph.
2.1 Graph Grammars with Regular Control
Graph grammars with regular control are a variant of graph grammars that use regular expressions to specify the control flow of the transformation rules. Regular expressions are used to specify the conditions under which a production rule can be applied. The evolution of graphs are determined by the regular expression which controls the order of application of rules. Such graph grammars are known as non-confluent graph grammars. One such variant of this type specified in [11] is Non-confluent Edge and Node Controlled Embedding Graph Grammar.
Non-confluent Edge and Node Controlled Embedding Graph Grammar [11]: Restricting the sequence of production rules utilized results in this type of graph grammar that introduces a small amount of determinism to the essentially non-deterministic concept of a graph grammar.
Definition 1.
[13, 11] A construct ( ) is known as an graph grammar where
-
and are sets of symbols used to label nodes and edges respectively,
-
and are the collections of terminal symbols in and respectively,
-
A production rule in , acting on the mother node with label has a collection C of connection instructions associated with it. Here with label is a neighbor of and is a node in . The edge which connected and is removed and a new edge is established between and .
-
is the initial graph,
-
The regular control, , regulates the sequence of application of the production rules.
Several variants of graph grammars such as nc- graph grammar with deletion , nc- graph grammar with labelled edges , etc have been discussed in [11].
2.2 Jumping Graph Grammar
A jumping graph grammar () differs from its conventional counterpart(jumping gramars) [14, 15] in the fact that in addition to the normal connections established as part of daughter graph embedding with vertices which were adjacent to the vertices of the mother graph, we can also create extra edges known as jumping edges to establish connections from vertices of daughter graph to other vertices in the rest of the host graph. The formal definition of jumping graph grammars is as follows.
Definition 2.
[12] A Jumping Graph Grammar is a construct (), where
-
is the finite set of node labels
-
is the finite set of graph production rules
-
is the connection instruction
-
is the start/initial graph
Here is of the form where is the mother graph to be replaced by daughter graph .
In general graph grammars, the connection instruction establishes edges from the designated nodes of to the nodes of which were having incident edges to the mother graph that were removed during replacement. But in jumping graph grammars, the connection instruction has an extended capability to establish edges from designated nodes of to any of the nodes present in .
The language represented by the jumping graph grammar is
() where, is the set of graphs obtained from by recursively applying rules in .
2.3 Non-confluent Edge and Node Controlled Embedding Jumping Graph grammars (nc-eNCE-JGG)
We extend the definition of graph grammar in [13] for defining this new grammar. Formally, we have:
Definition 3.
An graph grammar is a 7 tuple: ) where
-
is the set of node labels,
-
is the set of terminal node labels,
-
is the set of edge labels,
-
is the set of terminal edge labels,
-
The productions in are of one of the forms ) where is the label of the mother node and is the daughter graph. The connection instruction can be in any one of the following forms
-
1.
(), where and are edge labels, is the node label of one of the neighbours of the mother node and is a node in . The interpretation is that we find an edge labelled in the host graph which had connected a node labelled to the mother node and create a new edge labelled between and the node in the daughter graph
-
2.
(), where is the node label of one of the nodes in , is the label of any of the nodes in remaining graph after removing the mother node and is the label of the new edge connecting and .
-
1.
-
is the start/initial graph,
-
) is a regular control which specifies the order of application of the productions, Hence this grammar becomes restricted or non-confluent.
The language represented by this grammar is where is the set of graphs containing only terminal nodes. Hence the language of an graph grammar is a set of graphs whose nodes have terminal labels, generated by applying a series of productions in the order where is a word in the language represented by the regular control ).
3 Operations on Graph Languages
Definition 4.
The union of two graph languages and is the graph language obtained by taking the usual union of the two families of graphs i.e.
Definition 5.
The disjoint sum of two graph languages and is the graph language obtained by taking the disjoint sum of sample graphs from two languages i.e. .
Definition 6.
The Kleene sum of a graph language is the graph language obtained by taking the disjoint sum of a countable number of sample graphs from i.e.
Definition 7.
Let be a graph language generated by a graph grammar , the set of graphs obtained by ignoring the labels of graphs in forms the underlying graph language .
Definition 8.
The chain concatenation of two graph languages and which do not contain null graphs is the graph language obtained by joining the two designated nodes chosen from sample graphs and in and respectively and is denoted by
Definition 9.
The star concatenation of a graph language is the graph language obtained by connecting designated nodes in a countable number of sample graphs from to a central node. This is denoted by .
4 Closure Properties of Graph Languages Generated Using nc-eNCE Graph Grammar
The class of graph languages generated using Graph Grammar is closed under union, disjoint sum, Kleene sum and chain concatenation.
THeorem 1.
The class of string languages generated using nc-eNCE graph grammars is closed under the operation union.
Proof.
Consider two graph grammars and generating graph languages and respectively. Assuming that is a new symbol that does not appear in , we define a new graph grammar capable of generating the language as follows.
,
-
-
-
-
-
-
R(P)=
Here and are the start graphs of and respectively. Clearly any graph in can be generated using while any graph in can be generated using . ∎
THeorem 2.
The class of graph languages generated using graph grammars is closed under the graph operation disjoint sum.
Proof.
Consider two graph grammars and generating graph languages and respectively. Without loss of generality we can assume that and have no elements in common.We define a new graph grammar capable of generating the language as follows.
,
The start graphs and of and are initially generated using . This is followed by generating and generating . Hence it is clear that generates . ∎
THeorem 3.
The class of unlabelled graph languages generated using graph grammars is closed under the graph operation Kleene sum.
Proof.
Consider an graph grammar generating the graph language . We define a new graph grammar capable of generating the language as follows.
,
Initially the production replaces the start node of with a copy of the start graph of and the node itself. Now replaces by a graph . The rules and are recursively applied to further generate new components of the resultant graph. Finally the derivation terminates when is applied. Hence it is clear that generates . ∎
THeorem 4.
The class of underlying graph languages formed from graph classes generated using jumping graph grammars is closed under the graph operation chain concatenation.
Proof.
Consider two graph grammars and generating graph languages and respectively. Without loss of generality we can assume that and have no elements in common. We begin our construction of the required grammar by carrying out the following steps.
-
1.
Replace each in the regular expressions by the equivalent expression and simplifying so that is now of the form . This ensures that each does not contain a the operator ’’.
-
2.
Initialize . For each , do the following
-
(a)
Since every graph generated by is non null it contains atleast one vertex with a terminal label. Identify the last production rule in the series which has atleast one node labelled with a terminal symbol, say ’’ on the right hand side.
-
(b)
Create a copy of in which one occurrence of ’’ is replaced by a new terminal symbol ’’, and label this production . The connection instructions corresponding to includes all the instructions in . In addition every connection instruction which contains ’’ is duplicated and ’’ is inserted instead of ’’. Update as .
-
(a)
-
3.
Repeat Step 2 for with the terminal symbol ’’ on the right hand side of replaced by , label this production . The connection instructions corresponding to includes all the instructions in . In addition every connection instruction which contains ’’ is duplicated and ’’ is inserted instead of ’’.One more jumping connection instruction of the form is added to this set. Update as .
-
4.
Replace the last occurrence of with in each to obtain . The new regular control is given by
.
We now define a new graph grammar capable of generating the language such that as follows.
,
It is clear that the underlying graph obtained after chain concatenation of graphs and is identical to the the underlying graph which is the result of this construction. ∎
THeorem 5.
The class of underlying graph languages formed from graph classes generated using jumping graph grammars is closed under the graph operation star concatenation.
Proof.
Consider an graph grammar generating the graph language . We define a new graph grammar capable of generating the language as follows.
,
Initially the production replaces the start node of with a copy of the start graph of and the node itself. Now replaces by a graph . The rules and are recursively applied to further generate new components of the resultant graph. Finally the derivation terminates when is applied. Hence it is clear that generates . ∎
5 Conclusion
In this paper we have proved that graph grammars and its variants are closed under some simple graph operations. These closure properties could be applied in situations where we wish to generate/study the classes of graph languages which could be recursively constructed from simpler families of graphs. The possibility for exploration into closure properties of these classes of grammars with respect to other operations remains open. Other properties such as the membership problem also remain to be examined.
References
- \bibcommenthead
- Ehrig [1978] Ehrig, H.: Introduction to the algebraic theory of graph grammars (a survey). In: Claus, V., Ehrig, H., Rozenberg, G. (eds.) Graph-Grammars and Their Application to Computer Science and Biology, International Workshop, Bad Honnef, October 30 - November 3, 1978. Lecture Notes in Computer Science, Vol 1073, pp. 1–69. Springer, (1978)
- Ehrig [1986] Ehrig, H.: Tutorial introduction to the algebraic approach of graph grammars. In: Ehrig, H., Nagl, M., Rosenfeld, A., Rozenberg, G. (eds.) Graph Grammars and Their Application to Computer Science. Graph Grammars 1986. Lecture Notes in Computer Science, Vol 291, pp. 3–14. Springer, (1986)
- Ehrig et al. [1992] Ehrig, H., Habel, A., Kreowski, H.-J.: Introduction to graph grammars with applications to semantic networks. Computers & Mathematics with Applications 23(6), 557–572 (1992) https://doi.org/10.1016/0898-1221(92)90124-Z
- Engelfriet and Vereijken [2005] Engelfriet, J., Vereijken, J.J.: Concatenation of graphs. Graph Grammars and Their Application to Computer Science. Graph Grammars 1994. Lecture Notes in Computer Science, Volume 1073, 368–382 (2005)
- Habel and Kreowski [1986] Habel, A., Kreowski, H.: May we introduce to you: Hyperedge replacement. In: Ehrig, H., Nagl, M., Rosenfeld, A., Rozenberg, G. (eds.) Graph Grammars and Their Application to Computer Science. Graph Grammars 1986. Lecture Notes in Computer Science, Vol 291, pp. 15–26. Springer, (1986)
- Pavlidis [1972] Pavlidis, T.: Linear and context-free graph grammars. Journal of the ACM 19(1), 11–22 (1972)
- Rozenberg [1997] Rozenberg, G.: Node replacement graph grammars. In: Engelfriet, J., Rozenberg, G. (eds.) Handbook of Graph Grammars and Computing by Graph Transformation, pp. 1–94. World Scientific, (1997). Chap. 1
- Rozenberg and Salomaa [1997] Rozenberg, G., Salomaa, A.: Handbook of Formal Languages. Springer, (1997)
- Rozenberg and Welzl [1986a] Rozenberg, G., Welzl, E.: Boundary nlc graph grammars—basic definitions, normal forms, and complexity. Information and control 69(1-3), 136–167 (1986)
- Rozenberg and Welzl [1986b] Rozenberg, G., Welzl, E.: Graph theoretic closure properties of the family of boundary nlc graph languages. Acta informatica 23, 289–309 (1986)
- Vijayakumar et al. [2023] Vijayakumar, J., Mathew, L., Nagar, A.K.: A new class of graph grammars and modelling of certain biological structures. Symmetry 15(2) (2023)
- Vijayakumar and Mathew [2022] Vijayakumar, J., Mathew, L.: On jumping graph grammars. In: Proceedings of The International Conference on Mathematics of Intelligent Computing and Data Science. Springer Proceedings in Mathematics and Statistics (2022)
- Vijayakumar and Mathew [2021] Vijayakumar, J., Mathew, L.: nc-ence graph grammars and graph rewriting p systems. In: International Conference on Membrane Computing (2021)
- Křivka and Meduna [2015] Křivka, Z., Meduna, A.: Jumping grammars. International Journal of Foundations of Computer Science 26(06), 709–731 (2015)
- Meduna and Zemek [2012] Meduna, A., Zemek, P.: Jumping finite automata. International Journal of Foundations of Computer Science 23(07), 1555–1578 (2012)