ArticlePDF Available

Graph grammars according to the type of input and manipulated data: A survey

Authors:

Abstract and Figures

Graph grammars which generate graphs are a generalization of Chomsky grammars that generate strings. During the last decades there has been a remarkable development of graph grammars. Due to their wide diversity of applications, graph grammars have received a particular attention from many scientists and researchers. There has been applications of graph grammars in several areas such as pattern recognition, data base systems, biological developments in organisms, semantics of programming languages, compiler construction, software development environments, etc. In the literature, in some surveys, graph grammars have been studied and classified according to some criteria such as: parallel or sequential applicability of rules, embedding mechanism, type of generated graphs, etc. In addition to this, as data play an important role more and more in different domains, we survey in this paper the vast field of graph grammars by classifying them according to three criteria: the number of manipulated data (single or multiple types), the nature of data (structured or unstructured), and finally the kind of data (images, graphs, patterns, etc.). In particular, we consider that a graph grammar is well defined by five components instead of four, namely: type of generated graphs ($T_G$), a start graph (Z), a set of production rules (P), a set of additional specifications of the rules (A), and the criterion that we additionally consider which is the type of input and manipulated data ($T_D$). This proposed formalism, especially with the added fifth component, may serve to overcome some issues related to Big Data and Cloud Computing domains. === The published version, in the journal "Computer Science Review", can be downloaded at: https://www.sciencedirect.com/science/article/pii/S1574013716301009 or by using the personalized Share Link: https://authors.elsevier.com/a/1Wtzs5buwWReJH until June 03, 2018. ===
Content may be subject to copyright.
Graph grammars according to the type of input
and manipulated data: a survey
Saadia Albane a, Hachem Slimani a,, Hamamache Kheddouci b
aLIMED Laboratory, Computer Science Department, University of Bejaia, 06000 Bejaia, Algeria
bUniversit´e de Lyon, CNRS, Universit´e Lyon 1, LIRIS, UMR5205 F-69622, France
Corresponding author
Email addresses: saadialbane@gmail.com, haslimani@gmail.com, hamamache.kheddouci@univ-lyon1.fr
Abstract
Graph grammars which generate graphs are a generalization of Chomsky grammars
that generate strings. During the last decades there has been a remarkable develop-
ment of graph grammars. Due to their wide diversity of applications, graph grammars
have received a particular attention from many scientists and researchers. There has
been applications of graph grammars in several areas such as pattern recognition, data
base systems, biological developments in organisms, semantics of programming languages,
compiler construction, software development environments, etc. In the literature, in some
surveys, graph grammars have been studied and classified according to some criteria such
as: parallel or sequential applicability of rules, embedding mechanism, type of generated
graphs, etc. In addition to this, as data play an important role more and more in different
domains, we survey in this paper the vast field of graph grammars by classifying them
according to three criteria: the number of manipulated data (single or multiple types), the
nature of data (structured or unstructured), and finally the kind of data (images, graphs,
patterns, etc.). In particular, we consider that a graph grammar is well defined by five
components instead of four, namely: type of generated graphs (TG), a start graph (Z),
a set of production rules (P), a set of additional specifications of the rules (A), and the
criterion that we additionally consider which is the type of input and manipulated data
(TD). This proposed formalism, especially with the added fifth component, may serve to
overcome some issues related to Big Data and Cloud Computing domains.
Keywords: Graph grammar; Type of input and manipulated data; Type of generated
graph; Big Data; Cloud computing; Application.
Contents
1 Introduction and motivation 4
2 Preliminaries and definitions 6
3 Graph grammars which manipulate a single data type 13
3.1 Structureddata................................... 13
3.1.1 Graph grammars which manipulate data in the form of images . . . . 13
3.1.1.1 Web grammar (WG) . . . . . . . . . . . . . . . . . . . . . . 13
3.1.1.2 Applications ........................... 15
3.1.2 Graph grammars which manipulate data in the form of graphs . . . . 16
3.1.2.1 Parsing graph grammar (PGG) . . . . . . . . . . . . . . . . . 16
3.1.2.2 Conditional node replacement graph grammar (cNRGG) . . 18
3.1.2.3 Partially ordered conditional graph grammar (POcNRGG) . 18
3.1.2.4 Attributed programmed graph grammar (APGG) . . . . . . 20
1
3.1.2.5 Applications ........................... 21
3.1.3 Graph grammars which manipulate data in the form of patterns . . . 22
3.1.3.1 Graph grammar for package diagrams (GGPD) . . . . . . . . 22
3.1.3.2 Attributed context-sensitive graph grammar (ACSGG) . . . 24
3.1.3.3 Applications ........................... 24
3.2 Unstructureddata ................................. 25
3.2.1 Graph grammars which manipulate data in the form of alphabets . . . 25
3.2.1.1 Context free graph grammar (CFGG) . . . . . . . . . . . . . 25
3.2.1.2 (Directed) Node label controlled graph grammar (DNL-
CGG/NLCGG) ......................... 27
3.2.1.3 Neighborhood controlled embedding graph grammar (NCEGG) 29
3.2.1.4 Node-replacement graph grammar with path-controlled em-
bedding(nPCEGG)....................... 30
3.2.1.5 Neighborhood controlled embedding with edge-labeled and di-
rected graph grammar (edNCEGG) . . . . . . . . . . . . . . 31
4 Graph grammars which manipulate multiple data types 33
4.1 Hybrid data (structured and/or unstructured data) . . . . . . . . . . . . . . . 33
4.1.1 Graph grammars which manipulate 2 types of data . . . . . . . . . . . 33
4.1.1.1 Tree-adjoining graph grammar (TAGG) . . . . . . . . . . . . 33
4.1.1.2 Pair graph grammar (PrGG) . . . . . . . . . . . . . . . . . . 36
4.1.1.3 (Adaptive) star graph grammar (ASGG) . . . . . . . . . . . 36
4.1.1.4 Probabilistic context free 2D-graph grammar (PCF2DGG) . 37
4.1.1.5 Applications ........................... 39
4.1.2 Graph grammars which manipulate at least 3 types of data . . . . . . 40
4.1.2.1 (Hyper)edge replacement graph grammar (HRGG/ERGG) . 40
4.1.2.2 Triple graph grammar (TGG) . . . . . . . . . . . . . . . . . 42
4.1.2.3 Graph grammar with (positive, negative) application condi-
tions(GGA) ........................... 43
4.1.2.4 Applications ........................... 45
5 Recapitulative of the studied graph grammars 46
6 Conclusion and discussion 49
2
Table of symbols
Symbol Meaning
GG Graph Grammar.
VSet of vertices.
ESet of edges.
sVAssigns an edge’s source vertex,
tVAssigns an edge’s target vertex,
lVAssigns vertex labels.
lEAssigns edge labels.
EDSet of directed edges.
END Set of undirected edges.
TDType of input and manipulated data.
TGType of generated graph.
ASet of additional specifications of the productions.
Σ Set of vertex labels.
ΣNSet of nonterminal vertex labels.
ΣTSet of terminal vertex labels.
Γ Set of edge labels.
ΓNSet of nonterminal edge labels.
ΓTSet of terminal edge labels.
PSet of production rules.
ZInitial graph or axiom.
IInput vertices.
OOutput vertices.
EEmbedding of the production rule.
W G Web Grammar.
AP GG Attributed Programmed Graph Grammar.
GGA Graph Grammar with Application conditions.
nP C EGG node-replacement Graph Grammar with Path-Controlled Embedding.
C F GG Context Free Graph Grammar.
DN LCGG Directed Node Label Controlled Graph Grammar.
NLCGG Node Label Controlled Graph Grammar.
1DN CEGG Directed Graph Grammar with Neighborhood-Controlled Embedding
and singleton left-hand sides.
NCEGG Neighborhood Controlled Embedding Graph Grammar.
eNCEGG Graph Grammar with Neighborhood Controlled Embedding and
dynamic edge relabeling.
neNCEGG Node replacement Graph Grammars with dynamic node relabeling.
NRGG or C-edN C GG Node Replacement Graph Grammar.
R(A-DN LCGG) Relabeling of an Apex DNLC Graph Grammar.
ADGG Attribute Dependency Graph Grammar.
T AGG Tree Adjoining Graph Grammar.
ASGG Adaptive Star Graph Grammar.
edNCEGG Neighborhood Controlled Embedding with edge-labeled and
directed Graph Grammar.
3
HRGG Hyperedge Replacement Graph Grammar.
ERGG Edge Replacement Graph Grammar.
GGP D Graph Grammar for Package Diagrams.
ACSGG Attributed Context-Sensitive Graph Grammar.
T GG Triple Graph Grammar.
P rGG Pair Graph Grammar.
P GG Parsing Graph Grammar.
cNRGG conditional Node Replacement Graph Grammar.
P OcN RGG Partially Ordered conditional Graph Grammar.
1 Introduction and motivation
As a generalization of Chomsky grammars which generate strings, graph grammars that gener-
ate graphs were first introduced, under the name of Web Grammars [68], to deal with picture
processing problems. During the last decades, graph grammars, that are graph rewriting
systems, have received a particular attention from many scientists and researchers because of
their wide diversity of applications in several areas such as pattern recognition, data base sys-
tems, modeling objects and structure dynamics, biological developments in organisms, extrac-
tion of graph queries, semantics of programming languages, compiler construction, software
development environments, bidirectional transformations, etc. Some of such applications can
be found in [12, 19, 34, 35, 39, 41, 60, 61, 72, 65, 64, 74]. In contrast to string grammars,
and due to the properties of graphs, graph grammars represent a suitable formalism for de-
scribing structural manipulations of multidimensional data. The main principle of derivation
in a graph grammar consists of recursively replacing from a given data graph a subgraph by
another one, to generate terminal graphs representing the corresponding language.
The development process of the components that constitute basic elements of graph gram-
mars has evolved over time. Initially, Pfaltz and Rosenfeld [68] used three components to rep-
resent web grammars, that are “phrase-structure” grammars which define languages whose
sentences are directed graphs with symbols at their vertices, namely W G = (Σ, Z, P ) such
that: Σ is a set of terminal and nonterminal symbols corresponding to the vertex labels;
Zis a set of initial subgraphs; and Pis a set of rewriting rules where each rule is mainly
composed of a left hand side representing the subgraph to be substituted, and a right hand
side corresponding to the subgraph to be inserted. Since then, for considerations of graph
grammar applications in different fields, other components are introduced and involved in the
definition of graph grammars, such as: Γ which is a set of edge labels; A, B which are finite
sets of vertex and edge attributes; Cwhich is a control diagram over a set of productions
P;A(p) = (AP (p), AN (p)) which is an application condition constituted of a positive (resp.
negative) one AP (p) (resp. AN(p)), etc. In this setting, for instance, by involving Γ, A, B
and C, Bunke [9] introduced Attributed Programmed Graph Grammar which generates undi-
rected graphs with labeled vertices and edges over (Σ,Γ) for the interpretation of schematic
diagrams. Furthermore, Fotso et al. [34] (resp. Baumann [6]) used this graph grammar for
generating the diversity in a products family (for representing a-priori knowledge about com-
mon music notation). On the other hand, by involving AN(p), Habel et al. [41] defined Graph
Grammar with Application Conditions for the specification of a lift control system. Moreover,
Machado et al. [61] investigated the modeling of dynamic systems by means of second-order
graph grammars. In particular, they proposed a notion of rule-based modification of graph
rules based on two concepts that are double-pushout rewriting and negative application con-
ditions. Recently, De la para and Dean [16] proposed a formalism of four main elements which
4
gathers all the above components to represent graph grammars, that is GG = (TG, Z, P, A)
such that: TGis a type of generated/recognized graphs over Σ and/or Γ, which can be di-
rected or undirected, with labeled vertices and/or edges; Zis a start graph; Pis a set of
production rules; and Ais a set of additional specifications of the rules which extends the
manner of applying the production rules, such as: the applied embedding mechanism E, the
associated application conditions A(p), the corresponding vertex and edge attributes A, B,
the priority of application rules if any where the order can either be specified explicitly by
using a control flow mechanism, or it can be given implicitly by causal dependencies of rule
applications [7], etc.
As data volumes grow exponentially, one of the questions that might arise is: “Is the
formalism of graph grammars proposed by De la para and Dean [16] sufficiently adequate to
take into consideration of Big Data characteristics and requirements?”. Big Data represent
a huge volume of both structured and unstructured data which is so vast that it is hard to
process them using the conventional methods. Specifically, these large amounts of data can be
generated from different sources: mobile devices, satellites, social networks, internet of things,
sensor networks, cloud computing, organizations’ enterprise systems, etc. These sources are
related/involved to/in several fields of applications such as telecommunication, astronomy,
government operations, computer science, electronic commerce, health care, financial trading,
etc. Laney [58] characterized the Big Data concept by three most famous properties 3Vs
which are Volume, Variety, and Velocity, where Volume represents the wide amount of data;
Variety corresponds to the different kinds of data; and Velocity characterizes the high speed
of data process. Thus, according to Jain et al. [45], there exist several challenges of Big Data
and among them there are: the aggregation of data from heterogeneous sources (the data may
come from various sources, with each having a different format) and their analysis to get useful
information; The complexity of Big Data that is due to multiple data which are collected in
very different contexts (multi-source, multi-view, multi-tables, sequential, etc.); The evolution
of Big Data is also considered as a big challenge. Thus the manipulation of heterogeneous
data (images, patterns, graphs, videos, etc.) requires graph grammars robust enough for their
processing and analysis. Hence the importance to see graph grammars classified according to
the type of input and manipulated data is an imperious necessity. For this, we introduce a new
approach that considers data as an important component of a graph grammar. This approach
extends the graph grammars formalism proposed by De la para and Dean [16] and tries to
answer to the above question. In this framework, we propose to complete the formalism of
De la para and Dean [16] by introducing a fifth component denoted TDwhich represents the
type of input and manipulated data ” that corresponds to each considered graph grammar.
In this paper, we survey the vast field of graph grammars by classifying them according
to three criteria: the number of manipulated data (single or multiple types), the nature of
data (structured or unstructured), and finally the kind of data (images, graphs, patterns,
etc.), see Figure 2. In the literature, there has been several surveys on graph grammars which
have been investigated and classified according to some criteria such as: parallel or sequential
applicability of rules, embedding mechanism, type of generated graphs, etc. For instance, Nagl
[66] gave the main application fields of graph grammars and the most approaches for sequential
and parallel graph grammars. Fahmy and Blostein [32] reviewed theoretical aspects of graph
grammars, especially of the embedding problem, and summarized the main graph grammar
applications. Hildebrandt et al. [42] developed a set of criteria (Usability, Expressiveness,
Formal Properties) to give a quantitative and qualitative comparison of three TGG tools
which are MoTE, TGG Interpreter, eMoflon. Recently, De la parra and Dean [16] in their
survey studied the features of graph rewriting systems and their application to implement
transformations of language-based software models. Furthermore, one can also see the surveys
5
of Janssens and Rozenberg [47], Drewes et al. [21], and Xiao-qin and Kang [75]. The main
contribution of our survey is that the proposed classification is based on a new criterion “the
type of input and manipulated data” that is independent of the two traditional approaches,
namely the set-theoretic and algebraic approaches, that depend mainly on the nature of the
productions rules and the employed embedding mechanism. As a consequence, we consider
that a graph grammar is well defined by five components instead of four as considered by De
la parra and Dean in [16], that is GG = (TD, TG, Z, P, A) where TG, Z, P and Aare as given
above and TDis the criterion that we additionally include which is the type of input and
manipulated data that can be images, patterns, alphabets, graphs, two types of data, and at
least three types of data.
This survey is organized as follows: we give in Section 2 some preliminaries and definitions
concerning graphs, graph rewriting production, graph grammar, and embedding mechanism
that will be needed in the rest of the paper. In Sections 3 and 4, which are the core of the pa-
per, we present our classification according to the three above criteria. At the end of each part
of section, which gathers a set of graph grammars of a same type, we present some essential
associated applications by adopting them to the proposed formalism. In Section 5, we ex-
hibit a recapitulative tabular that specifies some features of the investigated graph grammars
according to some criteria. Finally, in Section 6, we summarize and draw conclusions.
2 Preliminaries and definitions
In this section, we present the definitions of graph, graph rewriting production, graph gram-
mar, and the embedding mechanism (with some properties) which will be heavily used in the
sequel. For illustration, two examples of application of a production rule and graph grammar
will be given. A graph Gis defined to be a pair (V, E ) where Vdenotes the vertex set and
E(V×V) is the edge set in the graph. De la parra and Dean [16] defined the concept of
directed graph with labeled vertices and edges as follows:
Definition 2.1. [16] A labeled directed graph Gover a pair of label alphabets (Σ,Γ) (where
Σ=ΣNΣT={vl1, ..., vlp}is the set of nonterminal and terminal vertex label alphabets,
and Γ = ΓNΓT={el1, ..., elq}is the set of nonterminal and terminal edge label alphabets)
consists of a sextuple (V, E , sV, tV, lV, lE) where
V={v1, ..., vn}(an arbitrary set of nodes, or vertices),
E={e1, ..., em} ⊆ V×V(set of directed edges),
sV:EVassigns an edge’s source node, (e.g. for eh= (vi, vj)E, sV(eh) = vi),
tV:EVassigns an edge’s target node, (e.g. for eh= (vi, vj)E, tV(eh) = vj),
lV:VΣ assigns vertex labels, (e.g. for viVlabeled by vlk(denoted vvlk
i),
lV(vvlk
i) = vlk),
lE:EΓ assigns edge labels, (e.g. for ejElabeled by elt(denoted eelt
j), lE(eelt
j) =
elt).
The graph Gcan be simple (resp. multiple) if there exists at most one edge between two
arbitrary vertices (resp. if there exist multiple edges between at least two vertices).
6
Hypergraphs represent an extension of the structural concept of a graph to contain hy-
peredges, instead of edges, connecting to multiple source and target nodes [16, 40].
To simplify things, we substitute all the components E, sV, tVwith the type of graph that
can be simple (S) (resp. multiple (M), hypergraph (H)) by an only component ES
D(resp.
EM
D,EH
D) which means simple graph (resp. multiple graph, hypergraph) with directed edges,
and in the case of undirected edges we take the components ES
ND, E M
ND, E H
ND. Thus, we
identify a graph by a quadruple (V, E, lV, lE) such that Emay be ES
D, EM
D, EH
D, ES
ND, E M
ND,
or EH
ND and the other components V, lVand lEare kept as in Definition 2.1.
From there, the specific types of graphs that can be defined are given as follows:
X(V, E S
D, lV, lE) (resp. (V, E M
D, lV, lE), (V, E H
D, lV, lE)) over (Σ,Γ): Directed Simple graph
(resp. Directed Multiple graph, Directed Hypergraph) with labeled vertices and edges.
It corresponds to the case where E=ES
D(resp. E=EM
D,E=EH
D), Σ ̸=, and Γ ̸=.
X(V, E S
D, lV) (resp. (V , EM
D, lV), (V, E H
D, lV)) over Σ: Directed Simple graph (resp. Di-
rected Multiple graph, Directed Hypergraph) with labeled vertices. It corresponds to
the case where E=ES
D(resp. E=EM
D,E=EH
D), Σ ̸=, and Γ = .
X(V, E S
D, lE) (resp. (V, EM
D, lE), (V, E H
D, lE)) over Γ: Directed Simple graph (resp. Di-
rected Multiple graph, Directed Hypergraph) with labeled edges. It corresponds to the
case where E=ES
D(resp. E=EM
D,E=EH
D), Σ = , and Γ ̸=.
X(V, E S
D) (resp. (V, E M
D), (V, E H
D)): Unlabeled Directed Simple graph (resp. Unlabeled
Directed Multiple graph, Unlabeled Directed Hypergraph). It corresponds to the case
where E=ES
D(resp. E=EM
D,E=EH
D), Σ = , and Γ = .
X(V, E S
ND, lV, lE) (resp. (V , EM
ND, lV, lE), (V , EH
ND, lV, lE)) over (Σ,Γ): Undirected Simple
graph (resp. Undirected Multiple graph, Undirected Hypergraph) with labeled vertices
and edges. It corresponds to the case where E=ES
ND (resp. E=EM
ND,E=EH
ND),
Σ̸=, and Γ ̸=.
X(V, E S
ND, lV) (resp. (V, E M
ND, lV), (V , EH
ND, lV)) over Σ: Undirected Simple graph (resp.
Undirected Multiple graph, Undirected Hypergraph) with labeled vertices. It corre-
sponds to the case where E=ES
ND (resp. E=EM
ND,E=EH
ND), Σ ̸=, and Γ = .
X(V, E S
ND, lE) (resp. (V, EM
ND, lE), (V , EH
ND, lE)) over Γ: Undirected Simple graph (resp.
Undirected Multiple graph, Undirected Hypergraph) with labeled edges. It corresponds
to the case where E=ES
ND (resp. E=EM
ND,E=EH
ND), Σ = , and Γ ̸=.
X(V, E S
ND) (resp. (V, EM
ND), (V , EH
ND)): Unlabeled Undirected Simple graph (resp. Un-
labeled Undirected Multiple graph, Unlabeled Undirected Hypergraph). It corresponds
to the case where E=ES
ND (resp. E=EM
ND,E=EH
ND), Σ = , and Γ = .
Generally, a graph grammar GG is a graph rewriting system composed by four compo-
nents: a set of nonterminal labels ΣNΓN, a set of terminal labels ΣTΓT, an initial graph
Z, and a set of rewrite rules called production rules P[69]. Recently, De la parra and Dean
[16] have extended this definition of graph grammar by adding two components TGand A
where TGis the type or class of graph that can be generated, modified and recognized by
applying a set of production rules P, and Ais a set of additional specifications extending the
scope and nature of applying the set of productions Pto graphs of type TG. In this sense,
since every graph grammar has its specific and associated type of manipulated data, in order
to complete this definition we consider that it can be further extended by introducing a new
component TDwhich represents the type of input and manipulated data by a given graph
7
grammar. Before defining a graph grammar with the additional fifth component (Definition
2.3), we give a general definition of a production rule with an example of illustration.
Definition 2.2. [4] A graph rewriting production is a sextuple p= (LG, K, RG, ac, gl, em)
that allows the transformation of a graph Ginto a direct derivation graph H, whose compo-
nents are defined as follows:
LG is the production’s left graph. Applying a production to a graph Ginvolves searching
for one or more isomorphic occurrences of LG in Gwhich will eventually be replaced
by instantiations of graph RG,
Kis the production’s interface graph which is a subgraph (i.e., no dangling edges: all its
edges have a target and a source node). LG and RG contain an isomorphic occurrence
of it,
RG is the production’s right graph which will be attached to an intermediate graph
(GLG)K, in the more common case, using graph gluing or embedding, or both
operations, to produce a direct derivation graph Has the overall result of applying the
production,
ac are the application conditions under which a production will be applied. They could
represent the existence or non-existence of certain nodes, edges, or subgraphs in the
graph G, as well as embedding restrictions of LG in Gor of RG in H,
gl is the gluing operation which consists of three steps:
XBuild a context graph Dwhich contains the graph G, minus the nodes and edges
of the isomorphic occurrence of LG in Gthat are not preserved in RG;
XGlue graphs Dand LG through Kto generate the graph G. This operation is the
disjoint union of graphs Dand LG; and
XGlue graphs Dand RG through Kto generate the direct derivation graph H. This
operation is the disjoint union of graphs Dand RG,
em is the embedding (or connecting) operation, which creates edges between designated
nodes in the context graph Dand nodes in the graph RG, to produce the final direct
derivation graph H.
Note that a production either uses embedding or gluing but not both simultaneously.
Now, we present an example, given by Andries et al. [4], which illustrates a graph trans-
formation step.
Example 2.1. An application of a rule p= (LG, K, RG, ac, gl, em) to a given graph Gyields
a resulting graph H, provided that Hcan be obtained from Gin the following five steps:
1. CHOOSE an occurrence of the left-hand side LG in G.
2. CHECK the application conditions according to ac.
3. REMOVE the occurrence of LG up to the occurrence of Kfrom Gas well as all dangling
edges, i.e. all edges incident to a removed node. This yields the context graph Dof LG
which still contains an occurrence of K.
8
4. GLUE the context graph Dand the right-hand side RG according to the occurrences
of Kin Dand RG. That is, construct the disjoint union of Dand RG and, for every
item in K, identify the corresponding item in Dwith the corresponding item in RG.
This yields the gluing graph E.
5. EMBED the right-hand side RG into the context graph Daccording to the embedding
relation emb: For each removed dangling edge incident with a node vin Dand the
image of a node vof LG in G, and each node v′′ in RG, a new edge (with the same
label) incident with vand the node v′′ is established in Eprovided that (v, v′′ ) belongs
to emb.
The application of pto Gyielding His called a direct derivation from Gto Hthrough
p. Figure 1 illustrates the steps which have to be performed when applying the rule p=
(LG, K, RG, ac, gl, em).
K glue
LG RG
G
DE
H
CHOOSE & CHECK
REMOVE
GLUE
EMBED
Figure 1: Illustration of a graph transformation step [4].
Definition 2.3. Agraph grammar is a quintuple GG = (TD, TG, Z, P, A), where
TDis the type of data that GG manipulates,
TGis the type or class of graph (e.g., labeled, directed, simple, multiple, hypergraph)
that can be generated, modified and recognized by applying a set Pof productions,
Zis the start graph to which a set Pof productions will be initially applied,
P={p1, ..., pn}is a set of production rules,
9
Ais a set of additional specifications extending the scope and nature of applying the
set of productions Pto graphs of type TG(e.g., attributes, programmed rules, global
application conditions, structural conditions, embedding mechanism).
The derivation in graph grammars is an important point for generating graph languages.
In a given graph grammar GG, a derivation of a graph Gis a sequence of production appli-
cations Pthat transforms the start graph Zof GG to the graph Gwhere in each production
application to a graph an occurrence of its left hand side is transformed to its right hand side.
This latter transformation is realized by applying what is called the embedding mechanism
which is an important part of a graph grammar. In the literature, there exist several ways of
using the embedding mechanism depending of how to embed the input graph (i.e. the right
hand side of a production) into the rest graph (i.e. the graph after removing the left hand
side of the production and all its incidents edges).
For example, the simple embedding mechanism, called the connection relation, is intro-
duced by Janssens and Rozenberg [50], in the framework of a graph grammar called node
label controlled graph grammar (NLCGG), and further investigated by the same authors in
[51, 48]. Before explaining the notion of derivation in NLCGG, we recall briefly the def-
inition of this graph grammar which will be explained in details in Subsection 3.2.1.2. A
node label controlled graph grammar abbreviated NLCGG is a graph rewriting system con-
sisting of the total alphabet as input and manipulated data TD, a type of generated graph
TG= (V, E S
ND, lV) over Σ, an axiom Z, a connection relation A, and a set of production rules
Pwhere each production rule is composed of a left hand side which contains only a labeled
single vertex and a right hand side which is a graph of type TG.
Let GG = (TD, TG, Z, P, A) be a NLCGG and let Hbe a graph over Σ. A concrete
derivation step in this grammar on His given as follows:
(i) By choosing a vertex vof Hto be rewritten and removing all the edges incident to v
in H, we obtain the graph ˜
H.
(ii) If the label of vin His dthen:
It is mandatory to select a production of the form (d, D), and to substitute the
vertex vin Hby an isomorphic copy ¯
Dof D, such that ¯
Dand Hhave disjoint
vertex sets.
Edges between vertices in ¯
Dand vertices in the rest graph ˜
H\vare established
in the following way. If xis a vertex of ¯
Dlabeled by aand yis a vertex of ˜
H\v
labeled by bsuch that {y, v}is an edge of H, then the edge {x, y}is created if and
only if (a, b) is an element of the connection relation A.
Now, we present an example of NLCGG given by Janssens and Rozenberg [50], to illustrate
how the simple embedding mechanism is used.
Example 2.2. Consider the node label controlled graph grammar N LCGG =
(TD, TG, Z, P, A) where
TDis the total alphabet,
TG= (V, E S
ND, lV) is the type of generated graph over Σ where Σ =
{a, b, c, d, ¯a, ¯
b, ¯c, ¯
d, S, ¯
S}, and ΣT={a, b, c, d, ¯a, ¯
b, ¯c, ¯
d},
Z=S,
10
A={(a, ¯a),(a, ¯
b),a, a),a, d),(b, ¯
b)(b, ¯c),(¯
b, b),(¯
b, a),(c, ¯c),(c, ¯
d),c, c),c, b),
(d, ¯
d),(d, ¯a),(¯
d, d),(¯
d, c)}is the connection relation.
The set of production rules P={p1, p2, p3, p4}where:
S
b
,
a
c
S,S
d
a
aa
bbb
cc
c
ddd
S
,,,,
,.
p1= p2= p3= p4=
SS
The application successively of the productions p2, p4and p1to the initial graph Zgives
the final graph G3given as follows:
S
ab
c
d
S
b
c
d
c
ab
a
d
abb
ac
ddc
p2p4p1
ZG1G2G3
For example, applying the production p4to G1consists of doing the following steps:
Remove the vertex ¯
Sand all its incident edges in the graph G1. Thus, we obtain the
rest graph r-G1composed of the fourth isolated vertices a, b, c and d.
Replace the removed ¯
Swith the right hand side of the production p4which we denote
by rhs-p4.
Add edges between the rest graph r-G1and the embedded graph rhs-p4ac-
cording to the connection relation A. In this case, the set of edges added is
{(¯
b, a),a, a),(¯
b, b),c, b),(¯
d, d),a, d),c, c),(¯
d, c)}.
In the same way, the production p1is applied to G2to obtain G3.
In the literature, a large number of graph grammars have been proposed and studied.
Generally, graph grammars are used to generate and recognize graph languages which differ
from a grammar to another depending on the type of the used production rules and/or
the employed embedding mechanism. Usually, graph grammars are studied in the literature
according to two types of families of approaches which are set-theoretic approaches (essentially
“node replacement approach” and “edge replacement approach”), and algebraic approaches
(“Simple PushOut (SPO) approach” and “Double PushOut (DPO) approach”) [62, 71]. These
two traditional approaches depend mainly on the nature of the production rules and the
employed embedding mechanism. However, motivated by considerations and interests of Big
Data, in this paper we have adopted a new approach which consists to study the graph
grammars according to the type of data that they manipulate. We consider that the type
11
of input and manipulated data represents the data that are used and processed by a graph
grammar to generate a corresponding language after application of its set of production rules.
In this framework, there exist several kinds of graph grammars according to the type of
data that they manipulate. In fact, there are three criteria related to data that distinguish
a graph grammar from another one. These criteria are: the number of data that a given
graph grammar can manipulate, the nature of the data (structured and/or unstructured),
and the kind of data (images, graphs, alphabets, patterns, etc.). Thus, each graph grammar
is strongly characterized by the type of data that it manipulates. Taking into consideration
of the above three criteria, we have classified the graph grammars as follows:
According to the first criterion: we have “graph grammars that manipulate a single
data type” and “graph grammars that manipulate multiple data types”;
According to the second criterion: we have “graph grammars that manipulate structured
data”, “graph grammars that manipulate unstructured data”, and “graph grammars
that manipulate hybrid data (structured and/or unstructured data)”;
According to the third criterion: we have “graph grammars that manipulate images”,
“graph grammars that manipulate graphs”, “graph grammars that manipulate pat-
terns”, “graph grammars that manipulate alphabets”, “graph grammars that manip-
ulate two types of data”, “graph grammars that manipulate at least three types of
data”.
The following organigram summarizes the above classification:
Graph grammars
Manipulating a
single data type
Graphs Patterns At least 3 types of data
Figure 2: Organigram of graph grammars according to the type of input and manipulated
data
Thus, we survey and focus on the vast field of graph grammars by classifying them ac-
cording to the type of input and manipulated data. For each graph grammar, we give its
description, its main results obtained in the literature, and at the last of each section which
gathers a set of graph grammars of a same type we give some essential associated applications
by adopting them to the proposed formalism.
12
3 Graph grammars which manipulate a single data type
In this section, we study graph grammars which manipulate a single data type by distinguish-
ing the structured data from the unstructured data.
3.1 Structured data
In this subsection, we present three classes of graph grammars that manipulate a structured
single data where the first class manipulates images, the second class manipulates graphs,
and the third class manipulates patterns.
3.1.1 Graph grammars which manipulate data in the form of images
There exist graph grammars which involve and manipulate data in the form of images in
order to entirely or partially parse them. Hence their classification as graph grammars that
manipulate data in the form of images. These graph grammars are important, useful and are
involved in some interesting applications such as image processing, modeling client-serveur
scenarios, etc. In this part, we present one of these graph grammars followed by a description
of some of its applications.
3.1.1.1 Web grammar (WG)
Motivated by describing manipulations of multi-dimensional data, considerations in pattern
recognition and visual languages, Pfaltz and Rosenfeld [68] were first introduced web gram-
mars (WGs) by generalizing the theory of conventional languages from strings to graphs (see
also Montanari [63] and Abe et al. [1]). This kind of graph grammar which is considered
as a general and flexible method for picture description in computer graphics involves and
manipulates data in the form of pictures and images and generates directed simple graphs
with labeled vertices. To define the concept of web grammar, we need to present the concepts
of web and subweb defined by Montanari [63] as follows.
Definition 3.1. [63] Let Σ be a finite set, which is called the vocabulary; the elements of
Σ are called symbols. A directed simple web Wover Σ is a triple (V, E S
D, lV) where: Vis a
set of vertices, ES
Dis a set of ordered pairs of elements of Vwhich are called arcs or directed
edges, and lV:VΣ assigns vertex labels.
If Σ has only one element, webs are clearly equivalent to graphs.
Definition 3.2. [63] Given a web W= (V, E S
D, lV) over Σ, the web S= (Vs, EsS
D, ls
V) over
the same Σ is called a subweb of Wif: Vsis a subset of V,ls
V(X) = lV(X) if XVs, and
EsS
Dconsists of just those pairs in ES
Dwhose terms are both in Vs.
Montanari [63] has analogously defined the undirected multiple webs as a special case of
directed webs in which, between any pair of vertices xand y, either no arc exists, or both of
the arcs (x, y) and (y, x) are present. Initially Pfaltz and Rosenfeld [68] (see also Montanari
[63] and Abe et al. [1]) defined W G as a couple of the form (Z, P ) over Σ. By taking into
consideration of the other components TD, TGand Aas given in Definition 2.3, we define
W G as follows.
Definition 3.3. Aweb grammar is a quintuple W G = (TD, TG, Z, P, A) where TDrepresents
data in the form of images, TG= (V, E S
D, lV) corresponds to the type of directed simple graph
with labeled vertices over Σ, Zis a finite set of “initial” webs over Σ, P={p1, ..., pn}is
a finite set of rewriting rules with each pi= (αi, βi) where αiand βiare webs of Σ, and
13
A={A1, ..., An}is a set of additional specifications of the rules such that Ai= (pi, ci,Ei)
where ci(resp. Ei) is called the contextual condition (resp. the embedding) of the rule pi,
i∈ {1, ..., n}. A rule piis applicable to a web Wif αiis a subweb of Wand ciis true.
Note that Pfaltz and Rosenfeld [68] initially defined the rewriting rules without compelling
them to satisfy an applicability condition ci. The latter is introduced by Montanari [63] and
Abe et al. [1] by giving a slightly modified definition of W G and it is proved that generally
this extension does not increase the generative power of the grammar.
Note that ciand Einaturally depend on the labels, or the number, of vertices of W
connected with some vertex of αi. However, in general they can depend also on the entire W
and on the particular subweb αiof Wwhich is to be rewritten.
Abe et al. [1] defined different types of W Gs according to conditions related to their rules.
Such W Gs are called: monotone context-sensitive web grammar (mcswg), context-sensitive
web grammar (cswg), mcswg with applicability condition, context-free web grammar, and
linear web grammar (lwg). For illustration, we give a very simple example of W G.
Example 3.1. We consider the data in the form of image given in Figure 3.
Figure 3: Data in the form of image.
A simple W G which can manipulate this data can be defined as W G = (TD, TG, Z, P, A)
where TDrepresents the image given in Figure 3, TG= (V, E S
D, lV) corresponds to the
type of directed simple graph with labeled vertices over Σ, with Σ = {S, B, C, D, a, b, c, d},
ΣN={S, B, C, D}and ΣT={a, b, c, d},Z={•S},Pconsists of the following rules:
,
p1=
a
is left of
B
S
,
p2=
b
is left of
C
,,
p3=
c
D
C
,,
p4=
D
,
B
is right of
d
and A={A2, A3, A4}is the embedding of the rules such that A2= (p2, e2= (a, b), l2=
is left of), A3= (p3, e3= (b, c), l3= is left of), and A4= (p4, e4= (d, c), l4= is right of).
Ai= (pi, ei, li), i = 2,3,4 means that the arc eiof label lishould be added when the
production piis applied.
So, the directed simple graph generated by this grammar is given in the following form:
a
is left of
b
is left of is right of
d
c
Figure 4: Simple graph with labeled vertices and edges.
14
To transform the graph of Figure 4 (simple graph with labeled vertices and edges) to
a simple graph with only labeled vertices (web), we use the method proposed by Chuang
and Henderson [13] which considers every labeled arc as an intermediate vertex named with
the corresponding geometric relation (“is left of” or “is right of”) and having a label which
indicates that originally it is an arc. Thus, we obtain:
d
c
a
b
E1E2E3
Figure 5: Simple graph with labeled vertices.
Main results: Pfaltz and Rosenfeld [68] gave other examples of W Gs having languages
consisting of trees, of series-parallel networks, of pascal triangles and other interesting classes
of graphs. Furthermore, they proved some results related to W Gs by using the concept
of convex graphs. Montanari [63] presented a number of W Gs which generate interesting
classes of graphs including unseparable (planar) graphs and planar graphs by using the normal
embedding which is defined by a one-to-one function.
Abe et al. [1] investigated the classes of W Gs and the languages of various types of web
grammars with special interest for those are normal and nonnormal. Specifically, it is shown
that there exists a complete W G which generates some types of Eulerien graphs and line
graphs. Moreover, as a main result, from the studies of Abe et al. [1] and Montanari [63], it
is obtained that almost all graphs can be defined by W Gs.
3.1.1.2 Applications
Graph grammars have properties to describe two-dimensional structures which make them
more general than string grammars. In this subsection, we present some applications of graph
grammars in practice by adopting them to the proposed formalism where the manipulated
data in this case are in the form of pictures and/or images. Graph grammars were first intro-
duced by Pfaltz and Rozenfeld [68] to deal with picture processing problems e.g. recognition
of handprinted letters, recognition of chromosomes, recognition of compound features, etc.
For this latter application, the used graph grammar is W G = (TD, TG, Z, P, A) where TD
represents data in the form of pictures; TGcorresponds to the type of directed simple graph
with labeled vertices and arcs where a picture, which can be described by listing its subpic-
tures and the geometric relations between them as “is right of”, “is below of”, “is connected
with”, etc., is represented by a graph of type TG(shape graph) as follows: each subpicture
corresponds to a vertex which is labeled with the subpicture itself, and there is an arc be-
tween two vertices which is labeled by a geometric relation iff the corresponding subpictures
satisfy this relation [66]. Chuang and Henderson [13] proposed a method which transforms a
shape graph to a shape web (graph with only labeled vertices) by considering every labeled
arc as an intermediate vertex named with the corresponding geometric relation and having
a label which indicates that originally it is an arc (as illustrated in Example 3.1), thus TG
becomes a directed simple graph with only labeled vertices (shape web); Zis a finite set of
“initial” subgraphs (subpictures); P={p1, ..., pn}is a finite set of web rewriting rules which
can be used on a shape web to produce an infinite number of shapes which represent a type
of compound features; and A={A1, ..., An}is a set of specifications of the rule where for
each i∈ {1, ..., n},Ai= (pi, ci,Ei) associates to pia contextual condition ci(e.g. there exists
an arc between two vertices which is labeled by a geometric relation iff the corresponding
15
subpictures satisfy this relation), and the embedding Eithat represents arcs added between
the host graph and the new subgraph (subpicture) if there exists a geometric relation between
them. Thus, this method allows to recognize compound features using web grammars parsing
on a solid model graph.
Recently, Machado et al. [61] used a graph grammar that models a client-server scenario.
This system is represented by a graph grammar GG = (TD, TG, Z, P, A) where TDrepresents
data in the form of images containing objects (entities) such as: computers (pc), data servers
(server), messages (msg ), and data packages (data); TG= (V, ES
D, lV) corresponds to the
type of directed simple graph with labeled vertices over Σ where the vertices represent the
image objects (pc,server,msg,data), the edges represent where the entities are located:
data nodes may be directly stored in servers, computers or embedded in messages; Zis
an initial graph which corresponds to a starting situation of the system; Pis a set of four
rules in this system, representing four kinds of transitions: a client sends a message to a
server (sendMSG), a message loads a data node from a server (getDATA), a server returns
a message carrying a data element to a client (receiveMSG), and a client retrieves a data
element from a returned message, deleting the message (deleteMSG); and A={A1, ..., A4}is
a set of additional properties such that for each i∈ {1, ..., 4}, Ai= (NAi, pi) associates a set
of negative application conditions NAito the rule pi.
3.1.2 Graph grammars which manipulate data in the form of graphs
It concerns mainly graph grammars where each one of them generates a graph corresponding
to a graph query whose answer is to search for in a data graph. Thus the associated pro-
duction rules are defined to answer to a graph query that corresponds to a subgraph of the
source graph. Furthermore, we can find graph grammars that manipulate graphs representing
structures to be studied. Hence their classification as graph grammars that manipulate data
in the form of graphs. In this part, we present some of these graph grammars followed by a
description of their main applications.
3.1.2.1 Parsing graph grammar (PGG)
Parsing graph grammar (PGG) is introduced by Flesca et al. [36] as a restricted form of
node replacement context-free graph grammar defined by Engelfriet [23]. P GG is intended
especially to extract information from data graphs. However, it is not able to express NP-
complete problem due to its limited expressive power. The principle of this grammar is not to
consider all the generated language but only a special subset of graphs with some properties
(corresponding to special query graphs), which identify a part of an input data graph. This
kind of graph grammars involves and manipulates data in the form of graph and generates
directed (or undirected) simple graphs with labeled vertices and edges. Initially Flesca et al.
[36] defined P GG as a couple of the form (Z , P ) over (Σ,Γ). By taking into consideration of
the other components TD,TGand Aas given in Definition 2.3, we define P GG as follows.
Definition 3.4. Aparsing graph grammar is a quintuple P GG = (TD, TG, Z, P, A) where TD
represents data in the form of graph, TG= (V, ES, lV, lE) corresponds to the type of simple
graph with labeled vertices and edges over (Σ,Γ) where EScan be directed simple (ES
D) or
undirected simple (ES
ND), ZΣNis an initial non terminal symbol, Pis a linearly ordered
set of productions of the form pi= (vXi
i, αi), where vXi
iis a vertex vilabeled by XiΣN,αi
is a (general) graph over Σ ΓT, and
Xfor each symbol XΣNthere is a production (vX, ϵ) in Pwith ϵis empty;
16
Xfor each pair of productions pi= (vX, αi) with αinot empty and pj= (vX, ϵ) with
ϵempty, we have the order pi< pjwhich means that the production rule pjcan be
applied only if the production rule picannot be applied successfully,
A={A1, ..., An}is a set of additional properties such that for each i∈ {1, ..., n},
Ai={pi, ci}associates to pi= (vXi
i, αi) a set of connection rules ci={(uγi
i, σi, wδi
i, di) :
uγi
i(resp. wδi
i) is a vertex ui(resp. wi) labeled γi(resp. δi), σiΓT,and di∈ {in, out}}
such that the cardinality of ciis equal to the degree of the vertex vi. A connection rule
(uγi
i, σi, wδi
i, di) associated to pi= (vXi
i, αi) is an edge labeled σiestablished between the
vertex wδi
iαiand the vertex uγi
ineighbor of vXi
isuch that the orientation of the edge is
from uito wi(resp. wito ui) if di=in (resp. di=out), i.e. if there was an edge from uito
vi(resp. vito ui).
Following the same lines as in Flesca et al. [36], we give an example which illustrates how
PGG is used to extract a circuit from a data graph.
Example 3.2. Let the data in the form of graph given in Figure 6(a).
a
aa
a
a
n
n
n
n
a
n
n
n
n
n
n
a
a
a
a
a
a
a
a
(a) Data in the form of
graph.
n
n
n
n
n
a
a
a
a
a
(b) The circuit G.
a
p2= ,
sb
sb
a
sb
sb
a
a
a
a
a
S
p1= ,
sb
sb
a
a
S
,
(c) A set of production rules.
Figure 6: Extracting a circuit
A parsing graph grammar which can manipulate this type of data in order to extract
a circuit which may be a response to a given query graph can be defined as P GG =
(TD, TG, Z, P, A) where TDrepresents the data graph given in Figure 6(a), TGcorresponds
to the directed simple graph with labeled vertices and edges over (Σ,Γ), with Σ = {S, n, $b}
where $bis a label variable symbol which can take any value and, therefore, it can be as-
sociated to any constant, and Γ = {a},Z={⃝S},P={p1, p2}is the set of production
rules given in Figure 6(c) (the εproduction is omitted), where in the production rule p2,
the part Sin its left hand side is substituted by the subgraph box of its right hand side,
and A={A2}where A2is a property which associates to p2the set of connection rules
c2={($b, a, S, out),($b, a, $b, in)}.
Let a query G(TD, P r) which consists of extracting from TDa subgraph having a property
17
P r of circuit of length 5. The answer to the query G(TD, P r ) is a circuit Gof size 5 (which
is of type TG) extracted from the data graph TD, given in Figure 6(b).
Main results: Flesca et al. [36] studied P GG and obtained some results related to
the graph queries and the set of derived mapping pairs Φ(P GG, T D) which consist of query
graphs, that are derived from graph grammars, mapped over a given data graph. In this
sitting, they established that any mapping pair in Φ(P GG, T D) selected nondeterministically
can be computed in polynomial time. Furthermore, they also obtained that the problem of
checking if Q(T D) (an answer to an extended graph query Q= (P GG, P r) over the data
graph T D, with P r is a checking property that the extracted graph must satisfy) is not empty
is NP-complete.
3.1.2.2 Conditional node replacement graph grammar (cNRGG)
Conditional node replacement graph grammar (cN RGG) is defined by Flesca et al. [35] as
an extension of the classical NRGG that will be presented in Subsection 3.2.1.5 by making it
well-suited for specifying graph queries. The answers for these latter are marked subgraphs
extracted from an input data graph, which satisfy the structural properties or conditions
defined by the cNRGG. The particularity of cNRGG is that it specifies more expressive
conditions about the structure and the content of an extracted subgraph contrary to NRGG
which contains only some positive conditions. In this kind of graph grammars the generated
graphs and the type of input and manipulated data are the same to the parsing grammar.
Initially Flesca et al. [35] defined cNRGG as a couple of the form (Z, P ) over (Σ,Γ). By
including the other components TD,TGand Aas in Definition 2.3, we define cNRGG as
follows.
Definition 3.5. Aconditional node replacement graph grammar is a quintuple cNRGG =
(TD, TG, Z, P, A) where TD, and TGare as in P GG,Zis an initial non terminal vertex, Pis
as in NRGG where the right-hand side of each production must contain at least one terminal
vertex or must be the empty graph, and A={A1, ..., An}is a set of additional specifications
of the rules such that for each i∈ {1, ..., n},Ai={pi,Ei, Aci}associates to pian embedding
mechanism Eias in NRGG, and an application condition Aciwhich is a property that the
mapping pair, obtained after applying pi, must satisfy, i.e. a production rule piis successfully
applied in a derivation process only if it derives a mapping pair which satisfies the specified
application condition.
Main results: Flesca et al. [35] studied how cNRGG can be used to query a data graph
TDin order to identify subgraphs of TDwhich satisfy a property defined by cNRGG. In
this setting, they showed that the length of each derivation dof a terminal mapping pair in
Φ(cN RGG, TD), an answer of an cNRGG query, is bounded by (k+ 1) ×(|NTD|l+|NTD|)
where lis the number of terminal variables in Σ, kis the max number of non-terminal vertex
labels appearing in a production of P, and |NTD|is the number of vertices of TD. They also
showed that the problem of deciding whether a terminal mapping pair in Φ(cNRGG, TD) is
not empty is NP-complete. Furthermore, they discussed the expressiveness of graph queries,
and they proved that every property on a graph which is expressible in monadic existential
second order logic (MSO) can be expressed by graph queries.
3.1.2.3 Partially ordered conditional graph grammar (POcNRGG)
Flesca et al. [35] introduced a new type of graph grammar, called partially ordered condi-
tional graph grammar (POcNRGG), which contains the same components as cNRGG with
an additional property which partially orders its production rules. This property is involved
18
in order to drive the derivation process towards terminal mapping pairs that have some de-
sirable characteristics, and reduce the nondeterminism. Initially Flesca et al. [35] defined
P OcN RGG as a couple of the form (Z, P ) over (Σ,Γ). By involving the other components
TD,TGand Aas in Definition 2.3, we define P OcN RGG as follows.
Definition 3.6. Apartially ordered conditional graph grammar is a quintuple P OcN RGG =
(TD, TG, Z, P, A) where TD,TG,Z, and Pare as in cN RGG,A={A1, ..., An}such that for
each i∈ {1, ..., n},Ai={pi,Ei,(Aci), <P}where Eiand Aciare as for cNRGG, and <Pis a
partial order on P. Furthermore, the following conditions on productions hold:
Xfor each symbol XΣNthere is a production (X, ϵ) in Pwhose application condition
is “true” (ϵis empty);
Xfor each pair of productions pi= (X, αi) with αinot empty and pj= (X, ϵ) with
ϵempty, we have the order pi< pjwhich means that the production rule pjcan be
applied only if the production rule picannot be applied successfully.
Following the same lines as in Flesca et al. [35], we give an example which illustrates how
POcNRGG is used to extract a cycle, that corresponds to the answer of a graph query Q1,
from a data graph.
Example 3.3. We consider the data in the form of graph of Figure 7 as given in Example 9
of Flesca et al. [35].
book
book
book
book
b1
b2
b3 b4
p1 p2
publisher
publisher
publisher
c
Figure 7: Data in the form of graph [35].
The data represents a collection of books where each book (resp. publisher) is represented
by a node whose label is the book title (resp. publisher name). Each book bi, i = 1, ..., 4 is
connected by an edge labeled by book to the collection node cand there exists an edge labeled
by publisher between any book and its publisher. Thus, we can have some particular cases:
book nodes are connected to a same publisher node if they share the same publisher (books
b2 and b3 share the same publisher p1), and if a book whose publisher is unknown then its
associated node is a leaf (the book b1 is a leaf).
We consider the following request:
Q1:Find in the data graph of Figure 7 a subgraph containing a publisher which has published
two books of the collection.
Thus, the corresponding graph query is given in Figure 8(a).
19
book
book
$b
$b
$p
publisher
publisher
c
(a) The graph query.
book
book
b2
b3
p1
publisher
publisher
c
(b) The answer to
the graph query.
Figure 8: The graph query and its answer
A partially ordered conditional graph grammar which can manipulate the data of Figure
7 in order to extract a cycle, which corresponds to the answer of the graph query Q1, can
be defined as P OcN RGG = (TD, TG, Z, P, A) where TDrepresents the data graph given in
Figure 7, TGcorresponds to the undirected simple graph with labeled vertices and edges over
,Γ), with Σ = {S, B , c, $p, $b, b1, b2, b3, b4, p1, p2}where crepresents a collection of books,
$b, and $pare label variable symbols which can take any value and, therefore, it can be
associated to any constant (i.e. book, and publisher), and Γ = {book, publisher},Z={⃝S},
P={P1, P2, P3}is the set of production rules given in Figure 9.
P1= ,
S
,P2= ,,P3=
c
book
B
c
book
B
book
book
book
$b $b
$p
publisher
publisher
c
B,
c
book
B
c
Figure 9: A set of production rules.
where in the production rule P2, the subgraph box of its left hand side is substi-
tuted by the subgraph box of its right hand side, and A={A2}where A2={P2, c2=
{(c, book, $b, ),(c, book, B , )}, P2< P3}.P2< P3means that P3is applied if and only if
P2can not be applied. The answer to the query Q1is a cycle Gof size 4 (which is of type
TG) extracted from the data graph TD, given in Figure 8(b).
Main results: Flesca et al. [35] showed that computing an answer of P OcN RGG graph
query can be done in polynomial time (the size of TD). Furthermore, they established an
algorithm which computes a preferred mapping pair (a mapping pair M1such that SM1,
is said to be preferred, with respect to P O cNRGG, if there is no mapping pair M2such that
SM2and M2< M1with Sis an initial nonterminal symbol or axiom). Moreover, they
compared the expressive power of P OcN RGG graph queries with the expressiveness of path
queries. Besides, they specialized P O cNRGG for extracting data from X M L graph.
3.1.2.4 Attributed programmed graph grammar (APGG)
The concept of attributed programmed graph grammars (APGG) is introduced by Bunke [9, 10]
for the interpretation of schematic diagrams. This type of grammar, which manipulates data
20
in the form of graphs and generates undirected simple graphs with labeled vertices and edges,
is further investigated by Fotso et al. [34]. An application of this graph grammar is realized
by Fotso et al. [34] in modeling of a products family (Furniture, Low part, A door, A drawer)
where the manipulated graphs in this case are represented using the basic product which is
the Box and its primitive modules that represent Drawer box drawer brake and Drawer box
standard slide. Initially Bunke [9] (see also Fotso et al. [34]) defined APGG as a triple of the
form (Z, P, A) over (Σ, Γ). By including the other components TDand TGas in Definition
2.3, we define APGG as follows.
Definition 3.7. An attributed programmed graph grammar is a quintuple AP GG =
(TD, TG, Z, P, A) where TDrepresents data in the form of graphs, TG= (V, E S
ND, lV, lE) cor-
responds to the type of undirected simple graph with labeled vertices and edges over (Σ, Γ),
Zis a set of initial graphs, P={p1, ..., pn}is a finite set of productions, and A={C, A, B }
is a set of additional properties where Cis the control diagram over Pand A,Bare finite
sets of vertex and edge attributes respectively.
Main results: Bunke [10] presented an application of AP GGs in image understanding
like the understanding of circuit diagrams and flowcharts, by transforming an input image
to the required initial graph structure to obtain the desired representation after application
of production rules. Furthermore, Baumann [6] described and processed a-priori knowledge
about common music notation by using a simplified AP GG. Moreover, Fotso et al. [34] used
AP GGs to generate the diversity in a products family by beginning from the model of a
base-product to obtain the family architecture and to define variants by using four types of
operators namely: add, eliminate, update, and adjust.
3.1.2.5 Applications
In this part, we present some applications of graph grammars in practice by adopting them
to the proposed formalism where the manipulated data in this case are in the form of graphs.
Flesca et al. [35] used the partially ordered conditional graph grammar to extract books
and publishers from a collection of books. In this application, the used graph grammar is
P OcN RGG = (TD, TG, Z, P, A) where TDrepresents data in the form of graph which models
a collection of books;TGcorresponds to the type of undirected simple graph with labeled
vertices and edges where each book/publisher is represented by a vertex labeled by its book-
title/publisher-name, an edge labeled book (resp. publisher) can link a collection of books
with a title of a book (resp. a title of a book with a publisher name); Zis an initial nonterminal
symbol; Pis constituted of four production rules (p1,p2,p3and p4) which allow to extract
books and publishers from the data graph TD; and Ais a set of additional specifications of
the rules where <PAis a partial order on P(e.g. the order p2< p3means that the rule
p3is applied only if the rule p2cannot be applied successfully). For instance, a chain linking
the vertices labeled successively by c, b1and p1means that there is a book entitled b1from
the collection of books cpublished in the publisher p1.
Flesca et al. [35] are also specialized the POcNRGG grammar to extract data from XML
graphs. In this application, they used the same graph grammar as above but in this case there
is a little difference in the components TDand TGwhere TDrepresents data in the form of
XML graph such that each one of its vertices has a set of attributes and an associate value; TG
corresponds to the type of directed simple graph with labeled vertices and edges where each
vertex is as the vertices of TD, and dotted edges (resp. solid edges) denote attributes (resp.
elements), and the labels of solid edges are written inside <> e.g. < book > and < writer >.
Fotso et al. [34] adopted the concept of attributed programmed graph grammars (AP GG)
of Bunke [9], which generates undirected simple graphs with labeled vertices and edges and
21
manipulates data in the form of graphs, for generating the diversity in a products family
(Furniture, Low part, A door, A drawer). In this application, the used graph grammar is
AP GG = (TD, TG, Z, P, A) where TDrepresents the manipulated graphs which are repre-
sented using the basic product (the Box) and its primitive modules (Drawer box drawer brake
and Drawer box standard slide);TGcorresponds to the type of undirected simple graph with
labeled vertices and edges such that the vertices correspond to the modules (components of
the basic product), the edges represent the interconnections (interfaces) between these mod-
ules, and the attributes of the vertices correspond to the parameters of modules; Zis the
initial graph of the basic product (Box); and a control chart CAexpresses a sequence for
the execution of a set of productions; the application of the production rules Prelating to the
control chart for changing the initial graph describes the alternatives of the products family.
The models of the desired alternatives correspond to the resulting graphs. The language of
this grammar, which describes the space of design of the products family, is composed of all
these graphs.
3.1.3 Graph grammars which manipulate data in the form of patterns
A pattern is viewed as being composed of simple subpatterns which are themselves may
be built from yet simpler subpatterns. Generally, a pattern is used to designate a model, a
structure, a form, etc. In our case, we consider a special case of patterns which corresponds to
“geometrical structures” that can be triangles, rectangles, squares, octagons, or a combination
of them, etc. There exist graph grammars which involve and manipulate data in the form of
this kind of patterns in the purpose of essentially modeling or generating them. Hence their
classification as graph grammars that manipulate data in the form of patterns. These graph
grammars are interesting and involved in some applications such as recognition of textured
symbol, automated generation of UML package diagrams, etc. In this part, we present some
of these graph grammars followed by a description of their main applications.
3.1.3.1 Graph grammar for package diagrams (GGPD)
The graph grammar for package diagrams (GGP D) is proposed by Goto et al. [39] to generate
package diagram of UM L (Unified Modeling Language which is a notation to model object
oriented system development using diagrams). According to the syntax and notation of UML,
this kind of graph grammar contains necessarily 17 production rules split into three types:
Type 1, Type 2, and Type 3. Productions of Type 1 (resp. Type 2) allow to generate tree
structures in a longitudinal direction (resp. transverse direction), and productions of Type 3
substitute a nonterminal vertex for a terminal vertex. This type of graph grammars, which
is context free, involves and manipulates data in the form of patterns and generates directed
simple graphs with labeled vertices. Initially Goto et al. [39] defined GGP D as a couple of
the form (Z, P ) over Σ. Following the Definition 2.3 which includes the other components
TD,TGand Awe define GGP D as follows.
Definition 3.8. The graph grammar for package diagrams, for UML package diagrams,
is a quintuple GGP D = (TD, TG, Z, P, A) where TDrepresents data in the form of
patterns, TG= (V, E S
D, lV) corresponds to the type of directed simple graph with la-
beled vertices over Σ = {S, A, T , L, R, M, rop, sp, lep, rip, mip, lec, mic, ric}and ΣT=
{rop, sp, lep, rip, mip, lec, mic, ric}, where rop is a root of a package, sp (resp. lep,rip) is
a single (resp. left side, right side) package, lec (resp. ric) is a left side (resp. right side)
class, mip (resp. mic) is a middle package (resp. class) located between lep and rip (resp.
lec and ric), Z={S}is an initial non-terminal, and P={p1, ..., p17}is the set of seventeen
production rules, and Ais the connection relation.
22
Now, we present a part of an example, given by Goto et al. [39], which illustrates how
GGPD is used to generate package hierarchy diagrams.
Example 3.4. We consider package hierarchy diagrams which represent data in the form of
pattern, as given in Figure 10.
rop
lep rip
Figure 10: Data in the form of pattern.
A simple GGPD which can manipulate this data can be defined as GGP D =
(TD, TG, Z, P, A) where TDrepresents the pattern given in Figure 10, TG= (V, ES
D, lV)
corresponds to the type of directed simple graph with labeled vertices over Σ, with Σ =
{S, A, T, L, P, rop, lep, rip}where rop is a root of the package, lep is a single left side
package, rip is a single right side package, Z={S}is an initial non terminal vertex,
P={p1, p3, p6, p8, p12}is a set of production rules used among the seventeen rules [39]
where:
P1= ,
SA
,P3= ,
A
,
rop
T
P6= ,
T
,
LR
P8= ,
L
,
lep
P12= ,
R
rip
and A={A6, A8, A12}is a set of connection rules such that A6= (p6, c6=
{(rop, L),(rop, R)}), A8= (p8, c8={(rop, lep)}), and A12 = (p12, c12 ={(rop, rip)}). Thus,
after successive application of p1,p3,p6,p8, and p12, we obtain the data of Figure 10.
Main results: Motivated by drawing graphical representations with an automatic man-
ner, Goto et al. [39] proposed a framework which uses GGP D to generate automatically
(UML) package diagrams. Moreover, they developed a syntax-directed diagram editor in java
which can generate/analize diagrams according to the grammar. However, this editor needs
a human intervention for checking syntax of diagrams and it is not able to recognize whether
or not a diagram is conform from an arbitrary input.
23
3.1.3.2 Attributed context-sensitive graph grammar (ACSGG)
anchez and Llad´os [72] defined the concept of attributed context-sensitive graph grammar
(ACSGG) for modeling and recognizing textured symbols in a graphics recognition frame-
work, especially in architectural plans. They considered that there are different types of
textured symbols which can appear in graphical documents and this according to the number
of used dimensions and the number of shapes involved in a given graphical document. Thus,
this kind of graph grammars involves and manipulates data in the form of patterns and gen-
erates/recognizes undirected simple graphs with labeled vertices and edges. Initially S´anchez
and Llad´os [72] defined ACSGG as a couple of the form (Z, P ) over (Σ, Γ). By taking into
consideration of the other components TD, TGand Aas given in Definition 2.3, we define
ACSGG as follows.
Definition 3.9. An attributed context-sensitive graph grammar is a quintuple ACSGG =
(TD, TG, Z, P, A) where TDrepresents data in the form of patterns, TG= (V, ES
ND, lV, lE)
corresponds to the type of undirected simple graph with labeled vertices and edges over (Σ,
Γ), Zis a set of initial graphs, usually consisting on one vertex with a non-terminal label,
P={p1, ..., pn}is a finite set of graph productions or rewriting rules with pi= (hli, hri)
where hliis the left hand graph and hriis the right hand graph, and A={A1, ..., An}is a
set of additional properties such that for each i∈ {1, ..., n},Ai={pi,Ei, A
i}associates to
pian embedding transformation Ei={(n, n) : nVhli, nVhri}and a set of attribute
transferring functions A
ifor edges and vertices in hri, where Vhli(resp. Vhri) corresponds to
the set of vertices of the left hand side (resp. right hand side) of the production pi.
Main results: anchez and Llad´os [72] proposed a procedure which consists to auto-
matically deduce ACSGG from a given textured symbol. Such procedure can be applied
to modelize bidimensional and one dimensional textured symbols. The main used idea is
to transform a given graphical document composed of regions having different shapes into a
Region Adjacency Graph (RAG) where a vertex is associated to each region, and two ver-
tices are adjacent in RAG if and only if the corresponding regions are adjacent (they have a
common edge in their neighborhoods) in the graphical document.
3.1.3.3 Applications
In this subsection, we present some applications of graph grammars in practice by adopting
them to the proposed formalism where the manipulated data in this case are in the form
of patterns. Goto et al. [39] used the graph grammar for package diagrams to generate
the membership notation of UML package diagrams. In this application, the used graph
grammar is GGP D = (TD, TG, Z, P, A) where TDrepresents data in the form of patterns
which are of number three in this case: a rectangle attached with another small rectangle
at the upper left corner that corresponds to a package, a square with three compartments
which represents a class, and a plus sign in a circle that is used to represent the compo-
nents the package contains ;TGcorresponds to the type of directed simple graph with la-
beled vertices where the vertices represent the classes and packages and the labeled vertices
Σ = {S, A, T, L, R, M, rop, sp, lep, rip, mip, lec, mic, ric}indicate their names; Z={S}is an
initial non-terminal vertex; Pis the set of seventeen production rules which allow to generate
package hierarchy diagrams; and Ais the connection relation which represents the edges es-
tablished between the rest graph and the new added package. After application of production
rules on the package diagram editor which is developed in java, the corresponding derivation
tree (directed simple graph with labeled vertices) will be generated where each vertex label
indicates the name of production that is applied. In addition to package diagrams, the pro-
posed method is also able to generate/analyze class diagrams.
24
anchez and Llad´os [72] used the attributed context-sensitive graph grammar for modeling
and recognizing textured symbols in a graphics recognition framework. In this setting, for the
recognition of textured symbols in graphical documents, they involved the graph grammar
ACSGG = (TD, TG, Z, P, A) where TDrepresents the manipulated patterns of a graphical
document which are in this case: triangle, rectangle, square, octagon, etc.; TGcorresponds to
the type of undirected simple graph with labeled vertices and edges where a vertex is associ-
ated to each pattern and two vertices are adjacent in the graph if and only if the corresponding
patterns are adjacent in the graphical document; Zis an initial non-terminal vertex; Pis a
set of productions which are based on the neighboring relations of the patterns forming a
textured symbol; and A={A1, ..., An}is a set of additional specifications of the rules where
for each i∈ {1, ..., n}, Ai={pi,Ei, A
i}associates to pia set of attribute transferring func-
tions A
iwhere each relation, that is a segment connecting the centroids of two neighboring
patterns, contains as attributes its angle, its length and the angle between it and the next
relation of a neighboring pattern, and an embedding mechanism Eiwhich is a set of edges
(i.e. relations) added between the rest graph and the new subgraph.
3.2 Unstructured data
In this subsection, we present one class of graph grammars that manipulates an unstructured
single data that is alphabets.
3.2.1 Graph grammars which manipulate data in the form of alphabets
There exist various (context-free) graph grammars which manipulate data in the form of al-
phabets that have been introduced in the literature in order to essentially develop a theory
similar to that of string languages. These graph grammars have a common property con-
cerning their production rules where the left hand side of each rule is constituted of only one
element (vertex or edge) labeled by a nonterminal symbol. Since these graph grammars are
based on the replacement of nodes and/or edges, the associated production rules only make
sense with these alphabets used as labels on vertices and/or edges. Hence their classification
as grammars that manipulate data in the form of alphabets. Such graph grammars are im-
portant due to their simplicity and the fact of having a sufficient expressive power to generate
various interesting graph languages. In this part, we present and describe some of these graph
grammars.
3.2.1.1 Context free graph grammar (CFGG)
The context-free graph grammars (CFGGs) have been defined by Pratt [69] and Pavlidis [67]
and further investigated and studied by Vigna and Ghezzi [17], Engelfriet [23], and Lobo
et al. [60]. CFGGs are graph rewriting systems in which every production is applicable
to replace either a vertex or an (hyper)edge by a given graph. In other words, in C F GGs
there is a possibility to choose between vertex replacement and (hyper)edge replacement.
Furthermore, CFGGs are of interest because they are able to describe and generate graphs
with recursive properties. This kind of graph grammars involves and manipulates data in
the form of alphabets and generates directed simple graphs with labeled vertices and edges.
Initially Pratt [69] (see also Engelfriet [23]) defined C F GG as a triple of the form (Z, P, A)
over (Σ, Γ). By taking into consideration of the other components TDand TGas given in
Definition 2.3, we define CF GG as follows.
Definition 3.10. Acontext free graph grammar is a quintuple C F GG = (TD, TG, Z, P, A),
where TDrepresents data in the form of alphabets, TG= (V, E S
D, lV, lE) corresponds to the
25
type of directed simple graph with labeled vertices and arcs over (Σ, Γ), Zis an initial
nonterminal which can be a vertex or an edge, P={p1, ..., pn}is a finite set of rules of the
form (X, H I
O) (resp. (X, H)) in the case of vertex (resp. edge) replacement where Xis the
left hand side with only one vertex (resp. edge), His the right hand side of type TG, and I /O
is the input/output vertex, and A={A1, ..., An}is a set of additional specifications of the
rules such that for each i∈ {1, ..., n},Ai={pi,Ei}associates to pian embedding mechanism
Eithat is defined according to the type of replaced element (vertex or edge). This means
that when a vertex (resp. an edge) Xof a graph Gis replaced, the corresponding embedding
mechanism which links G\Xwith HI
O(resp. H) is defined as follows:
In the case of vertex replacement, arcs leading into the vertex Xare replaced by arcs
leading to I, arcs exiting from Xare replaced by arcs exiting from O, and any loop arcs
on Xare replaced by arcs from Oto I;
In the case of edge replacement, Xis an edge having a source sand a target tand H
is a graph which is also equipped with a source sand a target t. Thus the embedding
in this case consists of identifying (gluing) swith sand twith t.
Now, we present an example which illustrates how CF GG in the case of vertex replacement
can be applied to generate patterns or decorations of faience (frieze).
Example 3.5. We consider a set of alphabets S={X, I , O, a, b, c, e1, e2, e3, e4}.CF GG
that can manipulate this type of data to generate a pattern or a decoration of faience frieze
is defined as GG = (TD, TG, Z, P, A) where
TDrepresents the data constituted of the alphabets of the set S;
TG= (V, E S
D, lV, lE) corresponds to the type of directed simple graph with labeled
vertices and edges over Σ = {X, I , O, a, b, c}and ΓT={e1, e2, e3, e4};
Z=Xis the initial non terminal vertex;
p={p1, p2}is the set of production rules given as follows:
X
p1 = ,,
X
X
p2 =
,
a
b
c
e1e2
e3
e4
a
I, O
I, O
Note that in these production rules the input vertex and the output vertex are the same.
and A={A1, A2}is the additional specifications of the rules such that A1= (p1,E1=
{(c, a),(a, b)}), and A2= (p2,E2={(c, a),(a, b)}).
Thus, the directed graph Ggenerated by this graph grammar after successive application of
p1and finally p2to the vertex Xis given in Figure 11(a). A pattern or a decoration of faience
frieze which corresponds to the generated graph is given in Figure 11(b).
26
a
b
c
a
...
I, O
e1e2
e3
e4
b
c
a
I, O
e1e2
e3
e4
b
c
a
I, O
e1e2
e3
e4
a
b
c
a
I, O
e1e2
e3
e4
(a) The generated graph G. (b) An associated pattern of faience frieze.
Figure 11: Context free graph grammar which generates a pattern of faience frieze.
Note that we can generate other patterns or decorations by modifying the production
rules. For example, if we substitute the first production p1by the production p
1given in
Figure 12(a), we obtain the graph of Figure 12(b) which corresponds to a pattern of faience
given in Figure 12(c).
p =,
X
X
a
c
I, O
e1
e2
e3
(a) The production
rule p
1.
...
c
I, O
e1e2
e3
a a
I, O
c
e1e2
e3
a
I, O
c
e1e2
e3
a a
I, O
c
e1e2
e3
a
I, O
(b) The generated graph G. (c) An associated pattern of
faience.
Figure 12: Context free graph grammar which generates a pattern of faience.
Main results: Pratt [69] used C F GGs with vertex replacement to construct new kind of
grammars called pair graph grammars P rGGs which will be presented in Subsection 4.1.1.2.
Moreover, Pavlidis [67] gave some results related to topological characterizations of sets of
graphs which can be generated by CF GG. In particular, he proved that the set of all planar
(resp. outerplanar) graphs cannot (resp. can) be generated by a C F GG. Furthermore,
Vigna and Ghezzi [17] extended known results from string to graph grammars to develop and
study a theory of C F GGs. In this setting, they showed formal properties of these grammars
especially for graph language recognizability, and they also developed some parsing algorithms
and evaluated their computational complexity. On the other hand, according to Engelfriet
[23] there exist divers types of CF GGs which depend on the type of replaced items (edges
or vertices), the type of graphs considered (directed or undirected), and the manner that the
graphs are linked to each other. Lobo et al. [60] compared the expression power of string
regulated graph grammar with the traditional CF GG in the case of edge replacement. In
this sense, they showed that the set of graph languages generated by CFGGs is included in
the set of graph languages generated by string regulated graph grammars.
3.2.1.2 (Directed) Node label controlled graph grammar (DNLCGG/NLCGG)
The concept of node label controlled graph grammars (NLCGGs) is introduced by Janssens and
Rozenberg [50] and further investigated by several authors such as Janssens and Rozenberg
[51, 48], Courcelle [14], etc. In this kind of graph grammars, every production is applicable to
27
replace a single node (vertex) by a given graph, and the connections between a daughter graph
(right-hand side of a production) and the neighbors of the replaced vertex are established
according to the labels of the involved vertices. NLCGGs involve and manipulate data in the
form of total alphabet and generate undirected simple graphs with labeled vertices. Initially
Janssens and Rozenberg [50, 51] defined NLCGG as a triple of the form (Z, P, A) over Σ.
By including the other components TDand TGas in Definition 2.3, we define NLCGG as
follows.
Definition 3.11. Anode label controlled graph grammar is a system N LCGG =
(TD, TG, Z, P, A) where TDrepresents data in the form of total alphabet, TG= (V , ES
ND, lV)
corresponds to the type of undirected simple graph with labeled vertices over Σ, Zis a graph
over ΣNcalled the axiom consisting of a single nonterminal vertex, P={p1, ..., pn}is a finite
set of pairs called the set of productions with pi= (di, Di) such that diis a vertex labeled
by diΣNand DiGΣ, (GΣis a set of graphs over Σ), and Ais a subset of Σ ×Σ called
the connection relation.
The directed node-label controlled graph grammars (DNLCGGs)are introduced by
Janssens and Rozenberg [46] as a generalization of NLCGGs, which are introduced by the
same authors in [50], to directed N LC GGs (N LC GGs generating directed graphs). The
DN LCGGs correspond to the particular case of 1DNCEGGs [27] in which the labels of
nodes (vertices) are the only criterion on which we base to decide which daughter vertices
(vertices of the right-hand side of a production) should be connected to the neighbors of the
mother (neighbors of the replaced vertex). Initially Engelfriet et al. [27] defined 1DN CEGG
as a couple of the form (Z, P ) over Σ. By involving the other components TD, TGand Aas
in Definition 2.3, we define 1DNCEGG as follows.
Definition 3.12. Adirected graph grammar with neighborhood-controlled embedding and
singleton left-hand sides is a system 1DNCEGG = (TD, TG, Z, P, A), where TDis as for
NLCGG,TG= (V, E S
D, lV) corresponds to the type of directed simple graph with labeled
vertices over Σ, ZΣNis an initial nonterminal, P={p1, ..., pn}is a finite set of produc-
tions with pi= (xi, Di) where xiis a vertex labeled by xiΣN(called the left-hand side
of pi), DiGRΣ(called the right-hand side of pi, where GRΣis the set of all graphs over
Σ=ΣNΣT), and A={A1, ..., An}is the set of additional properties such that for each
i∈ {1, ..., n},Ai={pi, Bi}associates to pithe embedding relation Bi={Bini, Bouti}, where
Biniand Boutiare subsets of VDi×Σ with VDiis the set of vertices of Di.
In 1DN CE grammars, for every production pi, i ∈ {1, ..., n}it corresponds embedding
relations Biniand Bouti. However, in DNLCGGs (which are a special case of 1DNCEGGs)
all productions refer to the same embedding relations Bin and Bout, which are called con-
nection relations denoted in this case by Cin and Cout respectively. Initially Engelfriet et al.
[27] defined DN LCGG as a triple of the form (Z, P, A) over Σ. Following the Definition 2.3
which includes the components TDand TG, we define DNLCGG as follows.
Definition 3.13. Adirected node-label controlled graph grammar is a system DN LCGG =
(TD, TG, Z, P, A), where TD,Z, and Pare as for N LCGGs,TGis as for 1DN CEGGs, and
A={Cin, Cout }is a set constituted of two subsets Cin and Cout of Σ ×Σ which represent
connection relations.
Main results: Janssens and Rozenberg [50] introduced a mathematical tool to describe
the structure of NLC languages, called H(n)
β,α construct which is composed of n1 copies of
a graph H\αtogether with one copy of Hsuch that edges between the vertices of different
28
copies are added according to the set of edges of β. Furthermore, Janssens and Rozenberg
[51] studied restrictions, extensions, and variations of components of NLC GG and compared
the corresponding generated classes of languages with those of usual N LC GGs. Moreover,
Janssens and Rozenberg [48] proved the decidability status of problems related to NLCGGs
by using some basic techniques. These problems are related to properties of graphs in a given
graph language such as planarity, connectivity, etc. Courcelle [14] introduced an abstract
notion of context-free grammar and gave results related to context-free NLC set of graphs
and extended them to the classes of boundary NLC (BNLCGG) and neighborhood-uniform
NLC (NUNLCGG). Brijder and Blockeel [8] gave an approach to induce NLCGGs for the
case of a set of disjoint and isomorphic subgraphs of a given graph.
On the other hand, Janssens and Rozenberg [46] studied basic properties of derivations
in context-free DNLC graph grammars (C F DN LCGGs) (such grammars have a particular
restriction in which the vertices of a daughter graph can not distinguish between different
neighbors of the replaced vertex when a “daughter graph” is embedded in a “host graph”).
The main result that they obtained consists of giving a characterization of the class of context-
free string languages by means of DNLCGGs. In fact, they showed that the class of string
languages defined by CF D NLC GGs grammars (by mean of the chain representation) is the
same to the class of context-free languages. Thus, via this result the relation between string
and graph languages is well defined and illustrated.
Moreover, Engelfriet et al. [27] introduced Apex DNLC graph grammar abbreviated
ADN LCGG which is a subclass of DNLCGG where the connection relations attach ter-
minal vertices only. They also studied the attribute dependency graph grammar (ADGG),
(which is an attribute grammar that determines a set of dependency graphs), and they
proved that ADGG is included in A-1DNCEGG (and hence in DNLCGG) but not in-
cluded in A-DN LCGG. Furthermore, Engelfriet et al. [27] proposed new types of graph
grammars namely the R(DN LC GG) and the R(A-DNLCGG) by extending DNLCGGs
with a relabeling of terminal symbols, here Rstands for “relabeling”. Thus they showed that
A-1DN CEGG R(A-DN LC GG) which implies that ADGG R(A-DNLCGG). They
also proved that R(A-DNLC) and DNLC are incomparable classes of graph languages. Fur-
thermore, they obtained the characterization of R(A-DNLC) as the smallest class of graph
languages containing ADG and then the smallest class containing REGT (the class of regular
tree languages) since this latter is a proper subclass of ADG. Note that Engelfriet and Leih
[26] established other results on apex grammars by giving relations with (linear) eNCEGGS
(graph grammars with neighbourhood controlled embedding and dynamic edge relabeling).
More details on these latter grammars will be given in Subsection 3.2.1.3.
3.2.1.3 Neighborhood controlled embedding graph grammar (NCEGG)
The neighborhood controlled embedding graph grammar (NCEGG) is introduced by Janssens
and Rozenberg [49] as a generalization of the NLCGG which is presented in the section above.
The difference between NCEGG and NLCGG resides in the components that are involved in
the embedding process. In NLCGGs only the labels of the vertices are concerned whereas
in NCEGGs both labels and vertices are used. This kind of graph grammars involves and
manipulates data in the form of total alphabet and generates undirected graphs with labeled
vertices. Initially Janssens and Rozenberg [49] defined NCEGG as a couple of the form
(Z, P ) over Σ. By taking into consideration of the other components TD, TGand Aas given
in Definition 2.3, we define NCEGG as follows.
Definition 3.14. Aneighborhood-controlled embedding graph grammar is a system
NCEGG = (TD, TG, Z, P, A), where TD,TG,Z, and Pare as for N LC GG, and A=
{A1, ..., An}is a set of additional properties such that for each i∈ {1, ..., n},Ai={pi,Ei}
29
associates to pian embedding function Eifrom Vαi×Vβi×Σ into {0,1}. When a production
rule pi0= (αi0, βi0) is applied to a given graph H, the embedding function Ei0specifies which
vertices of βi0can be connected to vertices of H− •αi0that are neighboors of the vertex αi0
in H.
By considering the edge labels in addition to the vertex labels, Engelfriet et al. [28] defined
an extension of NCEGGs called graph grammar with neighborhood controlled embedding and
dynamic edge relabeling (eNCEGGs). Initially Engelfriet et al. [28] defined eN C EGG as a
couple of the form (Z, P ) over (Σ,Γ). By including the other components TD, TGand Aas
in Definition 2.3, we define eNCEGG as follows.
Definition 3.15. A graph grammar with neighborhood controlled embedding and dynamic
edge relabeling is a quintuple eNCEGG = (TD, TG, Z, P, A) where TDand Pare as for NCE
graph grammar, TG= (V, ES
ND, lV, lE) corresponds to the type of undirected simple graph
with labeled vertices and edges over (Σ,Γ), ZΣNis an initial nonterminal vertex, and
A={A1, ..., An}is a set of additional properties such that for each i∈ {1, ..., n},Ai={pi,Ei}
associates to pia connection relation Ei.
Kim and Ando [56] defined an extension of eNCEGG called node replacement graph
grammar with dynamic node relabeling (neNCEGG). These graph grammars generate directed
simple graphs with labeled vertices and edges and manipulate data in the form of total
alphabet. Note that the only difference in the application of the productions of neNCEGG
and eNCEGG is in the dynamic node relabeling, i.e. In each derivation step of neNCEGG the
vertices and edges are both labeled and modified dynamically contrary to eNCEGG where
only edges are relabeled.
Main results: Janssens and Rozenberg [49] considered a classification of embedding
mechanisms of Rosenfeld and Milgram [70], for (vertex-rewriting) graph grammars, and they
compared the generative power of different types of graph grammars (1-NCE grammar,
(X, Y ) grammar) by proving some results related to the class of graph languages generated
by these graph grammars. Furthermore, Engelfriet and Leih [26] proved that nonterminal
(resp. derivation) bounded apex eNCEGGs can (resp. cannot always) be simulated by linear
apex eN CEGGs. They also proved that apex eNCEGGs (if only terminal vertices may be
connected in the embedding process) and linear eN CEGGs have not the same generative
power. Moreover, Engelfriet et al. [28] studied the eNCEGG and showed some results
related to boundary eN CE (B-eN C E) grammars and languages. In this setting, they proved
that the class of (boundary) eN CE languages properly contains the closure of the class
of (boundary) N LC languages under vertex relabelings. They also proved similar results
for linear eNCEGGs. On the other hand, Glikson and Makowsky [37] proved that all the
generated graphs by any given NCEGG have bonded clique width. Recently, Kim and Ando
[56] analyzed basic language-theoretical properties of the neN CE system, and proved some
hierarchical relations among the neNCE families of graph languages such as equivalence,
proper inclusion and incompatibility.
3.2.1.4 Node-replacement graph grammar with path-controlled embedding
(nPCEGG)
The concept of node-replacement graph grammar with path-controlled embedding (nPCEGG)
is introduced by Aizawa and Nakamura [2]. The main property of this graph grammar is that
it uses a sequence (path) of edges instead of a single edge to embed a newly replaced graph
into the rest graph. nP C EGG manipulates data in the form of total alphabet and generates
undirected simple graphs with labeled vertices and edges. This graph grammar is able to
30
generate rectangular grids. Initially Aizawa and Nakamura [2] defined nP CE GG as a couple
of the form (Z, P ) over (Σ, Γ). Following the Definition 2.3 which includes the components
TD, TGand A, we define nP CE GG as follows.
Definition 3.16. Anode-replacement graph grammar with path-controlled embedding is a
quintuple nP CE GG = (TD, TG, Z, P, A) where TDrepresents data in the form of total al-
phabet, TG= (V, ES
ND, lV, lE) corresponds to the type of undirected simple graph with la-
beled vertices and edges over (Σ, Γ), Zis a connected graph over (Σ,Γ) called the axiom,
P={p1, ..., pn}is a finite set of productions of the form pi= (αi, βi), where αiis a vertex
labeled by αiΣN,βiis a connected graph over (Σ, Γ) of type TG, and A={A1, ..., An}is
a set of additional properties such that for each i∈ {1, ..., n},Ai={pi,Ei}associates to pi
an embedding function Eiwhich is a set of edges added between βiand every vertex vof the
rest graph if there exists a path between vand the replaced vertex labeled αi.
Main results: Aizawa and Nakamura [2] mainely proved under some stipulations that
there exists a class of nP C EGGs which generates a class of graph languages that is con-
sidered as the class of context-free array languages. To obtain this equality of classes they
characterized a class of nP CE GGs which generate the set of all 2D rectangular grids by
means of partial path groups. Furthermore, as prospect they envisaged the possibility of
constructing and characterizing nP CE GGs which generate various two-dimensional patterns
such as triangular array, pentagonal array, etc. On the other hand, Aizawa and Nakamura
[3] proposed a path controlled embedding graph grammar (P CE GG) with a confluent prop-
erty in which the order of applying productions does not influence the derived graph. They
extended this grammar to a parallel case in which all vertices are rewritten in parallel within
a direct derivation step, and they compared their generative powers with that of context-free
array grammars.
3.2.1.5 Neighborhood controlled embedding with edge-labeled and directed
graph grammar (edNCEGG)
The concept of neighbourhood controlled embedding with edge-labeled and directed graph gram-
mar (edNCEGG) is introduced by Engelfriet et al. [28] and further investigated by Engelfriet
and Rozenberg [29], Courcelle et al. [15], etc. This kind of graph grammar, which is an
extension of the eNCE graph grammar, involves and manipulates data in the form of total
alphabet and generates directed simple graphs with labeled vertices and edges. Initially En-
gelfriet and Rozenberg [29] defined edNCEGG as a couple of the form (Z, P ) over (Σ,Γ). By
involving the other components TD, TGand Aas in Definition 2.3, we define edNCEGG as
follows.
Definition 3.17. Aneighbourhood controlled embedding with edge-labeled and directed graph
grammar is a system edNC EGG = (TD, TG, Z, P, A), where TDand Zare as for eN CEGG,
TG= (V, E S
D, lV, lE) corresponds to the type of directed simple graph with labeled vertices
and edges over (Σ, Γ), P={p1, ..., pn}is a finite set of productions, and A={A1, ..., An}is
a set of additional properties such that for each i∈ {1, ..., n},Ai={pi,Ei}associates to pia
connection relation Ei.
Courcelle et al. [15] restricted edNCEGG to context-free (confluent) graph grammar with
neighborhood controlled embedding and dynamic edge relabeling (C-edN CEGG) in which the
application of productions is order independent. C-edNCEGG, which is also called node
replacement graph grammar (N RGG), is investigated by several authors such as Engelfriet
[23], Flesca et al. [36], etc. NRGG involves and manipulates data in the form of a set of
alphabets and generates labeled directed (or undirected) graphs. Initially Flesca et al. [36]
31
defined NRGG as a couple of the form (Z, P ) over (Σ,Γ). Following the Definition 2.3 which
includes the components TD,TGand A, we define NRGG as follows.
Definition 3.18. Anode replacement graph grammar is a quintuple NRGG =
(TD, TG, Z, P, A) where TDrepresents data in the form of a set of alphabets, TG=
(V, E S, lV, lE) corresponds to the type of simple graph with labeled vertices and edges over
,Γ) where EScan be directed simple (ES
D) or undirected simple (ES
ND), ZΣNis an
initial nonterminal symbol, and P={p1, ..., pn}is a finite set of productions of the form
pi= (Xi, Di) where Xiis a vertex labeled by XiΣNand Diis a graph called the right
hand side of the production, and A={A1, ..., An}is a set of additional properties such that
for each i∈ {1, ..., n},Ai={pi,Ei}associates to pian embedding mechanism Ei.
Now, we present a very simple example which illustrates how NRGG can be applied to
generate a pattern of house.
Example 3.6. We consider a set of alphabets S=
{X, Y, a, b, c, d, f, g, h, i, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11}.NRGG that can manipu-
late this type of data to generate a pattern of house is defined as NRGG = (TD, TG, Z, P, A)
where
TDrepresents the data constituted of the alphabets of the set S;
TG= (V, E S
ND, lV, lE) corresponds to the type of undirected simple graph
with labeled vertices and edges over Σ = {X, Y , a, b, c, d, f, g, h, i}and ΓT=
{e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11 };
Z=Xis the initial non terminal vertex;
P={p1, p2}is the set of production rules given as follows:
P1= ,
X
,P2= ,
Y
e10 e11
a
b
df
Y
e3
e4
e6
e2
e1
e5c
e7
e8e9
ghi
and A={A1, A2}is the additional specifications of the rules such that A1= (p1,E1=),
and A2= (p2,E2={[d, g],[f, h],[c, i]}).
Thus, the undirected graph Ggenerated by this graph grammar after application of p1then
p2is given in Figure 13(a). A pattern of a house which corresponds to the generated graph is
given in Figure 13(b). Note that this graph grammar generates only a pattern of house (its
shape) and not the details of the image of Figure 13(b).
32
e8e9
e7
a
b
df
e3
e4
e6
e2
e1
e5c
e10 e11
ghi
(a) The generated graph G. (b) An associated pattern of house [77].
Figure 13: Node replacement graph grammar which generates a pattern of house.
Mains results: Engelfriet and Rozenberg [29] are mainly compared the generative power
of the boundary edN C EGGs and the context-free hypergraph grammars. Courcelle et al.
[15] showed that separated handle-rewriting hypergraph grammars abbreviated S-HHGG
(grammars in which nonterminal handles or subhypergraphs do not overlap) have the same
graph generating power as C-edNCEGGs. On the other hand, Flesca et al. [36] restricted
node replacement context free graph grammars of Engelfriet [23] for introducing parsing graph
grammars which extract subgraphs from a data graph.
4 Graph grammars which manipulate multiple data types
In this section, we study graph grammars which manipulate a multiple data type which can
be constituted from structured and/or unstructured data.
4.1 Hybrid data (structured and/or unstructured data)
In this subsection, we present two classes of graph grammars that manipulate a hybrid data
where the first class manipulates 2 types of data and the second class manipulates at least 3
types of data.
4.1.1 Graph grammars which manipulate 2 types of data
There exist graph grammars which involve and manipulate 2 types of data such as: words
and alphabets, words and symbols, alphabets and symbols, etc. These graph grammars are
useful and are involved in some interesting applications such as: recognition of expressions,
transformation of string languages to graph languages, specification of the structure of object-
oriented programs, etc. In this part, we present some of these graph grammars followed by a
description of their main applications.
4.1.1.1 Tree-adjoining graph grammar (TAGG)
The tree-adjoining graph grammar (TAGG), which is a tree generating system, is introduced
first by Joshi et al. [54] (see also Joshi [53]) and further investigated by Joshi and Schabes
[55]. The original definition of this grammar, called tree adjunct grammar (tag) in Joshi et
al. [54], did not include substitution as a combining operation. However, the addition of such
substitution does not affect the formal properties of TAGGs. This kind of graph grammar
33
which is motivated by linguistic and formal nature involves and manipulates data in the form
of words and symbols and generates undirected simple graphs with labeled vertices having
forms of trees. Initially Joshi and Schabes [55] defined T AGG as a couple of the form (Z, P )
over Σ. By taking into consideration of the other components TD,TGand Aas given in
Definition 2.3, we define T AGG as follows.
Definition 4.1. Atree-adjoining graph grammar is a quintuple T AGG = (TD, TG, Z, P, A)
where TDrepresents data in the form of words and alphabets, TG= (V, ES
ND, lV) corresponds
to the type of undirected simple graph with labeled vertices over Σ, Zis a distinguished
non-terminal symbol, and P=PIi PAi is a set of elementary trees where
PIi is a finite set of finite trees, called initial trees, characterized by
Xinterior vertices which are labeled by non-terminal symbols,
Xthe vertices on the frontier of initial trees are labeled by terminals or non-terminals.
Non-terminal symbols on the frontier of the trees in PIi are marked for substitution, by
convention, the vertices to be substituted are annotated with a down arrow (),
PAi is a finite set of finite trees, called auxiliary trees, characterized by
Xinterior vertices which are labeled by non-terminal symbols,
Xthe vertices on the frontier of auxiliary trees are labeled by terminals or non-terminals
symbols. Non-terminal symbols on the frontier of the trees in PAi are marked for
substitution except for one vertex called the foot vertex. By convention, the foot vertex
is annotated with an asterisk (), the label of the foot vertex must be identical to the
label of the root vertex,
and Ais the adjunction and substitution operations. An adjunction operation consists of
adjoining an auxiliary tree βto any tree αat vertex v, it is given as follows:
The sub-tree of αdominated by v, denoted t, is excised, leaving a copy of vbehind;
The auxiliary tree βis attached at the copy of vand its root vertex is identified with
the copy of v;
The sub-tree tis attached to the foot vertex of βand the root vertex of t(i.e. v) is
identified with the foot vertex of β.
A substitution operation takes only place on non-terminal vertices marked by a down arrow
() of the frontier of a tree. When a substitution occurs on a vertex v, the vertex is replaced
by the tree to be substituted. When a vertex is marked for substitution, only trees derived
from initial trees can be substituted for it.
Following the same lines as in Joshi and Schabes [55], we give a simple example which
illustrates how T AGG is used in the linguistic field to construct semantically correct sentences
by manipulating a combination of alphabets and words.
Example 4.1. We consider a set of alphabets and words W=
{articles, steadly, the, publish, researchers, good, S, S, S, D, Adj, Adv, N, Adj , N P
0, V P, V, N P
1}.
T AGG that can manipulate this type of data to build a derivation tree which yields the sen-
tence: the good researchers steadily publish articles is defined as T AGG = (TD, TG, Z, P, A)
where
TDrepresents the data constituted of the symbols and words of the set W,
34
TG= (V, E S
ND, lV) corresponds to the type of undirected simple graph with labeled
vertices over Σ = W,
Zis a vertex labeled by S,
P={pA1, pI1, pI2, pI3, pI4, pI5}is the set of elementary trees given in Figure 14,
S
S* good
pA1 =,
D
the
pI1 =,NP0
Adj N
reseachers
pI2 =,S
NP0
VP
pI3 =,
V
publish
NP1
NP1
N
articles
pI5 =
Adj
S'
Adv
steadily
pI4 =
Adv ,
Figure 14: A set of elementary trees
and A={adj1, sub1, sub2, sub3, sub4}is constituted of one adjunction operation adj1
and four substitution operations sub1, sub2, sub3and sub4.
Thus, the steps of derivation, which build a derivation tree that yields the sentence: the good
researchers steadily publish articles, are given in Figure 15.
pI1
pI3
S
NP0
pI5 =S
pA1
D
the
pI2
Adj N
reseachers
N
, adj1, sub1
, sub2, sub3
articles
VP
V
publish
NP1
S'
Adv
VP
V
publish
NP1
S'
Adv
S
NP0
S
D
the
VP
V
publish
NP1
S'
Adv
S
NP0
Adj N
reseachers
S
D
the
VP
V
publish
NP1
S'
Adv
S
NP0
good
pI4 , sub4
Adj N
reseachers
S
D
the
VP
V
publish
NP1
S'
Adv
S
NP0
good
N
articles
Adj N
reseachers
S
D
the
VP
V
publish
NP1
S'
Adv
S
NP0
good steadily
Figure 15: Steps of derivation
Note that the order in which the elementary trees are applied does not change the resulting
derived tree.
Main results: Joshi et al. [54] investigated the tree adjunct grammar and defined two
important subclasses of it namely simple tag and linear tag, where a tree is simple if its depth
is equal to 1, ignoring the branches between terminal and preterminal vertices, and a tree is
linear if at any depth there is at most one nonterminal (a preterminal contains only a single
son terminal vertex). On the other hand, Joshi and Schabes [55] summarized some of the
well known properties of TAGG’s string languages and tree sets, and for illustration some
examples are given. Moreover, they proved how T AGG arises in the processes of lexicalizing
context-free graph grammars (i.e. a grammar is lexicalized if it consists of a finite set of
structures with an operation or operations for composing these structures such that each
structure is associated with a lexical item called anchor).
35
4.1.1.2 Pair graph grammar (PrGG)
The concept of pair graph grammar (PrGG) which is defined by Pratt [69] is constructed
at base of a particular form of context free graph grammar presented in Subsection 3.2.1.1.
P rGG is constituted of a pair of grammars over the same set of alphabets, such that there
exists a correspondence between the rules of these two grammars and between nonterminal
vertices in the rules with the condition that the nonterminal values of the corresponding
vertices are the same. Pratt [69] has applied this kind of graph grammar to translate strings
into graphs (translation of an Algol-like language from strings into flowcharts). P rGG involves
and manipulates data in the form of combination of symbols and words (strings) and generates
directed multiple graphs with labeled vertices and edges. Initially Pratt [69] defined P rGG
as a couple of the form (Z, P ) over (Σ,Γ). By involving the other components TD, TGand
Aas in Definition 2.3, we define P rGG as follows.
Definition 4.2. Apair graph grammar is a quintuple P rGG = (TD, TG, Z, P, A), where
TDrepresents data in the form of combination of symbols and words (strings), TG=
(V, E M
D, lV, lE) corresponds to the type of directed multiple graph with labeled vertices and
edges over (Σ,Γ), ZΣNis an initial nonterminal, A={A1, ..., An}is a set of additional
specifications of the rules such that for each i∈ {1, ..., n},Ai={pi,Ei}associates to pian em-
bedding mechanism Eias in context free graph grammar in the case of vertex replacement (see
Definition 3.10), and P={p1, ..., pn}is a finite set of productions of the form pi= (li, ri, hi),
where
liand riare graph grammar rules defined as in Definition 3.10, these rules are called
respectively left rule and right rule;
if liis the rule (Ai, G(i)I
O) and riis the rule (A
i, H(i)J
R), then Ai=A
i;
hiis a nonterminal vertex pairing of G(i) and H(i) which is a function defined from
NNT
G(i)to NNT
H(i)such that nNNT
G(i), VG(i)(n) = VH(i)(hi(n)), where NN T
G(i)(resp. NNT
H(i))
is the set of nonterminal vertices of G(i) (resp. H(i)) and VG(i)(resp. VH(i)) is the
vertex value function of G(i) (resp. H(i)).
Main results: Pratt [69] proved that P rGG is a useful mean which allows to perform
translations from strings to graphs by using formal grammars and standard concepts of parsing
and generation. For illustration, he gave some examples to show that P rGGs are powerful
to define interesting translations from program strings into graphs. Moreover, he shortly
considered the use of P rGGs for defining translation from graph to graph.
4.1.1.3 (Adaptive) star graph grammar (ASGG)
Adaptive star graph grammar (ASGG) introduced by Drewes et al. [19] (see also Drewes et al.
[18]) is a generalization of hyperedge and node replacement graph grammar formalisms while
keeping some properties of rule application such as parseability, commutativity, and associa-
tivity. The derivation principle of this grammar is that each rule substitutes a nonterminal
vertex together with its outgoing edges (a star) with another graph which is glued using a
cloning operation to the vertices pointed to by the outgoing edges of the substituted vertex.
ASGG involves particular concepts namely multiple vertex and cloning operation where:
XAmultiple vertex is a vertex that may be replicated, and it represents any number of
ordinary vertices called clones. Graphically, a multiple vertex is drawn like a set of
vertices in progress, with a shadow and dashed lines;
36
XAcloning operation is used to replicate in a graph Ga multiple vertex vtogether with
its incident edges any number of times (including 0). Thus, G[vm
k] is the graph to be
obtained by replacing in Gthe vertex vwith mmultiple and ksingular clones (m+k
copies of v).
This cloning makes ASGGs more powerful than context free graph grammars since when
their rules are applied, may adapt to potentially several contexts. ASGG is involved in some
interesting applications that need mechanisms to model and describe the structure of object-
oriented programs. This graph grammar generates directed multiple graphs with labeled
vertices and edges and manipulates data in the form of symbols and words. Initially Drewes
et al. [18] defined ASGG as a couple of the form (Z , P ) over (Σ,Γ). By including the other
components TD, TGand Aas in Definition 2.3, we define ASGG as follows.
Definition 4.3. Adaptive star graph grammar is a quintuple ASGG = (TD, TG, Z, P, A)
where TDrepresents data in the form of symbols and words, TG= (V, EM
D, lV, lE) corresponds
to the type of directed multiple graph with labeled vertices and edges over (Σ, Γ), Zis an
initial star, P={p1, ..., pn}is a finite set of star rules over (Σ, Γ), and Ais a set of additional
properties of the rules called cloning operations.
Main results: Drewes et al. [19] (see also Hoffmann [43]) introduced some notational
enhancements and application conditions to adaptive star grammars and they showed that
these latter can be used to define static models of object-oriented programs in a more natural
way than by meta-modeling. On the other hand, Drewes et al. [18] explored the generative
power of ASGGs and related them to context-free ways of rewriting. In this setting, they
obtained that uniform adaptive star replacement (uASR) is more powerful than both node
replacement-like adaptive star replacement (NR-ASR) and star replacement (SR), because
it can generate the language of all graphs, that cannot be generated by context-free in the
case of vertex replacement (see also [24]). They also showed that the ASR languages are
included in decidable graph languages (DEC). Thus the following inclusions (equalities) are
obtained (SR =H R)(N R-ASR =B-edN C E)uASR ASR DEC RE where
RE is the class of recursively enumerable graph languages. However, it is still open whether
the inclusions uASR ASR DEC are proper or not.
4.1.1.4 Probabilistic context free 2D-graph grammar (PCF2DGG)
Celik and Yanikoglu [12] defined the probabilistic context free 2D-graph grammar (PCF2DGG)
which they have used to drive the expression recognition system for finding mathematically
valid interpretations and affecting probabilities to each possible interpretation of the expres-
sion. This kind of graph grammar involves and manipulates data in the form of alphabets
and symbols and generates/recognizes undirected simple graphs with labeled vertices. Ini-
tially Celik and Yanikoglu [12] defined P CF 2DGG as a couple of the form (Z, P ) over Σ.
By including the other components TD, TGand Aas given in Definition 2.3, we define
P C F 2DGG as follows.
Definition 4.4. Aprobabilistic context-free 2D-graph grammar is a quintuple P C F 2DGG =
(TD, TG, Z, P, A) where TDrepresents data in the form of alphabets and symbols, TG=
(V, E S
ND, lV) corresponds to the type of undirected simple graph with labeled vertices over Σ,
Zis a start graph, P={p1, p2, ..., pn}is a set of productions of the form pi= (gil , gir) where
gil is the pattern graph, gir is the product graph, and A={A1, ..., An}is a set of additional
properties such that for each i∈ {1, ..., n},Ai={pi, ci}associates to pian applicability
predicate ci:gim → {T RU E, F ALS E}where gim is a graph matched with gil (the left hand
side of the rule pi). The applicability predicate ciis a set of constraints or conditions on
37
attribute values of vertices and/or edges, and non-existence of certain edges, to satisfy, in
order to apply the grammar rule.
It is noteworthy to mention that in PCF2DGG there is no embedding rule because all
rules follow the same embedding. Thus, contrary to the normal case where an application of
a graph grammar rule pi= (gil, gir ) consists of substituting the left hand side gil by the right
hand side gir, in this type of grammar when applying pito a graph Gthe right hand side gir
is added as a new vertex to the graph Gand gil is kept as it is.
Now, we present an example, given by Celik and Yanikoglu [12], which illustrates how
P C F 2DGG is used to recognize mathematical expressions.
Example 4.2. We consider a set of alphabets and symbols W={a, n, +,|,2, b}.P CF 2DGG
that can manipulate this type of data to recognize the mathematical expression a2+bis defined
as P C F 2DGG = (TD, TG, Z, P, A) where
TDrepresents the data constituted of the symbols and alphabets of the set W,
TG= (V, E S
ND, lV) corresponds to the type of undirected simple graph with labeled
vertices over Σ = W,
Zis an initial graph that is constituted of 4 vertices a, 2, +, b,
P={p1, p2}is a set of production rules given in Figure 16,
P1= ,P2= ,
+a | an,
n
Figure 16: A set of production rules
and Ai ={pi, ci},ci:gim → {T RU E, F ALS E}.
Thus, the steps of parsing, to recognize the mathematical expression a2+b, are given in
Figure 17.
a
2
+ b
input
1st round
2nd round
a2 a + b
a2 + b
Figure 17: Steps of derivation
38
Main results: Celik and Yanikoglu [12] developed a flexible and optimal system for
mathematical expression recognition using a P C F 2DGG and a parse algorithm. The main
idea of this algorithm is to apply P C F 2DGG’s rules to the current graph, by adding a
new vertex and its edges in each iteration, until there is no valid production left, where
the new added vertices or tokens represent possible interpretations of neighboring tokens.
Moreover, they gave experimental results by testing their system on a part of the mathematical
expression database collected in association with the Master’s thesis of Celik [11].
4.1.1.5 Applications
In this part, we present some applications of graph grammars in practice by adopting them
to the proposed formalism where 2 types of data are manipulated.
Motivated by linguistic considerations, Joshi and Schabes [55] investigated the tree-
adjoining graph grammar to construct semantically correct sentences. In this application,
they used the graph grammar T AGG = (TD, TG, Z, P, A) where TDrepresents data in the
form of combination of words and alphabets;TGcorresponds to the type of undirected simple
graph with labeled vertices where a label of a vertex represents a word/symbol or its nature
(e.g. adverb, noun, verb, etc.); Z={S}is a distinguished non-terminal symbol; Pis a set of
elementary trees that are composed of initial and auxiliary trees; and Ais the adjunction and
substitution operations that are used with the elementary trees to construct the derivation
tree which forms a correct sentence. See Example 4.1 for illustration.
Pratt [69] used the pair graph grammar for translation between string and graph rep-
resentations of data. In this framework, for the translation of an Algol-like language from
strings into flowcharts, they used the graph grammar P rGG = (TD, TG, Z, P, A) where TD
represents data in the form of combination of symbols and words (strings) which correspond
to Algol like language;TGcorresponds to the type of directed multiple graph with labeled
vertices and edges where a vertex is represented by an oval (resp. rectangle) if its value is
a non-terminal (resp. terminal) symbol, an edge is represented by an arrow which can be
labeled by Tor Fthat are respectively true or false, and an input (resp. output) vertex of the
right side graph of a rule is presented by I(resp. O) outside of the vertex; Z={program}
is an initial nonterminal; Pis a set of pair rules where each rule in the form of a string has
it equivalent in the form of graph; and A={A1, ..., An}is a set of specifications of the rules
where for each i∈ {1, ..., n},Ai={pi,Ei}associates to pian embedding mechanism Eithat
is edges added between the rest graph and the right hand side of pito generate a graph
corresponding to strings. Moreover, Drewes et al. [19] applied adaptive star graph grammars
for specifying the structure of object-oriented programs. In this setting, for generating a pro-
gram graph, they used the graph grammar ASGG = (TD, TG, Z, P, A) where TDrepresents
data in the form of symbols and words which represent a program graph;TGcorresponds to
the type of directed multiple graph with labeled vertices and edges where the vertex labels
correspond to program entities, the solid edges (resp. dotted edges with a predefined label in
the middle) represent a composition of entities (resp. references of entities to declarations),
the solid edges with a predefined label in the middle classify the visibility of declarations; Z
is an initial star of the grammar that is the nonterminal P rg together with an anchor vertex
which represents the root Any of the class hierarchy; Pis a finite set of star rules where
nonterminal vertices are connected to their border vertices by edges of different label and
direction; and Ais a set of additional properties of the rules called cloning operations used
to glue between the rest graph and the right hand side of a rule. Motivated by purely math-
ematical aspects, Celik and Yanikoglu [12] applied the probabilistic context free 2-D graph
grammar to deal with the mathematical expression recognition problem. In this framework,
for the recognition of a mathematical expression of type an+bm, they used the graph gram-
39
mar P C F 2DGG = (TD, TG, Z, P, A) where TDrepresents data in the form of alphabets and
symbols which are involved in the mathematical expression an+bm;TGcorresponds to the
type of undirected simple graph with labeled vertices where the vertices represent tokens that
are: a,n, +, b,m,an,a+b,an+b,a+bm,an+bm;Zis an initial graph composed of
five tokens which are: a,n, +, b,m;P={p1, p2}is constituted of two productions used to
add new tokens in each round until there is no production left; and A={A1, ..., An}is a set
of specifications of the rules where for each i∈ {1, ..., n},Ai={pi, ci}associates to pian
applicability predicate ciwhich is an essential part to decide which rule to be applied.
4.1.2 Graph grammars which manipulate at least 3 types of data
There exist graph grammars which involve and manipulate at least 3 types of data such as:
total alphabets and/or patterns and/or images; graphs and/or patterns and/or images; total
alphabets and/or graphs and/or patterns and/or images etc. These graph grammars are useful
and are involved in some interesting applications such as: development of biological organisms,
bidirectional transformations, specification of a lift control system, etc. In this part, we
present some of these graph grammars followed by a description of their main applications.
4.1.2.1 (Hyper)edge replacement graph grammar (HRGG/ERGG)
The main approach of graph and hypergraph rewriting is Hyperedge replacement which is
introduced by Feder [33] and Pavlidis [67] (under other names which are respectively n
attaching-point entity (NAPE), and mth order structure), and further investigated by several
authors such as Engelfriet et al. [25], Engelfriet [23], Drewes et al. [21], etc. Hyperedge re-
placement graph grammars (HRGGs)represent a logical extension of edge replacement graph
grammars (ERGGs) in which the elements hypergraphs are constituted of hyperedges that
can link any number of vertices. In ERGG when an edge in a given graph is substituted
by a new subgraph, the latter is glued to the rest graph through the vertices of the replaced
edge. This type of graph grammars is studied and applied in different fields. In this setting,
ERGG, that is a particular case of context free graph grammars, is used to generate string
graph languages where the manipulated data in this case are in the form of total alphabet.
Furthermore, HRGGs, which generate directed/undirected hypergraphs with labeled edges,
are involved in some interesting applications such as the development of biological organisms
where the manipulated data in this case are images that represent cells, and the generation of
semi-structured control-flow diagrams where the manipulated data in this case are patterns,
etc. Initially Engelfriet [23] (see also Drewes et al. [20]) defined HRGG as a couple of the
form (Z, P ) over Γ. By involving the other components TD, TGand Aas in Definition 2.3,
we define such graph grammar as follows.
Definition 4.5. Ahyperedge replacement graph grammar is a quintuple HRGG =
(TD, TG, Z, P, A) where TDrepresents data in the form of total alphabet and/or images and/or
patterns, etc., TG= (V, E H
D/EH
ND, lE) corresponds to the type of directed/undirected hyper-
graph with labeled edges over Γ, P={p1, ..., pn}is a finite set of productions, ZΓNis
the initial nonterminal, and A={A1, ..., An}is a set of additional properties such that for
each i∈ {1, ..., n}, Ai={pi, Ci}associates to pia reconnection mapping Ciwhich is used
to reconnect the right hand side (hypergraph) of piwith a host hypergraph, obtained after
removing the left hand side (hyperedge) of this production, for producing derived hypergraph.
Now, we present a simple example which illustrates how the edge replacement graph
grammar (ERGG) is used for modeling a set of animal cells of the small intestine.
40
Example 4.3. We consider a set of animal cells which represent a data in the form of image,
as given in Figure 18.
...
(a) Set of animal cells of the small
intestine.
...
ee e e
(b) Association edges-cells.
Figure 18: Data in the form of image.
To model the set of animal cells of Figure 18(a) by ERGG, we associate to each cell
an edge eas given in Figure 18(b). Note that two edges are adjacent if and only if the
corresponding cells are adjacent. A simple ERGG which can manipulate this data can be
defined as GG = (TD, TG, Z, P, A) where TDrepresents the image given in Figure 18(a),
TG= (V, E S
ND, lE) corresponds to the type of undirected simple graph with labeled edges
over Γ, with Γ = {S, e},Z={S}is the edge which corresponds to the initial cell, Pconsists
of the two following rules:
,
p1=
e
p2=
,
S
S
,
e
S
ebegin ebegin
eend eend
and Ais the reconnection mapping where in each derivation two steps are successively
done:
the edge Sis removed from its adjacent edge e= (ebegin, eend) where eend is the vertex
which links eand S,
the right hand side (RH) of one of the productions p1and p2is added to the rest graph
by fusing ebegin of RH with eend of the rest graph.
Thus, the undirected graph generated by this grammar is given as follows:
a a a
...
a
Main results: Engelfriet et al. [25] proved that in general context free graph languages
and in particular hyperedge replacement graph languages of bounded degree are generated
by apex graph grammars. Furthermore, Engelfriet [23] gave some examples of HRGG and
showed results related to this grammar by using concepts of derivation, equivalence, etc. In
fact, he proved that for every HRGG it can be constructed an equivalent HRGG such that
each right hand side of a production has at most two edges. He also gave a comparison
between HRGG and NRGG in terms of graph generating power. Moreover, Kreowski et al.
[57] introduced the notion of fusion grammars for the generation of hyper(graph) languages.
This grammar has the property that its fusion rules can be applied to generate connected
hypergraphs. They showed that their grammars are more powerful than hyperedge replace-
ment grammars. On the other hand, Drewes et al. [21] in their survey deal with the theory
41
of hyperedge replacement and in particular they discussed some similitude between struc-
tural results of HRGGs and languages and properties of context-free string grammars and
languages. Recently, Drewes et al. [20] proposed a predictive shift-reduce parsing algorithm
for a subclass of hyperedge replacement grammars, which generalizes the concepts of SLR(1)
string parsing to graphs where SLR(1) is a simple parser for context free grammars that reads
the input from left to right and produces a right derivation.
4.1.2.2 Triple graph grammar (TGG)
Triple graph grammars (TGG) have been introduced first by Sch¨urr [73] as an improvement of
the old idea of pair graph grammars which previously proposed by Pratt [69]. TGG which is
defined to specify bidirectional translations between various graph languages is characterized
by a set of special rules where for each rule its right hand side (RHS SRCRTR) and its left
hand side (LHS SLCLTL) are composed by three domains: the source model domain (SR/SL),
the correspondence model domain (CR/CL), and the target model domain (TR/TL). Each
rule consists of making a correspondence between SR(resp CRand TR) and SL(resp. CL
and TL), and moreover it is equipped with an attribute formula expressing valid attribute
value assignments for attributes in the LHS and RHS of the rule. TGG is investigated and
applied in different fields. In this framework, the formalism of TGG was devised to gener-
ate and transform pairs of related graphs under a well-formed synchronization mechanism
which would preserve the relations in the pair after applying a transformation where the
manipulated data are graphs. Moreover, it has been used for high-level graph-based mod-
eling and specification tool for problems involving related diagrams where the manipulated
data are patterns. Besides, it has been applied for the specification of bidirectional model
transformations (e.g. a model transformation from a variant of UML statecharts to Petri nets
using application conditions) where the manipulated data are patterns and/or images, etc.
This kind of graph grammars involves and manipulates several types of data such as patterns
and/or images and/or graphs, etc. and generates directed simple graphs with labeled vertices
and edges. Recently, Giese et al. [38] applied this type of graph grammar for the translation
of block diagrams into class diagrams where the manipulated data are patterns that represent
in this case diagrams. Initially Giese et al. [38] defined T GG as a couple of the form (Z, P )
over (Σ,Γ). Following the Definition 2.3 which includes the components TD,TG, and Awe
define T GG as follows.
Definition 4.6. Atriple graph grammar is a quintuple T GG = (TD, TG, Z, P, A) where TD
represents data in the form of patterns and/or images and/or graphs, etc., TG= (V, E S
D, lV, lE)
corresponds to the type of directed simple graph with labeled vertices and edges over (Σ,
Γ), Zis an axiom, P={p1, ..., pn}is a set of non-deleting rules for triple graphs, and
A={A1, A2, ..., An}is a set of additional specifications of the rules such that for each
i∈ {1, ..., n},Ai={pi, Ati}associates to pian attribute formula Ati, where pican be
applied to a triple graph SGCGTGif there exists an injective morphism of its LHS SLCLTL
into SGCGTGand the corresponding attribute values are valid assignments according to Ati.
Main results: Hildebrandt et al. [42] in their survey gave a quantitative and qualitative
comparison of three TGG tools (MoTE, TGG Interpreter, eMoflon) by using and developing a
set of criteria (Usability, Expressiveness, Formal Properties). On the other hand, Giese et al.
[38] described and explained how to pass from the relational TGG description to an efficient
transformation satisfying one of these three model transformation directions (forward which
takes a source model as input and creates the correspondence and target model, backward
transformation which takes target model as input and creates the correspondence and source
model, correspondence transformation which requires a source and target model and creates
42
only the correspondence model). Furthermore, they have developed an implementation of
TGGs, based on Eclipse and the Eclipse Modeling Framework, which allows to create TGG
rules.
4.1.2.3 Graph grammar with (positive, negative) application conditions (GGA)
Ehrig and Habel [22] introduced a simple notion of application conditions for graph gram-
mars productions so that it can be possible to apply such graph grammars in the design of
the systems in all kinds of application areas. Furthermore, Habel et al. [41] have further
investigated this notion and they have considered that the application conditions can be pos-
itive or negative. This consideration is a restriction of the one given by Ehrig and Habel [22].
GGA can be used for the design of the system in all kind of application areas thanks to its
application conditions for different production rules. Thus, it can manipulate all the data
types, and it generates directed multiple graphs with labeled vertices. An application of the
graph grammar with only negative application conditions is realized by Habel et al. [41] in
the specification of a lift control system where the manipulated data in this case are images
that represent floors and lift. Initially Habel et al. [41] defined GGA as a couple of the form
(Z, P ) over (Σ, Γ). By involving the other components TD, TGand Aas in Definition 2.3,
we define GGA as follows.
Definition 4.7. Agraph grammar with (positive, negative) application conditions is a quin-
tuple GGA = (TD, TG, Z, P, A) where TDrepresents all the data types such as images and/or
patterns and/or alphabets and/or graphs, etc., TG= (V , EM
D, lV, lE) corresponds to the type of
directed multiple graph with labeled vertices over Σ, Zis a start graph over Σ, P={p1, ..., pn}
is a finite set of graph productions, and A={A1, ..., An}is a set of additional properties such
that for each i∈ {1, ..., n},Ai= (ai, pi) associates the (positive, negative) application condi-
tion aito the rule pi. Moreover, it is assumed that the start graph Zand all left-hand sides
of productions are not completely terminally labeled.
Now, we present a part of an example given by Habel et al. [41] to illustrate how the
GGA is used to specify a lift control system.
Example 4.4. We consider the data in the form of image given in Figure 19.
Figure 19: Data in the form of image [76].
A simple GGA which can manipulate this data can be defined as GGA = (TD, TG, Z, P, A)
where TDrepresents the image given in Figure 19, TG= (V, EM
D, lV) corresponds to the type
of directed multiple graph with labeled vertices over Σ, with Σ = {f loor, lift, up, req}where
up vertex indicates the general direction, and req corresponds to the user request. The move
43
arcs specify the atomic movement of the lift. Zis the start graph that corresponds to the
initial state of the system, it is given in Figure 20.
floor
floor
floor
floor
up lift
Figure 20: The initial state of the system.
Pis a set of production rules which are request productions, lift control productions,
and a move production, but in this case we give only 3 productions (one from lift control
productions, another from request productions, and the third is the move production). They
are given in Figure 21
floor
floor
floor
floor
up lift
req
req move
floor
floor
up lift
move
initiate move
P1=
,floor
req create up-req
up
P2=floor
req
up
floor
floor
floor
req
move
move
P3=
req
up
lift
floor
floor
lift
Figure 21: A set of production rules.
The steps of derivation to move from the 1st floor to the 4th floor are given in Figure 22.
floor
floor
floor
floor
up lift
move
floor
floor
floor
floor
up lift
P2, P1
floor
floor
floor
floor
up
lift
P3
ZG1 G2
P2: create up-req (to 4th floor)
P1: initiate move
P3: move
Figure 22: The steps of derivation.
44
Main results: By introducing the very general notion of application conditions, Ehrig
and Habel [22] proved that context free graph grammars with concrete context conditions
(CFGGA) are equivalent to context sensitive graph grammars without application condi-
tions. Besides, they showed a chain of inclusions and an equality of languages given as
follows: L(CF GG)L(C F GGA)L(GG) = L(GGA), where L(GGA) is the class of lan-
guages generated by graph grammars with application conditions. On the other hand, Habel
et al. [41] defined positive and negative application conditions and compared them with
those of Ehrig and Habel [22]. Furthermore, they proved some results related to application
conditions by using some concepts like production, derivation, morphism, etc. In fact, they
showed that each positive application condition of a production can be expressed directly
by its context enlargement, so productions with positive and negative application conditions
can be transformed to productions with only negative ones using context enlargement (i.e.
production where the positive application conditions are expressed directly in its right hand
side). Moreover, Habel et al. [41] showed that context free graph grammars with negative and
positive application conditions are more powerful than ordinary context-free graph-grammars
(i.e. graph grammars where each rule contains only a single non terminal in its left hand
side).
4.1.2.4 Applications
In the field of biology, inspired by the development of biological organisms, Lobo et al. [60]
proposed a formalism based on an edge-replacement graph grammar which illustrates three
fundamental aspects of biological development, namely: cell division, genetic regulation, and
expression state inheritance by new cells. In this formalism, the used graph grammar is
ERGG = (TD, TG, Z, P, A) where TDrepresents the manipulated images which are in this
case “animal cells”; TGcorresponds to the type of undirected simple graph with labeled
edges which represents an organism where the edges correspond to the cells, with each edge
in the graph is labeled with a set of symbols (string) where every symbol indicates the rule of
the grammar to be applied, and the connectivity between cells as vertices, i.e. two cells are
connected if the edges representing them contain a common vertex; Zis the Zygote or axiom in
the grammar that is a start graph which contains a single edge that connects two vertices; Pis
a set of graph grammar rules which represent the different forms of implementing cell division;
and A={A1, ..., An}is a set of additional properties such that for each i∈ {1, ..., n}, Ai=
{pi, Ci}associates to pia reconnection mapping Ci, in which the string label (without the first
symbol, which indicates the applied rule) of the substituted edge is copied to the new edges
after application of a grammar rule. These added edges are fused to the rest graph through
the vertices of the replaced edge. Thus, a graph derivation by this graph grammar corresponds
to the developmental process of an organism. Recently, Mamuye et al. [65] defined an RNA
graph grammar, basing on the double pushout approach, for modeling the Ribonucleic acid
(RNA) folding. In this formalism, the used graph grammar is GGRNA = (TD, TG, Z, P, A)
where TDrepresents the manipulated patterns which are in this case “the four nucleotides ”;
TGcorresponds to the type of undirected simple graph with labeled vertices which represents
an RNA secondary structure where the vertices correspond to the nucleotides, with each vertex
in the graph is labeled with A,C,G, or U, and the edges is the set of bonds, both backbone
and base-pair interactions; Zis the primary structure or start graph in the grammar that is
composed of four different nucleotides; Pis a set of graph grammar rules which are used to
build the set of all secondary structures that can be derived from the grammar starting from
a primary structure; and A={A1, ..., An}is a set of additional properties of the rules called
gluing conditions which in this case correspond to respecting the base-pairs constraints (i.e.
base-pairing is possible only with G-C, A-U and G-U pairs). An other application, based
45
on double pushout graph transformation, for modeling chemical reactions is found in [5].
Moreover, Giese et al. [38] applied triple graph grammars for a model transformation from
SDL (Specification and Description Language) block diagrams [44] to UML class diagrams.
In this application, the used graph grammar is T GG = (TD, TG, Z, P, A) where TDrepresents
data in the form of patterns which are in this case: boxes with one or two compartments such
that each box can be a block diagram, a class diagram, a system block, a class, a block, or
an association;TGcorresponds to the type of directed simple graph with labeled vertices
and edges where the vertices correspond to elements that are block diagram, system block,
blocks, class diagram, classes, etc., and the edges represent links between the elements of a
same meta model or different meta models, and the labels of edges correspond to symbols that
indicate which rule is applied; Zis the start graph (BlockDiagram to ClassDiagram); Pis the
set of rules which create elements in the meta models simultaneously; and A={A1, ..., An}
is a set of specifications of the rules where for each i∈ {1, ..., n}, Ai={pi, Ati}associates
to pian attribute formula Atie.g. the attribute formula At1:sb1.name == cl1.name
derived from p1specifies that system block and class must have equal names. On the other
hand, Habel et al. [41] used graph grammars with negative application conditions GGA for
the specification of a lift control system. This system is represented by a graph grammar
GGA = (TD, TG, Z, P, A) where TDrepresents the manipulated images which are in this case
the floors and lift;TGcorresponds to the type of directed multiple graph with labeled vertices
where the floors and lift are represented by labeled vertices and its current position by an
unlabeled arc from the lift vertex to a floor vertex: arcs from every floor vertex to all upper
floor vertices correspond to the ordering of floors, a vertex labeled up or down indicates the
general direction and move arcs specify the atomic movement of the lift, a request vertex with
an arc to the corresponding floor corresponds to the user request; the start graph Z, which
is the initial state of the system, is composed of four floors where the lift is in the ground
floor, the general direction is “up” and there are no user requests; Pis a set of three types of
productions which are request productions, lift control productions, and a move production;
and Ais a set of application conditions which are used for example to limit the order of
application (priorities), and ensure that an initiate move can create only one move edge at a
time between two given floor vertices, etc.
5 Recapitulative of the studied graph grammars
In this section, we first take-up the organigram of Figure 2 by classifying each studied graph
grammar in its class, then we exhibit a tabular that specifies some features of the investigated
graph grammars according to some criteria.
46
WG
Graph grammars
Manipulating a
single data type
Graphs Patterns At least 3 types of data
PGG
cNRGG
POcNRGG
CFGG
(D)-NLCGG
NCEGG
edNCEGG
NRGG
nPCEGG
GGPD
ACSGG
TAGG
ASGG
PCF2DGG
PrGG
GGA
HRGG/ERGG
TGG
APGG
Figure 23: Classification of graph grammars according to the type of input and manipulated
data
47
Classification
hhhhhhhhhh
h
Graph grammars
Criteria Type of input and
manipulated data
(un)directed
S/M/H
graph
With
labeled
ver-
tices
With
labeled
edges
Applications
Manipulating a single data type
Structured data
Graph grammars
which manipulate
data in the form
of images
WG, Pfaltz and Rozenfeld
[68]
Images represent-
ing handprinted
letters, chromo-
somes etc.
ES
DYes No Picture processing
Graph grammars
which manipulate
data in the form
of graphs
PGG, Flesca et al. [36] A data graph
representing
information
ES
D/ES
ND Yes Yes Extraction of graph
queries from a data graph
cNRGG, Flesca et al. [35] A data graph
representing
information
ES
D/ES
ND Yes Yes Extraction of graph
queries from a data graph
POcNRGG, Flesca et al.
[35]
A data graph rep-
resenting a collec-
tion of books
ES
D/ES
ND Yes Yes Extraction of books and
publishers from a collec-
tion of books
APGG, Bunke [9, 10] Graphs are rep-
resented using
objects e.g. Box,
Drawer box
drawer brake
and Drawer box
standard slide
ES
ND Yes Yes Modeling products fami-
lies
Graph grammars
which manipulate
data in the form
of patterns
GGPD, Goto et al. [39] Patterns repre-
senting packages
and classes
ES
DYes No Generation of the mem-
bership notation of UML
package diagrams
ACSGG, S´anchez and
Llad´os [72]
Patterns of
a graphical
document repre-
senting triangle,
rectangle, etc.
ES
ND Yes Yes Recognition of textured
symbols in graphical doc-
uments
Unstructured data
Graph grammars
which manipulate
data in the form
of alphabets
CFGG, Pratt [69], Pavlidis
[67]
Total alphabet ES
DYes Yes Generation of graphs with
recursive properties
(D)-NLCGG, Janssens and
Rozenberg [50]
Total alphabet (ES
D)
ES
ND
Yes No Generation of graph lan-
guages
NCEGG, Janssens and
Rozenberg [49]
Total alphabet ES
ND Yes No Generation of graph lan-
guages
edNCEGG, Engelfriet et al.
[28]
Total alphabet ES
DYes Yes Generation of graph lan-
guages
nPCEGG, Aizawa and
Nakamura [2]
Total alphabet ES
ND Yes Yes Generation of graph lan-
guages, generation of rect-
angular grids
NRGG, Courcelle et al. [15] Total alphabet ES
D/ES
ND Yes Yes Generation of graphs with
recursive properties
Manipulating multiple data types
Hybrid data (structured and/or not structured data)
Graph grammars
which manipulate
2 types of data
TAGG, Joshi et al. [54],
Joshi [53]
Words and alpha-
bets
ES
ND Yes No Construction of correct
sentences
PrGG, Pratt [69] Symbols and
words represent-
ing Algol like
language
EM
DYes Yes Translation of an Algol-
like language from strings
into flowcharts
ASGG, Drewes et al. [19],
Drewes et al. [18]
Symbols and
words represent-
ing a program
graph
EM
DYes Yes Specification of the struc-
ture of object-oriented
programs
PCF2DGG, Celik and
Yanikoglu [12]
Alphabets and
symbols repre-
senting mathe-
matical expres-
sions
ES
ND Yes No Recognition of mathemati-
cal expressions
Graph grammars
which manipulate
at least 3 types
of data
HRGG/ERGG, Feder [33],
Pavlidis [67]
Images and/or
Total alphabets
and/or Patterns,
etc.
EH
D/EH
ND /
ES
D
No Yes Development of biological
organism; Generation of
string graph languages;
Generation of semi-
structured control flow
diagrams
TGG, Sch¨urr [73] Images and/or
Graphs and/or
Patterns, etc.
ES
DYes Yes Specification of bidirec-
tional and incremental
model transformations;
Transformation of pairs of
related graphs; Modeling
and specification tool for
problems involving related
diagrams; etc.
GGA, Ehrig and Habel [22] All the data types EM
DYes No Specification of a lift con-
trol system; Design of sys-
tems in all kinds of appli-
cation areas
Table 1: Comparative table of graph grammars classification with some criteria
48
Concluding remarks: As we can see from Table 1, we deduce that all the studied graph
grammars use labels for vertices except HRGG/ERGG, contrary to the labeling of edges which
is not predominantly used in the same way. Furthermore, even if all the graph grammars
which manipulate data in the form of graphs use labels both for the vertices and edges,
they can generate directed simple or undirected simple graphs. Moreover, the applications
of the studied graph grammars are mainly related to the concepts of recognition, modeling,
transformation, parsing, and generation. Specifically, the applications of graph grammars
that manipulate data in the form of alphabets (resp. images) are related to the concept of
generation (resp. parsing). Whereas, the applications of graph grammars that manipulate
data in the form of “graphs” or “patterns” or “2 types of data” or “at least 3 types of data”
are not related only to one type of the above concepts.
6 Conclusion and discussion
During the last decades, several kinds of graph grammars have been introduced and inves-
tigated in different directions and have been applied in various fields. According to mainly
these latter, several formalisms have been used in the literature to represent and describe
graph grammars. Motivated by considerations and interests of Big Data, in this survey, we
have suggested to complete the graph grammars formalism of De la para and Dean [16] by
introducing a fifth component which takes into consideration the “type of input and ma-
nipulated data” associated to each considered graph grammar. We have classified the main
graph grammars according to this fifth component by distinguishing the power of each graph
grammar according to the number, the nature, and the kind of manipulated data and we
adopted their associated applications to this proposed formalism. From this survey, we draw
the following conclusions:
Due to the properties of graphs, graph grammars have the power to be used successfully
for studying, modeling, and solving various practical problems raised in many fields;
The added fifth component is important and relevant since every graph grammar has
its specific input and manipulated data and it is difficult to construct a graph grammar
that processes all types of data;
The proposed formalism can serve as a basis to develop an efficient parallel system that
processes Big Data which are naturally constituted of heterogenous data;
The proposed formalism can be exploited by clouds computing to address some known
issues and especially to improve the display, analysis, and storage of Big Data;
The combination of graph grammars, graph partitioning, cloud computing, and Big
Data can lead to set up parallel systems having properties that may improve the com-
putation power to enable the real time processing of the data, the access time to the
data, and insure scalability;
We have noticed that Context Free Graph Grammars in the case of vertex replacement,
which manipulate data in the form of alphabets, can be used to generate patterns or
decorations as for faiences (frieze). Moreover, Node Replacement Graph Grammars,
which manipulate data in the form of alphabets, can be used to generate patterns as
those representing houses. Furthermore, Edge Replacement Graph Grammars, which
manipulate data in the form of total alphabet and/or images and/or patterns, can be
used to model animal cells as those of the small intestine.
49
Our classification distinguishes graph grammars which manipulate single data from
those that manipulate multiple data. This last class of graph grammars, which is able to
process several data types, is probably the one that will be more studied and developed
in the next years in order to answer to one of the challenges of Big Data which concerns
the concept of heterogeneity (the second V-property).
Since a large amount of data in the form of videos can be generated from different sources
such as satellites, and sensor networks, and can be related/involved to/in several fields
of applications such as security, and astronomy, then as a perspective it would be inter-
esting to investigate the possibility of establishing graph grammars which manipulate
videos in view of a real time processing of the data.
Acknowledgements: The authors are thankful to the anonymous referees for their valuable
suggestions and comments which have helped to improve the quality of the paper and its
presentation.
References
[1] N. Abe, M. Mizumoto, J. Toyoda, K. Tanaka, Web grammars and several graphs, Journal
of Computer and System Sciences, 7, 37-65 (1973).
[2] K. Aizawa and A. Nakamura, Graph grammars with path-controlled embedding, Theo-
retical Computer Science, 88, 151-170 (1991).
[3] K. Aizawa, A. Nakamura, On relationships between graph L-Systems and picture lan-
guages: Part II. In : Lindenmayer Systems, Springer Berlin Heidelberg, 305-318 (1992).
[4] M. Andries, G. Engels, A. Habel, B. Hoffmann, H.J. Kreowski, S. Kuske, D. Plump, A.
Sch¨urr, G. Taentzer, Graph transformation for specification and programming, Science
of Computer Programming, 34, 1–54 (1999).
[5] J. L. Andersen, C. Flamm, D. Merkle, P. F. Stadler, Chemical Graph Transforma-
tion with Stereo-Information, In International Conference on Graph Transformation,
Springer, Cham, 54-69 (2017).
[6] S. Baumann, A simplified attribute graph grammar for high level music recognition, Pro-
ceedings of the Third International Conference on Document Analysis and Recognition,
2, 1080-1083 (1995).
[7] K. Born, L. Lambers, D. Str¨uber, G. Taentzer, Granularity of conflicts and dependencies
in graph transformation systems, In International Conference on Graph Transformation,
Springer, Cham, 125-141 (2017).
[8] R. Brijder, H. Blockeel, On the inference of non-confluent NLC graph grammars, Journal
of Logic and Computation, exr046 (2011).
[9] H. Bunke, Attributed programmed graph grammars and their application to schematic
diagram interpretation, IEEE Transactions on Pattern Analysis and Machine Intelli-
gence, 4, 574-582 (1982).
[10] H. Bunke, Graph grammars as a generative tool in image understanding. In : Graph-
Grammars and Their Application to Computer Science. Springer Berlin Heidelberg, 8-19
(1983).
50
[11] M. Celik, Handwritten mathematical expression recognition using graph grammars, Mas-
ter’s thesis, Sabanci University (2010).
[12] M. Celik, B. Yanikoglu, Probabilistic mathematical formula recognition using a 2D
context-free graph grammar, International Conference on Document Analysis and Recog-
nition (ICDAR), IEEE, 161-166 (2011).
[13] S.H. Chuang, M.R. Henderson, Compound feature recognition by web grammar parsing,
Research in Engineering Design, 2, 147-158 (1991).
[14] B. Courcelle, An axiomatic definition of context-free rewriting and its application to
NLC graph grammars, Theoretical Computer Science, 55, 141-181 (1987).
[15] B. Courcelle, J. Engelfriet, G. Rozenberg, Handle-rewriting hypergraph grammars, Jour-
nal of Computer and System Sciences, 46, 218-246 (1993).
[16] F. De la parra, T. Dean, Survey of graph rewriting applied to model transformations,
In: Model-Driven Engineering and Software Development (MODELSWARD), 2014 2nd
International Conference on. IEEE, 431-441 (2014).
[17] P. Della Vigna, C. Ghezzi, Context-free graph grammars, Information and Control, 37,
207-233 (1978).
[18] F. Drewes, B. Hoffmann, D. Janssens, and M. Minas. Adaptive star grammars and their
languages, Theoretical Computer Science, 411, 3090–3109 (2010).
[19] F. Drewes, B. Hoffmann, M. Minas, Adaptive star grammars for graph models, Graph
Transformations, Springer Berlin Heidelberg, 442-457 (2008).
[20] F. Drewes, B. Hoffmann, M. Minas, Predictive shift-reduce parsing for hyperedge re-
placement grammars, In International Conference on Graph Transformation, Springer,
Cham, 106-122 (2017).
[21] F. Drewes, H.J. Kreowski, A. Habel, Hyperedge replacement, graph grammars. Hand-
book of Graph Grammars, 1, 95-162 (1997).
[22] H. Ehrig, A. Habel, Graph grammars with application conditions, In G. Rozenberg, A.
Salomaa, eds., The book of L, 87-100. Springer-Verlag, Berlin, 1986.
[23] J. Engelfriet, Context-free graph grammars, in: Handbook of Formal Languages, 3:
Beyond Words, Springer, Berlin, 125–213 (1997).
[24] J. Engelfriet, Context-free graph grammars, in: G. Rozenberg, A. Salomaa (Eds.), Hand-
book of Formal Languages: Beyond Words, Springer, (Chapter 3), 3, 125-213 (1999).
[25] J. Engelfriet, L. Heyker, G. Leih. Context-free graph languages of bounded degree are
generated by apex graph grammars, Acta Informatica, 31, 341-378, 1994.
[26] J. Engelfriet, G. Leih, Linear graph grammars: power and complexity, Information and
Computation, 81, 88-121 (1989).
[27] J. Engelfriet, G. Leih, G. Rozenberg, Apex Graph Grammars and Attribute Grammars,
Acta Informatica, 25, 537-571 (1988).
51
[28] J. Engelfriet, G. Leih, E. Welzel, Boundary graph grammars with dynamic edge relabel-
ing, Journal of Computer and System Sciences, 40, 307-345 (1990).
[29] J. Engelfriet, G. Rozenberg, A comparison of boundary graph grammars and context-free
hypergraph grammars, Information and Computation, 84, 163-206 (1990).
[30] J. Engelfriet, G. Rozenberg, Node replacement graph grammars. In : Handbook of Graph
Grammars, 1–94 (1997).
[31] H. Fahmy, D. Blostein, A graph grammar programming style for recognition of music
notation, Machine Vision and Applications, 6, 83-99 (1993).
[32] H. Fahmy, D. Blostein, A survey of graph grammars: theory and applications, In :
Pattern Recognition, 1992. Vol. II. Conference B: Pattern Recognition Methodology and
Systems, Proceedings, 11th IAPR International Conference on. IEEE, 294–298 (1992).
[33] J. Feder, Plex languages, Information Sciences, 3, 225-241 (1971).
[34] B.M. Fotso, M. Dulmet, E. Bonjour, Mod´elisation par les grammaires de graphes de la
en´eration de la diversit´e dans les familles de produits, Journal Europ´een des Syst`emes
Automatis´es, 43, 103-132 (2009).
[35] S. Flesca, F. Furfaro, S. Greco, A graph grammars based framework for querying graph-
like data, Data & knowledge engineering, 59, 652–680 (2006).
[36] . S. Flesca, F. Furfaro, S. Greco, Graph grammars for querying graph-like data, Electronic
Notes in Theoretical Computer Science, 50, 247-256, (2001).
[37] A. Glikson, J.A. Makowsky, NCE graph grammars and clique-width, In Graph-theoretic
concepts in computer science, Springer Berlin Heidelberg, 237-248 (2003).
[38] H. Giese, S. Hildebrandt and L. Lambers, Bridging the gap between formal semantics and
implementation of triple graph grammars, Software & Systems Modeling, 13, 273–299
(2014).
[39] T. Goto, T. Kirishima, T. Nishino, T. Yaku, K. Tsuchida, Generation of UML package
diagrams based on an attribute graph grammar, Journal of Computational Science, 5,
606-615 (2014).
[40] A. Habel, Hyperedge replacement: grammars and languages, Springer Science & Business
Media, 643 (1992).
[41] A. Habel, R. Heckel, G. Taentzer, Graph grammars with negative application conditions,
Fundamenta Informaticae, 26, 287–313 (1996).
[42] S. Hildebrandt, L. Lambers, H. Giese, J. Rieke, J. Greenyer, W. Schafer, M. Lauder, A.
Anjorin, A. Sch¨urr, A survey of triple graph grammar tools. Electronic Communications
of the EASST, 57, 2013.
[43] B. Hoffmann, Conditional adaptive star grammars, Electronic Communications of the
EASST, 26, (2010).
[44] ITU International Telecommunication Union. ITU-T Recommendation Z.100: Specifica-
tion and Description Language (SDL) (2002).
52
[45] A. Jain, V. Bhatnagar, P. Sharma, Collaborative and clustering based strategy in big
data, Collaborative filtering using data mining and analysis, 140-158 (2017).
[46] D. Janssens, G. Rozenberg, A characterization of context-free string languages by di-
rected node-label controlled graph grammars, Acta Informatica, 16, 63-85 (1981).
[47] D. Janssens, and G. Rozenberg, A survey of NLC grammars, CAAP’83, Springer Berlin
Heidelberg, 114-128 (1983).
[48] D. Janssens, G. Rozenberg, Decision problems for node label controlled graph grammars,
Journal of Computer and System Sciences, 22, 144-177 (1981).
[49] D. Janssens, G. Rozenberg, Graph grammars with neighbourhood-controlled embedding,
Theoretical Computer Science, 21, 55-74 (1982).
[50] D. Janssens, and G. Rozenberg, On the structure of node label controlled graph lan-
guages, Information Sciences, 20, 191-216 (1980).
[51] D. Janssens, and G. Rozenberg, Restrictions, extenstions and variations of NLC gram-
mars, Information Sciences, 20, 217-244 (1980).
[52] D. Janssens, G. Rozenberg, R. Verraedt, On sequential and parallel node-rewriting graph,
Computer Graphics and Image Processing, 18, 279-304 (1982).
[53] A.K. Joshi, How much context-sensitivity is necessary for characterizing structural
descriptions-Tree adjoining grammars, In D. Dowty, L. Karttunen, and A. Zwicky, edi-
tors, Natural language processing-theoretical, computational and psychological perspec-
tives. Cambridge university press, New York Originally presented in a workshop on nat-
ural language parsing at Ohio state university, Columbus, Ohio, May 1983, (1985).
[54] A.K. Joshi, L.S. Levy, M. Takahashi, Tree adjunct grammars, Journal of computer and
system sciences, 10, 136-163 (1975).
[55] A.K. Joshi, Y. Schabes, Tree-adjoining grammars. In: Handbook of formal languages.
Springer Berlin Heidelberg, 69-123 (1997).
[56] C. Kim, M. Ando, Node replacement graph grammars with dynamic node relabeling,
Theoretical Computer Science, 583, 40–50 (2015).
[57] H. J. Kreowski, S. Kuske, A. Lye, Fusion Grammars: A Novel Approach to the Gen-
eration of Graph Languages, In International Conference on Graph Transformation,
Springer, Cham, 90-105 (2017).
[58] D. Laney, 3D data management: controlling data volume, velocity and variety, META
Group Research Note, 6, 70 (2001).
[59] J. Li, F. Tao, Y. Cheng, L. Zhao, Big Data in product lifecycle management, International
Journal of Advanced Manufacturing Technology, 81, 667–684 (2015).
[60] D. Lobo, F. Vico, J. Dassow, Graph grammars with string-regulated rewriting, Theoret-
ical Computer Science, 412, 6101-6111 (2011).
[61] R. Machado, L. Ribeiro, R. Heckel, Rule-based transformation of graph rewriting rules:
towards higher-order graph grammars, Theoretical Computer Science, 594, 1-23 (2015).
53
[62] M. Mahfoudh, Adaptation d’ontologies avec les grammaires de graphes typ´es: ´evolution
et fusion, Doctoral dissertation, Universit´e de Haute Alsace-Mulhouse (2015).
[63] U. Montanari, Separable graphs, planar graphs and web grammars, Information and
Control, 16, 243-267 (1970).
[64] M. Maximova, H. Giese, C. Krause, Probabilistic timed graph transformation systems,
In International Conference on Graph Transformation, Springer, Cham, 159-175 (2017).
[65] A. L. Mamuye, E. Merelli, L. Tesei, A Graph Grammar for Modelling RNA Folding.
arXiv preprint arXiv:1612.01639 (2016).
[66] M. Nagl, A tutorial and bibliographical survey on graph grammars. In : Graph-
Grammars and Their Application to Computer Science and Biology. Springer Berlin
Heidelberg, 70-126 (1979).
[67] T. Pavlidis, Linear and context-free graph grammars, Journal of the Association for
Computing Machinery, 19, 11-22 (1972).
[68] J. Pfaltz, A. Rosenfeld, Web grammars, Proceedings of the 1st international joint con-
ference on Artificial intelligence, 609-619 (1969).
[69] T.W. Pratt, Pair Grammars, Graph languages and string-to-graph translations, Journal
of Computer and System Sciences, 5, 560-595 (1971).
[70] A. Rosenfeld, D. Milgram, Web automata and web grammars, Machine Intelligence, 7,
307-324 (1972).
[71] G. Rozenberg, Handbook of graph grammars and computing by graph transformation,
World Scientific, 1, (1999).
[72] G. S´anchez, J. Llad´os, A graph grammar to recognize textured symbols. Sixth Inter-
national Conference on Document Analysis and Recognition (ICDAR), IEEE, 465-469
(2001).
[73] A. Sch¨urr, Specification of graph translators with triple graph grammars, In : Graph-
Theoretic Concepts in Computer Science, Springer Berlin Heidelberg, 151-163 (1995).
[74] Z. Shi, X. Zeng, T. Zhang, S. Huang, Z. Qi, H. Li, B. Hu, Y. Yao, S. Zhong, Bidirectional
transformation between BPMN and BPEL with graph grammar, Computers & Electrical
Engineering, 51, 304-319 (2016).
[75] H.X.Q.Z. Xiao-qin, Z.Y.Z. Kang, Survey of Graph Grammars, Computer Science 8, 002
(2008).
[76] http://ascenseur-ascensoriste.e-monsite.com/pages/ascenseurs-exterieurs.html/ (ac-
cessed on December 12th, 2017).
[77] https://www.maisonsbouny.com/s/cc images/teaserbo 18886470.JPG?t=1449157578/
(accessed on December 15th, 2017).
54
... Due to their wide diversity of applications, ranging from pattern recognition, compiler construction, and generative design, graph grammars have received particular attention during the last few years. Albane et al. [4] present a survey in the field of graph grammars in which they study and classify grammars according to the number of manipulated data, the nature of data, and finally the kind of data (images, graphs, patterns, etc.) manipulated by grammars. ...
... Due to their wide diversity of applications, ranging from pattern recognition, compiler construction, and generative design, graph grammars have received particular attention during the last few years. Albane et al. (2018) present a survey in the field of graph grammars in which they study and classify grammars according to the number of manipulated data, the nature of data, and finally the kind of data (images, graphs, patterns, etc.) manipulated by grammars. The way the A-term and the additional specifications on the topology are specified in the context of NetGAP will be described using the running case study in Section 7. ...
Preprint
Full-text available
During the concept design of complex networked systems, concept developers have to assure that the choice of hardware modules and the topology of the target platform will provide adequate resources to support the needs of the application. For example, future-generation aerospace systems need to consider multiple requirements, with many trade-offs, foreseeing rapid technological change and a long time span for realization and service. For that purpose, we introduce NetGAP, an automated 3-phase approach to synthesize network topologies and support the exploration and concept design of networked systems with multiple requirements including dependability, security, and performance. NetGAP represents the possible interconnections between hardware modules using a graph grammar and uses a Monte Carlo Tree Search optimization to generate candidate topologies from the grammar while aiming to satisfy the requirements. We apply the proposed approach to the synthetic version of a realistic avionics application use case and show the merits of the solution to support the early-stage exploration of alternative candidate topologies. The method is shown to vividly characterize the topology-related trade-offs between requirements stemming from security, fault tolerance, timeliness, and the "cost" of adding new modules or links. Finally, we discuss the flexibility of using the approach when changes in the application and its requirements occur.
Article
In this paper, we introduce a new approach based on properties of graph grammars to detect conflicts of interest (COIs) in a field represented in the form of a social network. The approach consists of specializing the adaptive star graph grammar (ASGG) of Drewes et al. [Theoretical Computer Science 411 (2010) 3090-3109] to express kind of subgraphs that we call K4-type tournament graphs, corresponding to COIs, that can not be generated by the node replacement graph grammar. This approach, called Graph Grammar and K4 type Tournament based approach to detect Conflicts of Interest (GGK4T-COIs), is applied to detect COIs in the review process of papers accepted in an international conference which is represented through a social network. In this contribution, the principle of the used graph grammar is not to consider all the generated language but only subgraphs with some properties (corresponding to special graph queries), which identify parts of the social network representing COIs. For evaluating the performances and the efficiency of our proposition, experimentations have been done by comparing it with concurrent methods in the literature. The obtained results have shown that the approach GGK4TCOIs performs better than the investigated stat-of-the-art approaches in terms of type and number of detected COIs. $**************************************************************************************$ A full-text view-only version of the paper is available by using the following link: https://rdcu.be/b93yq $**************************************************************************************$
Conference Paper
Full-text available
Conflict and dependency analysis (CDA) is a static analysis for the detection of conflicting and dependent rule applications in a graph transformation system. The state-of-the-art CDA technique, critical pair analysis, provides its users the benefits of completeness, i.e., its output contains a precise representation of each potential conflict and dependency in a minimal context, called critical pair. Yet, user feedback has shown that critical pairs can be hard to understand; users are interested in core information about conflicts and dependencies occurring in various combinations. In this paper, we investigate the granularity of conflicts and dependencies in graph transformation systems. We introduce a variety of new concepts on different granularity levels: We start with conflict atoms, representing individual graph elements as smallest building bricks that may cause a conflict. We show that each conflict atom can be extended to at least one conflict reason and, conversely, each conflict reason is covered by atoms. Moreover, we relate conflict atoms to minimal conflict reasons, representing smallest element sets to be overlapped in order to obtain a pair of conflicting transformations. We show how conflict reasons are related to critical pairs. Finally, we introduce dual concepts for dependency analysis. As we discuss in a running example, our concepts pave the way for an improved CDA technique.
Article
Full-text available
We propose a new approach for modelling the process of RNA folding as a graph transformation guided by the global value of free energy. Since the folding process evolves towards a configuration in which the free energy is minimal, the global behaviour resembles the one of a self-adaptive system. Each RNA configuration is a graph and the evolution of configurations is constrained by precise rules that can be described by a graph grammar.
Chapter
There is a proliferation in the amount of data generated and its volume, which is going to persevere for many coming years. Big data clustering is the exercise of taking a set of objects and dividing them into groups in such a way that the objects in the same groups are more similar to each other according to a certain set of parameters than to those in other groups. These groups are known as clusters. Cluster analysis is one of the main tasks in the field of data mining and is a commonly used technique for statistical analysis of data. While big data collaborative filtering defined as a technique that filters the information sought by the user and patterns by collaborating multiple data sets such as viewpoints, multiple agents and pre-existing data about the users' behavior stored in matrices. Collaborative filtering is especially required when a huge data set is present.
Article
Today, software has become an intrinsic part of complex distributed embedded real-time systems. The next generation of embedded real-time systems will interconnect the today unconnected systems via complex software parts and the service-oriented paradigm. Due to these interconnections, the architecture of systems can be subject to changes at run-time, e.g. when dynamic binding of service end-points is employed or complex collaborations are established dynamically. However, suitable formalisms and techniques that allow for modeling and analysis of timed and probabilistic behavior of such systems as well as of their structure dynamics do not exist so far. To fill the identified gap, we propose Probabilistic Timed Graph Transformation Systems (PTGTSs) as a high-level description language that supports all the necessary aspects of structure dynamics, timed behavior, and probabilistic behavior. We introduce the formal model of PTGTSs in this paper as well as present and formally verify a mapping of models with finite state spaces to probabilistic timed automata (PTA) that allows to use the PRISM model checker to analyze PTGTS models with respect to PTCTL properties.
Conference Paper
Today, software has become an intrinsic part of complex distributed embedded real-time systems. The next generation of embedded real-time systems will interconnect the today unconnected systems via complex software parts and the service-oriented paradigm. Therefore besides timed behavior and probabilistic behavior also structure dynamics, where the architecture can be subject to changes at run-time, e.g. when dynamic binding of service end-points is employed or complex collaborations are established dynamically, is required. However, a modeling and analysis approach that combines all these necessary aspects does not exist so far.
Conference Paper
Double Pushout graph transformation naturally facilitates the modelling of chemical reactions: labelled undirected graphs model molecules and direct derivations model chemical reactions. However, the most straightforward modelling approach ignores the relative placement of atoms and their neighbours in space. Stereoisomers of chemical compounds thus cannot be distinguished, even though their chemical activity may differ substantially. In this contribution we propose an extended chemical graph transformation system with attributes that encode information about local geometry. The modelling approach is based on the so-called “ordered list method”, where an order is imposed on the set of incident edges of each vertex, and permutation groups determine equivalence classes of orderings that correspond to the same local spatial embedding. This method has previously been used in the context of graph transformation, but we here propose a framework that also allows for partially specified stereoinformation. While there are several stereochemical configurations to be considered, we focus here on the tetrahedral molecular shape, and suggest general principles for how to treat all other chemically relevant local geometries. We illustrate our framework using several chemical examples, including the enumeration of stereoisomers of carbohydrates and the stereospecific reaction for the aconitase enzyme in the citirc acid cycle.
Conference Paper
In this paper, we introduce the notion of fusion grammars as a novel device for the generation of (hyper)graph languages. Fusion grammars are motivated by the observation that many large and complex structures can be seen as compositions of a large number of small basic pieces. A fusion grammar is a hypergraph grammar that provides the small pieces as connected components of the start hypergraph. To get arbitrary large numbers of them, they can be copied multiple times. To get large connected hypergraphs, they can be fused by the application of fusion rules. As the first main results, we show that fusion grammars can simulate hyperedge replacement grammars that generate connected hypergraphs, that the membership problem is decidable, and that fusion grammars are more powerful than hyperedge replacement grammars.
Conference Paper
Graph languages defined by hyperedge replacement grammars can be NP-complete. We study predictive shift-reduce (PSR) parsing for a subclass of these grammars, which generalizes the concepts of SLR(1) string parsing to graphs. PSR parsers run in linear space and time. In comparison to the predictive top-down (PTD) parsers recently developed by the authors, PSR parsing is more efficient and more general, while the required grammar analysis is easier than for PTD parsing.
Chapter
There is a proliferation in the amount of data generated and its volume, which is going to persevere for many coming years. Big data clustering is the exercise of taking a set of objects and dividing them into groups in such a way that the objects in the same groups are more similar to each other according to a certain set of parameters than to those in other groups. These groups are known as clusters. Cluster analysis is one of the main tasks in the field of data mining and is a commonly used technique for statistical analysis of data. While big data collaborative filtering defined as a technique that filters the information sought by the user and patterns by collaborating multiple data sets such as viewpoints, multiple agents and pre-existing data about the users' behavior stored in matrices. Collaborative filtering is especially required when a huge data set is present.