Global Graph Transformations Luidnel Maignan and Antoine Spicher University Paris-Est Créteil, LACL 61 avenue du Général de Gaulle F-94015 Créteil Cedex, France {luidnel.maignan,antoine.spicher}@u-pec.fr Abstract. In this paper, we consider Global Graph Transformations where all occurrences of a set of predefined local rules are applied al- together synchronously so that each part of the original graph gives rise to a part of the result graph, without any reference to the original one. The particularity here is that our framework is deterministic. This is achieved by incorporating a notion of mutual agreement between its lo- cal rules. Our proposition is first motivated and illustrated on existing problems coming from different domains. It is then formalized as a cat- egorical construction which is finally compared to more usual algebraic constructions, in particular to the strongly related Amalgamation The- orem. Applications of this work include the generalization of cellular automata and the clarification of some frameworks of complex systems modeling where the usual mutual exclusion of rule applications can be replaced by a concept of mutual agreement. 1 Introduction The framework proposed herein has been designed with the need to model de- terministic dynamical systems by graph transformations. The state of such a system is represented by a graph and its global dynamics is specified through a set of local evolution rules. One such example is the simple framework of cellular automata (CA). The state of a CA is usually represented by a labeled regular graph where the nodes are the cells, the labels encode the cell states, and the edges represent the neigh- borhood relation between cells. A global evolution step consists of a synchronous update of all the labels relying on a local evolution function, the structure of the graph remaining unchanged. From another point of view, each patch of neighbor cells (e.g. triple of consecutive cells in 1D CA with radius 1, square of 9 cells in 2D Moore CA) gives rise to a new node with the updated label. All these new nodes are then connected together to form the next state graph representation which is independent from the current one. Recently, different formalizations based on this point of view have been proposed to generalize CA to arbitrary graphs with dynamic structures [1,2]. This paper is an attempt to show that an algebraic approach can provide an interesting alternative to those formalisms. Other work was already devoted to the simulation of the so called Dynamical Systems with Dynamical Structure [5,20]. In these approaches, a rewriting of cell complexes (an extension of graphs to higher dimensions, see Section 3) has been developed to simulate concurrent interaction rules. The resulting programming language, called MGS, has been shown as a unification of many computation models including CA, Lindenmayer systems, membrane computing systems, etc. So far, MGS parallel rule application strategies rely on a maximal-parallel prop- erty: only mutually exclusive matchings can be applied simultaneously. This leads to some non-determinism since there might be different maximal sets of mutually exclusive matchings. This paper arises as an attempt to model systems where the natural mutual agreement between the local rules applications can be used to overcome the difficulties introduced by the concept of mutual exclusion. As a result of these two motivations, the transition mechanism of the modeled system is described in our setting by a set of rules that do not send rooted graphs to nodes as in CA, nor nodes to graphs as it is often the case in graph transformation [7], but that send graphs to graphs. Moreover, the reconstruction of the resulting global state from the local applications of these rules on the current state, relies on the following coherence property of the rules: when two rule matchings overlap on an input graph, the local behavior of the common part has to be shared by the two rules. This intuition can be seen as a compound of two instances of a simpler situation: any time a first matching includes a second matching, the result of the first matching has to include the result of the second matching. Because the proposed formalism is a direct expression of the coherence property, we believe that this framework allows to model very intuitively any desired deterministic system, and can be easily adapted to any particular need (e.g., non-determinism, presence of terminals/non-terminals). Of course, as for any modeling framework, it certainly asks for some getting-used-to to users already accustomed with other modes of thinking. The proposed framework reminds some existing ones. The statement of the coherence above is the same leading to the concept of sub-rule and amalgamation in the double-pushout approach [3]. It is also reminiscent of the connecting or gluing mechanisms used in node or edge based parallel graph grammars (see Sect. 2). This very simple inclusion intuition can be applied in various settings, as cell complexes in the following. In section 5, it is expressed categorically; this allows a short and intrinsic formalization with possible instantiations to different kinds of objects. Finally the evolution described by a total function in the CA setting simply becomes functors on a full subcategory in our setting. Organization of the Paper. The rest of the paper is organized as follows. Section 2 provides some comparison with existing approaches of parallel graph transformation. Section 3 gives some formal preliminaries. Section 4 considers the example of triangular mesh refinement in order to expose the idea of the proposed framework informally. This example has been chosen because it encompasses many considerations about the proposed framework. Section 5 formalizes the concept of global transformation. It is then compared with the double-pushout approach and the strongly related concept of amalgamation of productions. Sec- tion 6 discusses the remaining aspect of the work and concludes. 2 Related Work In this section, we describe briefly existing approaches of parallel rewriting sys- tems with a final comparison to global transformations. One of the first parallel rewriting systems are Lindenmayer Systems (LS), which are parallel string rewriting in contrast with sequential Chomsky gram- mars. A hk, li LS (k, l ∈ N) is a context-sensitive system gathering productions in a transition table, so that each sub-word of length k + 1 + l (i.e., a letter with a left context of length k and a right context of length l1 ) is associated with (possibly many) words. The parallel rewriting of a word is done as follows: each letter is substituted accordingly to its left and right contexts by one of its associated words in the transition table. Obviously, the LS is deterministic if the transition table is a function (i.e., associates a unique word with each entry). LS have been extensively studied for their expressive powers and compared to the classic Chomsky hierarchy of formal languages [19]. They have also been used in the modeling of unidimensional and tree-like dynamical systems [16]. LS can be seen as a special case of parallel graph transformation, restricted to linear/sequential graphs. Other special cases of graphs can be addressed. For example, Paŭn Systems (roughly speaking, nested parallel multiset rewriting systems [15]) can be considered as complete graph transformations. Such sys- tems derive naturally from LS by considering rewriting modulo associativity and commutativity: any two symbols of a string representing a multiset can be made neighbors by permuting the letters of the word. In this setting, a production is a metaphor of a chemical reaction. The left hand side (l.h.s.) of a production designates a sub-multiset which is entirely replaced by its associated right hand side (r.h.s.) (in contrast with LS where each letter is replaced independently). To avoid the consumption of the same symbol by two different reactions, the maximal-parallel strategy is considered leading to non-determinism. Extension of LS to arbitrary graph transformation is not an easy task [7]. A first idea consists in encoding the graph using sets, multisets, sequences or terms, and their associated well-known and rich techniques. As an example, [17] bridges graph rewriting to set rewriting by considering a graph as a set of (hyper-)edges, an hyper-edge being a sequence of vertices. On the other hand, some works ad- dress the issue of a direct rewriting of graphs. Classical work in graph grammars includes node-rewriting and hyperedge-rewriting graph grammars [18]. These works have some interesting relation with our framework when they are used in a parallel setting, that is, when each node (resp. edge) chooses a production rule to apply. In this case, all of them provide a resulting graph and these graphs are connected (resp. glued) together in some way or another by an embedding mech- anism. In the node setting, edges are used to specify the connection between the graphs while, in the hyperedge setting, the nodes specify the gluing between the graphs. In fact, any deterministic instances of these systems can easily be represented in our framework. 1 An extra dummy symbol, the marker, is used to deal with boundaries. c1 f f e3 e1 e1 e2 e3 c3 e2 c2 c2 c1 c3 Fig. 1. On the left, a cell complex composed of three 0-cells (c1 , c2 , c3 ), of three 1-cells (e1 , e2 , e3 ) and of a single 2-cells (f ). On the right, the Hasse diagram of its incident relationship. The previous examples are set-theoretic approaches: graph transformations are expressed in terms of sets and set operations. Graph transformations can also be represented algebraically using the double-pushout and the simple-pushout approaches which formalize the idea of local replacement in a categorical man- ner [18]. The double-pushout approach is inherently local so that it needs to be extended to deal with parallel applications leading to the concepts of par- allelism [4] and amalgamation [3]. Roughly speaking, parallelism allows to ap- ply many mutually exclusive matchings simultaneously. Amalgamation provides a more general setting where the set of productions is augmented with sub- productions that handle some kind of overlaps. Therefore, many matchings can be applied together as long as sub-productions are chosen to deal with the over- lapping sub-parts which is reminiscent of the coherence property stated above. Multi-amalgamation [6] is an extension of amalgamation to consider maximal matchings. However, the amalgamation theorem makes clear that a compound production can be applied only when each of its parts can be applied. This constraint makes (multi-)amalgamation unusable straightforwardly in the cases where the transformation of matchings only makes sense when taken altogether. 3 Formal Preliminaries and Notations Since the present article follows naturally work introduced in [20], we consider cell complexes, a more general setting than graphs. Like a graph, a cell complex is a formal construction that builds a space in a combinatorial way through more basic objects called topological cells. Each topological cell abstractly represents a part of the whole and is characterized by a natural integer called dimension. A topological cell of dimension d is called d-cell. The structure of the whole space, corresponding to the partition into topological cells, is considered through the incidence relationships, relating two “neighbor” cells in the partition. A graph can then be seen as a cell complex composed of 0-cells and 1-cells, respectively the nodes and the edges, so that the incidence relationship of the complex coin- cides with the usual notion of incidence in graphs. More generally, a cell complex using only two dimensions is an undirected multi- and hyper-graph. There exist many possible formal definitions of cell complexes coming from different fields (algebraic topology [12], digital topology [8], geometric modeling, etc.). We con- sider here the definition of [20]. Let L be an arbitrary set of symbols. A labeled abstract cell complex K with labels in L is given by a tuple hCK , ≺K , dimK , lK i where CK is the set of abstract topological cells, ≺K is a locally finite2 strict partial order relation over CK , dimK : hCK , ≺K i → hN,