the generative power of context-free node rewriting in hypergraphs

11
The Generative Power of Context-free Node Rewriting in Hypergraphs RENATE KLEMPIEN-HINRICHS Universität Bremen, Fachbereich Mathematik/Informatik, Postfach 33 04 40, 28334 Bremen, Germany E-mail: [email protected] Abstract. Context-free hypergraph grammars allow to define sets of hypergraphs in a recursive way. In the literature, three main approaches can be found: hyperedge rewriting (HR), separated handle rewriting (S-HH), and confluent node rewriting (C-hNCE). With respect to their graph-generating power, S-HH grammars and so-called remote-free C-hNCE grammars characterize confluent node rewriting in graphs, which in turn is more powerful than hyperedge rewriting. With respect to their hypergraph-generating power, HR and S-HH grammars have been shown to be incomparable. In this paper, we show that the hypergraph-generating power of (remote-free) C-hNCE gram- mars includes properly that of HR and S-HH grammars together. This indicates that confluent node rewriting plays as important a role in generating sets of hypergraphs as it does in generating sets of graphs. Key words: graph grammar, node rewriting, hypergraph, context-freeness 1. Introduction Context-free graph grammars are a natural generalization of context-free string grammars and allow to define sets of graphs recursively. Following Engelfriet (1997), two main types of context-free graph grammars can be distinguished: con- fluent node rewriting (C-edNCE grammars Kaul (1985), see also Engelfriet and Rozenberg (1997)) and hyperedge rewriting (HR grammars Bauderon and Cour- celle, Habel and Kreowski (1987, 1987), see also Drewes et al. (1997)). In the node-rewriting approach, a graph which is substituted for a node is em- bedded in the remainder of the graph to be rewritten by inserting new edges con- necting (some of) the neighbours of the node with nodes in the substituting graph. In general, node-rewriting grammars are not confluent in the sense of Courcelle (1987), i.e. the result of rewriting two distinct nodes in a graph may depend on the order in which the rewriting steps are executed. Consequently, different traversals of the same derivation tree may yield different graphs. This undesirable situation is avoided by considering only confluent grammars, which may also be called context-free. Extending the concept of an edge, the sequence of nodes incident to a particular hyperedge may be of arbitrary length, i.e. it need not necessarily consist of exactly two distinct nodes. When rewriting such a hyperedge, the substituting graph is embedded into the original graph by identifying (or gluing) some of its nodes with Grammars 2: 211–221, 1999. © 1999 Kluwer Academic Publishers. Printed in the Netherlands.

Upload: renate-klempien-hinrichs

Post on 03-Aug-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

The Generative Power of Context-freeNode Rewriting in Hypergraphs

RENATE KLEMPIEN-HINRICHSUniversität Bremen, Fachbereich Mathematik/Informatik, Postfach 33 04 40, 28334 Bremen,GermanyE-mail: [email protected]

Abstract. Context-free hypergraph grammars allow to define sets of hypergraphs in a recursive way.In the literature, three main approaches can be found: hyperedge rewriting (HR), separated handlerewriting (S-HH), and confluent node rewriting (C-hNCE). With respect to their graph-generatingpower, S-HH grammars and so-called remote-free C-hNCE grammars characterize confluent noderewriting in graphs, which in turn is more powerful than hyperedge rewriting. With respect to theirhypergraph-generating power, HR and S-HH grammars have been shown to be incomparable.

In this paper, we show that the hypergraph-generating power of (remote-free) C-hNCE gram-mars includes properly that of HR and S-HH grammars together. This indicates that confluent noderewriting plays as important a role in generating sets of hypergraphs as it does in generating sets ofgraphs.

Key words: graph grammar, node rewriting, hypergraph, context-freeness

1. Introduction

Context-free graph grammars are a natural generalization of context-free stringgrammars and allow to define sets of graphs recursively. Following Engelfriet(1997), two main types of context-free graph grammars can be distinguished: con-fluent node rewriting (C-edNCE grammars Kaul (1985), see also Engelfriet andRozenberg (1997)) and hyperedge rewriting (HR grammars Bauderon and Cour-celle, Habel and Kreowski (1987, 1987), see also Drewes et al. (1997)).

In the node-rewriting approach, a graph which is substituted for a node is em-bedded in the remainder of the graph to be rewritten by inserting new edges con-necting (some of) the neighbours of the node with nodes in the substituting graph.In general, node-rewriting grammars are not confluent in the sense of Courcelle(1987), i.e. the result of rewriting two distinct nodes in a graph may depend on theorder in which the rewriting steps are executed. Consequently, different traversalsof the same derivation tree may yield different graphs. This undesirable situationis avoided by considering only confluent grammars, which may also be calledcontext-free.

Extending the concept of an edge, the sequence of nodes incident to a particularhyperedgemay be of arbitrary length, i.e. it need not necessarily consist of exactlytwo distinct nodes. When rewriting such a hyperedge, the substituting graph isembedded into the original graph by identifying (or gluing) some of its nodes with

Grammars2: 211–221, 1999.© 1999Kluwer Academic Publishers. Printed in the Netherlands.

212 RENATE KLEMPIEN-HINRICHS

the incident nodes of the hyperedge. The properties of this notion for substitutionjustify calling HR grammars naturally context-free.

The idea of hyperedges immediately leads to the concept ofhypergraphs, whichhave hyperedges instead of edges. Hypergraphs offer a suitable model for e.g.flow diagrams, Petri nets, or functional expressions, and context-free hypergraphrewriting can be seen as formalizing e.g. the syntactic generation of flow diagramsor place/transition refinement in Petri nets. In the literature, three types of context-free hypergraph grammars are proposed: (1) Hyperedge-rewriting (HR) grammars(Bauderon and Courcelle, 1987; Habel and Kreowski, 1987) work for hypergraphsas they do for graphs, gluing the incident nodes of a rewritten hyperedge with asmany nodes in the replacing hypergraph. (2) The separated handle-rewriting (S-HH) grammars of Courcelle et al. (1993) are a hybrid between hyperedge andnode rewriting: a hyperedge together with its incident nodes – a handle – con-stitutes a nonterminal item, and a hypergraph replacing a handle is embeddedby copying hyperedges which linked the handle to its context and making thesehyperedges incident to distinguished nodes of the replacing hypergraph. The S-HRNCE grammars of (Kim and Jeong, 1999) offer another handle-rewriting tech-nique, but they differ significantly from the other approaches and will thereforenot be considered in this paper. (3) Confluent node-rewriting (C-hNCE) grammars(Klempien-Hinrichs, 1996) also use embedding hyperedges, but allow to changethe shape (rank, incidence, label) of an embedding hyperedge. In the general formof this approach, it is even possible to create embedding hyperedges whose incid-ent nodes belong exclusively to the context of the rewritten node. In this paper,however, we will work with the subclass of remote-free C-hNCE grammars wherethis cannot happen.

While these three rewriting approaches differ of course syntactically, one wouldalso like to know where there are semantic differences, if any. In other words, if Iwant to specify a certain set of (hyper)graphs, is it just a matter of taste which ap-proach I choose? Concerning the generation of graph languages, C-edNCE gram-mars are more powerful than HR grammars (it is well known that the set of allcomplete graphs is a C-edNCE language, but it is not an HR language (Habel,1992)) and as powerful as S-HH grammars (Courcelle et al., 1993) and remote-free C-hNCE grammars. Concerning the generation of hypergraph languages, HRgrammars and S-HH grammars are incomparable (Courcelle et al., 1993).

This paper investigates the generative power of confluent node rewriting in hy-pergraphs. C-hNCE languages prove to form a naturally context-free class whichcontains properly the union of HR languages and S-HH languages; in fact, thesame holds already for the languages generated by remote-free C-hNCE grammars.Thereby, an open question in Courcelle et al. (1993) is answered and confluent noderewriting is established as the most powerful known hypergraph-generating mech-anism which is yet context-free. Hence, it plays as important a role in generatingsets of hypergraphs as in generating sets of graphs.

THE GENERATIVE POWER OF C-HNCE REWRITING 213

The paper is organized as follows. In Section 2, our notion of hypergraphs isdefined and confluent hNCE rewriting is recalled. The generative power of remote-free C-hNCE grammars is studied in Section 3. Section 4 contains some concludingremarks.

2. Node Rewriting in Hypergraphs

In this section, we define directed, labelled hypergraphs and recall confluent noderewriting in hypergraphs (Klempien-Hinrichs, 1996).

Throughout the paper, let6 be an alphabet;6 may contain the symbol∗ whichmeans “unlabelled”. Moreover, letN = {0,1,2, . . . } be the set of non-negativeintegers, and let[n] = {1, . . . , n} for n ∈ N.

A (directed, node- and hyperedge-labelled)hypergraphover6 is a tupleH =(VH ,EH,labH) whereVH is a finite set ofnodes, EH ⊆ 6 × V ∗H is a finite set ofhyperedges, and labH : VH → 6 is a mappinglabelling a nodev with labH(v).Given a hyperedgee = (α, v1 . . . vn) ∈ EH , we also writelabH (e) = α for itslabel, attH(e) = v1 . . . vn for its attachment sequence, vsetH (e) = {vi | i ∈ [n]}for the set of itsincident nodes,vertH(e, i) = vi for its ith incident node, andrankH (e) = n for its rank; moreover, eachi ∈ [n] is called atentacleof e.

In pictures, the nodes of a hypergraph are represented by circles, the hy-peredges by squares, and the tentacles by numbered lines, e.g.1 2 . A labelis written next to the node resp. hyperedge to which it is assigned.

As usual, two hypergraphsG,H are isomorphic if there is a bijectionf : VG→VH such thatEH = {(α, f (v1) . . . f (vn)) | (α, v1 . . . vn) ∈ EG} and, for allv ∈VG, labH(f (v)) = labG(v). The set of all hypergraphs isomorphic to a (concrete)hypergraphH is denoted by[H ] (which is also called anabstracthypergraph).The set of all (concrete) hypergraphs over6 is denoted byH6 , and the set of allabstract hypergraphs by[H6] (the subscript6 may be omitted where the particularalphabet is not important). Ahypergraph languageis a subset of[H ], and the setof all hypergraph languages is denoted byLH .

A node-rewriting productionX ::= (R,C) consists of a labelX as left-handside and a hypergraphR plus a connection relationC as right-hand side. Whenrewriting anX-labelled nodev in a hypergraphH , the connection instructions inC specify howR will be connected toH minusv, depending on the connectionsv had inH . Roughly, an instruction(α, x1 . . . xm/β, y1 . . . yn) in C means that ifthere is anα-labelled hyperedgee in H incident tov such that for alli ∈ [m]:

xi ={♦ if vertH(e, i) = v andlabH(vertH (e, i)) otherwise,

then aβ-labelled hyperedgee′ will be established with, for allj ∈ [n]:

vert(e′, j) ={yj if yj ∈ VR andvertH(e, yj ) if yj ∈ N.

214 RENATE KLEMPIEN-HINRICHS

Figure 1. Substitution of a node in a hypergraph.

Such a connection instruction should transform only hyperedges incident to therewritten nodev, meaning that there has to be somei ∈ [m]with xi = ♦. Moreover,it should not produce hyperedges incident tov, which is why we requirexyj 6= ♦if yj ∈ N.

Formally, ahypergraph with embeddingover6 is a pair(R,C) with R ∈ H6

andC a finite subset of6 × (6 ] {♦})∗ × 6 × (N+ ] VR)∗ such that for eachconnection instruction(α, x1 . . . xm/β, y1 . . . yn) in C there isi ∈ [m] with xi = ♦,and for allj ∈ [n], yj ∈ N+ impliesxyj ∈ 6.

Let H be a hypergraph,(R,C) a hypergraph with embedding withR disjointfrom H , and v a node inH . The substitution of(R,C) for v in H yields thehypergraphH [v/(R,C)] = (V ,E,lab) where:

− V = (VH − {v}) ∪ VR,

− E = {e ∈ EH | v /∈ vsetH (e)} ∪ER ∪{ (β, u1 . . . un) | (α, v1 . . . vm) ∈ EH,(α, x1 . . . xm/β, y1 . . . yn) ∈ C,∀i ∈ [m] : (vi = v ∧ xi = ♦) ∨ (vi 6= v ∧ xi = labH(vi)),∀j ∈ [n] : (yj ∈ VR ∧ uj = yj ) ∨ (yj ∈ N+ ∧ uj = vyj ) },

− lab(u) = labH (u) if u ∈ VH , andlab(u) = labR(u) if u ∈ VR.

Example. Let R be some hypergraph comprising nodesu1, u2, u3, and letCconsist of the instructions(a,♦Xa/a,2u13), (a,♦Xa/b, u22), (b, a♦/a, u31u2).Figure 1 shows the substitution of theY -labelled nodev in the left hypergraph with(R,C): v is removed from the hypergraph together with its incident hyperedges,R inserted in its place, thea-labelled hyperedge gives rise to two embedding hy-peredges labelleda resp.b, and theb-labelled hyperedge results in onea-labelledembedding hyperedge.

A node-rewriting hypergraph grammar with neighbourhood controlled embed-ding (hNCE grammar for short) is a tupleNG= (N, T , P, S) whereN andT arefinite, disjoint sets of nonterminal and terminal symbols respectively,P is a finiteset of productions of the formX ::= (R,C) with left-hand sideX ∈ N and ahypergraph with embedding(R,C) overN ∪ T as right-hand side, andS ∈ Nis the initial nonterminal ofNG. The hypergraph S consisting of oneS-labellednode and no hyperedges is the axiom or initial hypergraph ofNG.

THE GENERATIVE POWER OF C-HNCE REWRITING 215

Let NG = (N, T , P, S) be an hNCE grammar. Moreover, letH andH ′ behypergraphs overN ∪ T , v ∈ VH , andp = (X ::= (R,C)) (an isomorphic copyof) a production inP with R disjoint fromH . Thenp can be applied tov in H iflabH(v) = X. Theapplicationof p to v in H yields the hypergraphH ′, denotedH ⇒[v,p] H ′ or H ⇒P H

′, if H ′ = H [v/(R,C)]. A derivationconsists of anynumber of subsequent production applications and is denoted byH ⇒∗P H ′.

For an hNCE grammarNG = (N, T , P, S), the set of sentential forms isS(NG) = {H ∈ HN∪T | S ⇒∗P H }, and the generated hypergraph languageis L(NG) = {[H ] ∈ [HT ] | H ∈ S(NG)}.

An hNCE grammarNG = (N, T , P, S) is confluent(a C-hNCE grammar forshort) if for all sentential formsH , all (isomorphic copies of) productionsX1 ::=(R1, C1), X2 ::= (R2, C2) in P such thatH,R1, R2 are mutually disjoint, and allv1, v2 ∈ VH with labH(v1) = X1 andlabH(v2) = X2, we have:

H [v1/(R1, C1)][v2/(R2, C2)] = H [v2/(R2, C2)][v1/(R1, C1)].The set of hypergraph languages which can be generated with C-hNCE grammarsis denoted byL(C-hNCE).

Confluent hNCE grammars are context-free in the sense of (Courcelle, 1987).This implies that different traversals of a given derivation tree (where a canonicalnotion of derivation trees is used) always yield the same hypergraph.

3. The Hypergraph-Generating Power of C-hNCE Grammars

In this section, we show that confluent hNCE rewriting is more powerful than hy-peredge rewriting and separated handle rewriting together. In fact, this relationshipholds already for the subclass of so-called remote-free C-hNCE grammars. We startwith a definition of this notion, before establishing a simulation of HR rewriting,then one of S-HH rewriting, and finally giving an example of a remote-free C-hNCE hypergraph language which cannot be generated with either HR or S-HHgrammars.

Let (R,C) be a hypergraph with embedding. A connection instruction(α, x1 . . .

xm/β, y1 . . . yn) is remoteif there is noi ∈ [n] with yi ∈ VR. An hNCE grammar isremote-free(an hNCErf grammar for short) if the right-hand sides of its productionsdo not contain remote connection instructions.

Thus, in an hNCErf grammar each embedding hyperedge which is created dur-ing the application of a production must be incident to at least one node in theright-hand side of the production.

3.1. SIMULATION OF HYPEREDGE REWRITING

Hyperedge rewriting (Bauderon and Courcelle, 1987; Habel and Kreowski, 1987)is a naturally context-free method of hypergraph generation. It is based on a slightlydifferent hypergraph model than node or handle rewriting.

216 RENATE KLEMPIEN-HINRICHS

Figure 2. Substitution of a hyperedge in a multiple hypergraph.

Let 6 be an alphabet where every symbolα ∈ 6 has a typetype(α) ∈ N. Amultiple hypergraphover6 is a tupleM = (VM,EM,labM,attM) whereVM andEM are disjoint finite sets of nodes and hyperedges respectively,labM : VM∪EM →6 is a mapping labelling nodes and hyperedges, andattM : EM → V ∗M assigns asequence of attachment nodes to each hyperedge, such thatlabM(v) = ∗ for all v ∈VM andtype(labM(e)) = rankM(e) for all e ∈ EM (whererankM(e) is the lengthof attM(e)). We identify a multiple hypergraphM such thatlabM(e1) = labM(e2)

andattM(e1) = attM(e2) imply e1 = e2 for all e1, e2 ∈ EM with the ordinary (orsimple) hypergraph which corresponds toM in the obvious way. Ahypergraphwith external nodesover6 is a pair(M,ext) whereM is a multiple hypergraphover6 andext∈ V ∗M is a sequence of pairwise distinctexternalnodes.

LetM be a multiple hypergraph,(R,ext) a hypergraph with external nodes withR disjoint fromM, ande a hyperedge inM such thatrankM(e) is the length ofext.The substitution of(R,ext) for e in M yields the multiple hypergraph which isobtained by removinge fromM, addingR to the remainder ofM, and identifyingtheith incident node ofe with theith node inext(formally, this is the constructionof a quotient).

Example. Let R be a multiple hypergraph andext = u1u2u3 a sequence ofexternal nodes inR. Figure 2 shows the substitution of theY - labelled hyperedgee in the left multiple hypergraph with(R,ext): e is removed from the multiplehypergraph (but not its attachment nodes),R inserted in its place, and theithexternal node ofR glued with theith attachment node ofe.

A hyperedge-rewriting hypergraph grammar (HR grammar for short) is a gram-mar HG = (N, T , P, S) where the productions have the formX ::= (R,ext),with (R,ext) a multiple hypergraph with external nodes overN ∪ T andtype(X)the length ofext, and which is defined as usual otherwise. The axiom ofHG isthe multiple hypergraph S consisting of oneS-labelled hyperedge of rank 0 andno nodes. Derivations, sentential forms, and generated hypergraphs are definedas usual, too. An HR grammarHG is hypergraph-generatingif the hypergraphsin the generated language are simple, i.e. ifL(HG) ∈ LH . The set of multiplehypergraph languages generated by HR grammars is denoted byL(HR).

THE GENERATIVE POWER OF C-HNCE REWRITING 217

For a common basis to compare the generative power of hyperedge versusnode rewriting, we consider hypergraph-generating HR grammars only.1 Thesegrammars can be simulated by confluent node rewriting in hypergraphs.

Theorem 1. For every hypergraph-generatingHRgrammar HG, aC-hNCErf gram-mar NG can be constructed which generates the same language.

Proof sketch.The idea is to add a new incident node to each nonterminal hy-peredge which will be rewritten instead of the hyperedge. More precisely, weconstruct, for each productionX ::= (R,ext) in HG, an hNCE productionX ::=(R′, C) as follows:− for each nonterminal hyperedge inR, add a new incident node which is as-

signed the same label as the hyperedge;− for each hyperedgee in R which is incident to a node inext, add a connection

instruction(X, ∗type(X)/labR(e), y1 . . . yrankR(e)), whereyi is j ∈ [type(X)] iftheith attachment node ofe is thej th node inextandyi is theith attachmentnode itself otherwise,

− remove all external nodes and their incident hyperedges.This construction ensures thatL(HG) = L(NG). Moreover, we may assume thatall terminal hyperedges in the right-hand sides of the HR productions are incidentto at least one node which is not external (see Courcelle et al. (1993), Lemma 7.7and also Engelfriet (1997), Theorem 3.17). Thus, the connection instructions arenot remote. Finally, the context-freeness ofHG implies the confluence ofNG (NGis evenboundary; cf. Engelfriet and Rozenberg (1997), Def. 1.3.23). 2

3.2. SIMULATION OF SEPARATED HANDLE REWRITING

In separated handle rewriting (Courcelle et al., 1993), a nonterminal item is ahyperedge with its incident nodes, and two such items may not overlap.

For hypergraphsH in handle rewriting, we assumelabH (VH) = {∗} andrankH (e) > 1 for all e ∈ EH . A handleconsists of a hyperedgee ∈ EH togetherwith its incident nodesvsetH(e).

Let 6 be a set of labels. Ahypergraph with portsover6 is a pair(H,port)whereH is a hypergraph over6 andport is a finite subset ofN+×VH . For(i, v) ∈port, v is called ani-port.

LetH be a hypergraph,(R,port) a hypergraph with ports withR disjoint fromH , ande a hyperedge inH . The substitution of(R,port) for the handle definedby e in H yields the hypergraph which is obtained by removinge fromH togetherwith its attachment nodes and all their incident hyperedges, insertingR in its place,and connecting the two hypergraphs by creating, for each hyperedgee′ inH whichis incident (among others) tovert(e, i1), . . . , vert(e, ik), and for each combinationvi1, . . . , vik of nodes inR with vij an ij -port, a copy ofe′ which is incident tovijinstead ofvert(e, ij ) (for j ∈ [k]).

218 RENATE KLEMPIEN-HINRICHS

Figure 3. Substitution of a handle in a hypergraph (the tentacle numbers of the connectinghyperedges are omitted).

Example. Let (R,port) be a hypergraph with ports whereu1, u2 are the 1-ports,u2, u3 the 2-ports, and there are no 3-ports. Figure 3 shows the substitution of thehandle defined by theY -labelled hyperedgee in the left hypergraph with(R,port):e is removed from the hypergraph together with its attachment nodes and all theirincident hyperedges,R inserted in its place, and onea-labelled hyperedge is cre-ated for each combination of a 1-port with a 2-port, but nob-labelled hyperedge iscreated as there is no 3-port.

A handle-rewriting hypergraph grammar (HH grammar for short) is a grammarHG= (N, T , P, S) where the right-hand sides of the productions are hypergraphswith ports overN ∪ T , and which is defined as usual otherwise. The axiom ofHGis the hypergraph S1 consisting of oneS-labelled hyperedge of rank 1 andone node. Derivations, sentential forms, and generated hypergraphs are defined asusual, too.

HH grammars are not naturally context-free in the way HR grammars are. Inparticular, if two nonterminally labelled hyperedges have a common incident node,then rewriting one of the handles automatically affects the other. Context-freenessin the sense of (Courcelle, 1987) is obtained if such a situation is forbidden.

Let HG= (N, T , P, S) be an HH grammar. A hypergraph with ports(H,port)overN ∪ T is separatedif vsetH(e) ∩ vsetH(e′) 6= ∅ impliese = e′ for all nonter-minal hyperedgese, e′ ∈ EH . The grammarHG is separated (an S-HH grammarfor short) if all the right-hand sides of its productions are. All sentential forms ofa separated HH grammar are separated, which implies context-freeness. The set ofhypergraph languages which can be generated with S-HH grammars is denoted byL(S-HH).

Theorem 4.4 in (Courcelle et al., 1993) states that graph-generating S-HH gram-mars have the same generative power as C-edNCE grammars. The following resultis a generalisation of Lemma 4.1 in the same reference, where the construction ofan equivalent C-edNCE grammar for a graph-generating S-HH grammar is given.

Theorem 2. For everyS-HH grammar HG, aC-hNCErf grammar NG can beconstructed which generates the same language.

Proof sketch.The idea is to contract each nonterminal handle into a node whichwill be rewritten instead of the handle. More precisely, we construct, for eachproductionX ::= (R,port) in HG, an hNCE productionX ::= (R′, C) as follows:

THE GENERATIVE POWER OF C-HNCE REWRITING 219

− for each terminal hyperedgee in R, add to its label a sequencek1 . . . krankR(e)

with ki = j whenever itsith attachment node is thej th attachment nodeof some nonterminal hyperedge andki = 0 otherwise, leaving the label un-changed if there is no “adjacent” nonterminal hyperedge;

− for each nonterminal hyperedge inR, remove the hyperedge, glue its incidentnodes into one node, and assign the label of the hyperedge to that node;

− for each combination of port numbers and each possible label of a terminalhyperedge, add a connection instruction which will recognize a hyperedgeincident to anyX-labelled handle and create the corresponding embeddinghyperedge with the correct new label and the correct tentacles to the port nodesof R.

As the connection instructions change the label of a hyperedge during embedding,the information on the type of incidence to a nonterminal item is propagated inNG just as inHG, which ensuresL(HG) = L(NG). Moreover, during a productionapplication inHG the tentacles of an embedding hyperedge gripping to nodes ofthe handle are transferred to some port nodes; this implies thatNG is remote-free.Finally, the context-freeness ofHG implies the confluence ofNG. 2

3.3. PROPER INCLUSION OF HR AND S-HH LANGUAGES

It is shown in Courcelle et al. (1993) thatL(HR) ∩ LH and L(S-HH) are in-comparable. More precisely, the setL1 of all complete graphs with an additionalhyperedge of rank 1 for each node is inL(S-HH), but not inL(HR) as a con-sequence of Theorem 2.6 in Habel (1992, Chapter IV). Conversely, by Theorem 7.5in (Courcelle et al., 1993) there is an HR grammar generating a languageL2

of simple hypergraphs (such as a certain hypergraph variant of so-called dottedtrees) which is not inL(S-HH). Thus, the inclusions implied by Theorem 1 andTheorem 2 are proper.

Corollary 3. L(HR) ∩LH ( L(C-hNCErf) andL(S-HH) ( L(C-hNCErf).

An even stronger statement is contained in the following theorem.

Theorem 4. (L(HR) ∩LH) ∪L(S-HH) ( L(C-hNCErf).Proof sketch.Clearly,L1, L2 ∈ L(C-hNCErf), whereL1 andL2 are the lan-

guages mentioned above. By a standard construction, we haveL = L1 ∪ L2 ∈L(C-hNCErf), too. A straightforward generalization of Theorem 3.3 in (Habel,1992, Chapter IV) from graphs to simple hypergraphs yields that HR languages areof bounded connectivity. AsL containsL1, this impliesL /∈ L(HR). Moreover,it can be shown thatL ∈ L(S-HH) only if L2 ∈ L(S-HH) (delete the completegraphs by replacing the handles of rank 1 with nothing), which in turn contradictsTheorem 7.5 in Courcelle et al. (1993). Hence,L ∈ L(C-hNCErf) − (L(HR) ∪L(S-HH)). 2

220 RENATE KLEMPIEN-HINRICHS

Figure 4. Comparison of generative power.

4. Conclusion

The diagram in Figure 4 summarizes how confluent node rewriting in hypergraphsis related to other context-free (hyper)graph grammar approaches with respect togenerative power. Concerning graph generation, remote-free node rewriting in hy-pergraphs is just as powerful as node rewriting in graphs (and separated handlerewriting in hypergraphs). Concerning hypergraph generation, remote-free node re-writing generalizes properly both hyperedge and separated handle rewriting, whichin their turn are incomparable. It remains open whether confluent node rewritinggains in expressive power if remote connection instructions are admitted.

The fact that the graph-generating power of C-hNCErf grammars is that of C-edNCE grammars implies that C-hNCErf grammars cannot generate the sets of all(connected) graphs, all tournaments, all grids, or all stars with 2n rays. Focusingon limits to their hypergraph-generating power, they obviously cannot generatesets of hypergraphs with unbounded rank. Moreover, the enumeration propertystated in Corollary 10 of Welzl (1984) (see also Engelfriet and Rozenberg (1997,Theorem 1.3.30)) holds for the hypergraph case (even if remote connection instruc-tions occur), too, so that e.g. the set of all hypergraphs of rank at mostn cannotbe generated. Further criteria which allow to show that some hypergraph languagecannot be generated by any C-hNCErf or C-hNCE grammar need to be developed.

Acknowledgements

Frank Drewes has suggested a number of improvements to a previous version ofthis paper. Also, all pictures were prepared with his LATEX 2ε-package for typeset-ting graphs.

Research for this paper partially supported by the EC TMR Network GET-GRATS (General Theory of Graph Transformation Systems) through the Univer-sity of Bordeaux I and by the ESPRIT Basic Research Working Group APPLI-GRAPH (Applications of Graph Transformation).

THE GENERATIVE POWER OF C-HNCE REWRITING 221

Notes1 In (Klempien-Hinrichs, 1996), the common basis was founded on an encoding of multiple hyper-graphs as simple hypergraphs, so that the comparison could be achieved only up to that encoding.

References

Bauderon, M. and B. Courcelle. Graph expressions and graph rewriting.Mathematical SystemsTheory, 20: 83–127, 1987.

Courcelle, B. An axiomatic definition of context-free rewriting and its application to NLC graphgrammars.Theoretical Computer Science, 55: 141–181, 1987.

Courcelle, B., J. Engelfriet and G. Rozenberg. Handle-rewriting hypergraph grammars.Journal ofComputer and System Sciences, 46: 218–270, 1993.

Drewes, F., A. Habel and H.-J. Kreowski. Hyperedge replacement graph grammars. In G. Rozen-berg, editor,Handbook of Graph Grammars and Computing by Graph Transformation. Vol. I:Foundations. Chapt. 2, 95–162, World Scientific, Singapore, 1997.

Engelfriet, J. Context-free graph grammars. In G. Rozenberg and A. Salomaa editors,Handbook ofFormal Languages. Vol. III: Beyond Words. Chapt. 3, 125–213, Springer, Berlin, 1997.

Engelfriet, J. and G. Rozenberg. Node replacement graph grammars. In G. Rozenberg, editor,Handbook of Graph Grammars and Computing by Graph Transformation. Vol. I: Foundations.Chapt. 1, 1–94, World Scientific, Singapore, 1997.

Habel, A. Hyperedge Replacement: Grammars and Languages, Vol. 643 of Lecture Notes inComputer Science. Springer-Verlag, Berlin, 1992.

Habel, A. and H.-J. Kreowski. May we introduce to you: Hyperedge replacement. In H. Ehrig, M.Nagl, G. Rozenberg and A. Rosenfeld, editors,Proc. Third Intl. Workshop on Graph Grammarsand Their Application to Comp. Sci., Vol. 291 of Lecture Notes in Computer Science, 15–26.Springer-Verlag, Berlin, 1987.

Kaul, M. Syntaxanalyse von Graphen durch Präzedenzgraphgrammatiken. Dissertation, UniversitätOsnabrück, 1985.

Kim, C. and T. E. Jeong. HRNCE grammars – a hypergraph generating system with an eNCE wayof rewriting. Theoretical Computer Science, 233: 143–178, 1999.

Klempien-Hinrichs, R. Node replacement in hypergraphs: simulation of hyperedge replacement, anddecidability of confluence. In J. Cuny, H. Ehrig, G. Engels and G. Rozenberg editors,Proc. FifthIntl. Workshop on Graph Grammars and Their Application to Comp. Sci., Vol. 1073 of LectureNotes in Computer Science, 397–411. Springer-Verlag, Berlin, 1996.

Welzl, E. Encoding graphs by derivations and implications for the theory of graph grammars. In J.Paredaens editor,Proc. ICALP’84, Vol. 172 of Lecture Notes in Computer Science, 503–513.Springer-Verlag, Berlin, 1984.