• No results found

In this chapter, a brief overview of concepts, and tools has been given in the area of graph transformation. We have started with introducing graph-related definitions, after which the most important algebraic graph transformation ap- proaches have been discussed, being the Double Pushout Approach, the Single Pushout approach, and the Sesqui Pushout approach. The last has been intro- duced recently and is therefore not yet applied in large contexts. We have shown that graph production systems give rise to graph transition systems in which states have an internal graph structure and transitions represent applications of transformation rules. Next, we discussed the main features of the Groove Tool Set as it was before integrating the techniques explained and discussed in this thesis.

Finally, an (incomplete) overview has been given of related tools in the fields of graph transformation. The graph transformation tools included are Agg, GReAT, Fujaba, and Augur, of which only Augur focuses on verifying finite state graph production systems which is the central topic of this thesis.

3

Uniform Attributed Graphs

3.1

Introduction

When modelling object-oriented systems and verifying their behaviour using graphs and graph transformations, a key feature is the integration of data values in graph structures and algebraic operations in graph transformation specifica- tions. Graphs in which nodes (and edges) can be assigned attributes of some data type are often called attributed graphs.

During the last fifteen years, a number of approaches to modelling attributed graphs and their transformations have been proposed (e.g., [135, 18, 100, 65]). The approaches mainly diverge in two dimensions: the first dimension being the way attributes are mathematically included in the graph, the second dimension concerns the way attribute values are changed. L¨owe et al. [135] introduced

attribute carriers being additional nodes that attach an attribute to a node or

edge. Other approaches like the one proposed by Heckel et al. [100] and Ehrig et al. [65] use a graph structure in which attributes are referenced through special edges, directly connecting the node or edge to be attributed with the attribute itself. For changing attribute values, the two main alternatives are the

relabelling approach and the reconnecting approach. In the relabelling approach,

the nodes representing an attribute are preserved but the value represented by that specific node is changed by the transformation. This approach has been applied e.g., by L¨owe et al. [135] and Plump et al. [152]. Changing attributed values in the reconnecting approach is basically established by replacing the attribute edge, i.e., the attribute edge pointing to the current attribute value

Chapter 3. Uniform Attributed Graphs

will be removed and an attribute edge referencing the new attribute value will be created. This approach is used by Ehrig et al. [65].

In traditional approaches, attributed graph transformations are described by including the algebraic operations as terms in the graph structure, but specifying the application constraints on the attributes externally (usually as algebraic

equations over the terms). This makes the transformation specification less

transparent and the implementation more involved. That is, next to graph matching algorithms, one has to implement mechanisms for variable evaluations and an equation solving engine which determines the solutions for the equations specified over the terms.

We propose a novel approach that has a close relation with the approach by Ehrig et al. [65]. Our approach introduces a uniform framework for the specification of attributed graphs and their transformation. In our approach, all these concepts are included in the graph formalism, thus providing a uni- form and transparent attributed graph transformation framework. Such a uni- form framework furthermore enables the tasks carried out when performing at- tributed graph transformations such as, e.g., the value assignment of variables and the evaluation of conditional expressions over variables, to be included in the graph matching algorithm in a natural way. We thus reduce the imple- mentation efforts for extending the Groove Tool Set to support the use of attributes.

In this chapter we use an example graph transformation system to illustrate our approach. This example models the behaviour of a Vector in/from which we can insert/remove Objects. Figure 3.1 depicts how a typical rule in this example would be specified using the approach of Ehrig et al. [65].

Figure 3.1: A typical graph transformation rule using the approach by Ehrig et al.

We aim at including both the conditional expressions on the variables and the expressions to update their actual values in the graph structure. This has

3.1 Introduction

the additional advantage that the necessity of introducing variable names dis- appears. Figure 3.2 then depicts how the rule from Fig. 3.1 would be specified in Groove eventually.

Figure 3.2: The rule of Fig. 3.1 specified in Groove.

Since Groove only supports the use of binary graphs, we have to close the gap between algebras that may have operations of arbitrary arities and the binary graph formalism. Modelling an arbitrary algebra as a graph, the so-called

algebra graph, using binary edges can be done in several ways. The hyperedge-

like structure of operations can be captured by introducing a separate node for every operation being applied on any combination of operands. Special edges then have to indicate the order of the operands and the result of the operation. This results in algebra graphs that are unnecessarily large (although they could be infinite anyway due to infinite data domains). Algebras that contain unary operations only (i.e., algebras of a so called graph structure signature [135]) can be modelled as graphs very naturally, since every operation instance can then be represented by a binary edge pointing from its operand to the corresponding result.

The main idea of our approach is to translate arbitrary algebras to equivalent algebras containing unary operations only. For this we first have to modify the underlying signature. We will show that from arbitrary signatures we can construct an equivalent graph structure signature by introducing product sorts and fresh functional and projection operation symbols. This construction will be called flattening. In order to prove the equivalence between the original and the modified signature we need to show that the original signature can be reconstructed from the flattened signature. This reconstruction is called

Chapter 3. Uniform Attributed Graphs

unflattening. The equivalence of arbitrary signatures and their corresponding

flat signature can be lifted to the level of arbitrary algebras and to attributed graphs over arbitrary algebras. This allows us to prove one of the main results of this chapter, namely that our approach is categorically equivalent to the approach by Ehrig et al. [65], except from the fact that we do not support edge attributes and typing.

Eventually, we aim at model checking of object-oriented systems for which the state space has been generated by performing graph transformations. One way of alleviating the state-explosion problem is to apply abstraction techniques. Our uniform approach to modelling attributed graphs provides natural ways for abstraction on attribute values. Instead of interpreting attributed graphs and their transformation specifications on concrete algebras, the Groove Tool Set can be extended with abstract algebras. In this chapter we will elaborate on the consequences of performing what we call abstract attributed graph transforma-

tions.

Overview of the Chapter

This chapter is structured as follows. In Section 3.2 we start by recalling some basic definitions concerning algebraic specifications, both formally and intu- itively, and discuss some additional categorical concepts that are used in this chapter. In order to guarantee that our approach produces correct results we show the relation between our approach and existing ones. This correspondence is based on the equivalence of the specific categories of attributed graphs. The equivalence is proven by first proving the equivalence of the signatures the at- tributed graphs in the different categories rely on. This is achieved by introduc- ing flattening and unflattening functors at the level of signatures (Section 3.3) and algebras (Section 3.4). In Section 3.5 we introduce the notion of uniform

attributed graphs and prove the equivalence with the approach introduced by

Ehrig et al. [65]. Transformations of uniform attributed graphs can then be de- fined in the usual way, as discussed in Section 3.5.3. In Section 3.6 we elaborate on the way our approach provides a natural way of specifying abstractions on attribute values. In Section 3.7 we shortly discuss some implementation issues, after which we end this chapter with Section 3.8 containing some concluding remarks. The proofs of some major results are included in this chapter. The remaining proofs can be found in Appendix B.