Structured Operational Semantics for Graph Rewriting
Process calculi and graph transformation systems provide models of reactive systems with labelled transition semantics. While the semantics for process calculi is compositional, this is not the case for graph transformation systems, in general. Hence…
Authors: ** - Andrei Dorman (Dip. di Filosofia, Università Roma Tre; LIPN – UMR 7030, Université Paris 13) –
Bliudze, S., Bruni, R., Carbone, M., Silva, A. (Eds.); ICE 2011 EPTCS 59, 2011, pp. 37–51, doi:10.4204/EPTCS.59.4 Structur ed Operational Semantics f or Graph Rewriting ∗ Andrei Dorman Dip. di Filosofia, Univ ersit ` a Roma T re LIPN – UMR 7030, Univ ersit ´ e Paris 13 andrei.dorman@lipn.univ-paris13.fr T obias Heindel LIPN – UMR 7030, Univ ersit ´ e Paris 13 tobias.heindel@lipn.univ-paris13.fr Process calculi and graph transformation systems pro vide models of reacti ve systems with labelled transition semantics. While the semantics for process calculi is compositional, this is not the case for graph transformation systems, in general. Hence, the goal of this article is to obtain a compositional semantics for graph transformation system in analogy to the structural operational semantics (SOS) for Milner’ s Calculus of Communicating Systems (CCS). The paper introduces an SOS style axiomatization of the standard labelled transition semantics for graph transformation systems. The first result is its equiv alence with the so-called Borrowed Conte xt technique. Unfortunately , the axiomatization is not compositional in the expected manner as no rule captures “internal” communication of sub-systems. The main result states that such a rule is deriv able if the gi ven graph transformation system enjoys a certain property , which we call “complementarity of actions”. Archetypal e xamples of such systems are interaction nets. W e also discuss problems that arise if “complementarity of actions” is violated. K e y wor ds: process calculi, graph transformation, structural operational semantics, compositional methods 1 Intr oduction Process calculi remain one of the central tools for the description of interacti ve systems. The archetypal example of process calculi are Milner’ s π -calculus and the e ven more basic calculus of communication systems ( C C S ) . The semantics of these calculi is gi ven by labelled transition systems ( LT S ), which in fact can be gi v en as a structural operational semantics ( S O S ). An adv antage of S O S is their potential for combination with compositional methods for the verification of systems (see e.g. [17]). Fruitful inspiration for the de velopment of L T S semantics for other “non-standard” process calculi originates from the area of graph transformation where techniques for the deri v ation of LT S semantics from “reaction rules” hav e been dev eloped [ 16 , 7 ]. The strongest point of these techniques is the context independence of the resulting beha vioral equi v alences, which are in fact congruences. Moreov er , these techniques ha ve lead to original L T S -semantics for the ambient calculus [ 15 , 3 ], which are also gi ven as S O S systems. Already in the special case of ambients, the S O S -style presentation goes beyond the standard techniques of label deri vation in [ 16 , 7 ]. An open research challenge is the development of a general technique for the canonical deri v ation of S O S -style L T S -semantics. The problem is the “monolithic” character of the standard LT S for graph transformation systems. In the present paper , we set out to de velop a partial solution to the problem for what we shall call C C S -like graph transformation systems. The main idea is to develop an analogy to C C S where each action α has a co-action α that can synchronize to obtain a silent transition; this is the so-called communication rule . In analogy , one can restrict attention to graph transformation systems with rules that allow to assign to each (hyper -)edge a unique co-edg e . Natural examples of such systems are interaction nets as ∗ This work was partially supported by grants from Agence Nationale de la Recherche, ref. ANR-08-BLANC-0211-01 (COMPLICE project) and ref. ANR-09-BLAN-0169 (P ANDA project). 38 SOS for Graph Re writing introduced by Lafont [ 11 , 1 ]. In fact, one of the moti vations of the paper is to derive S O S semantics for interaction nets. Structure and contents of the paper W e first introduce the very essentials of graph transformation and the so-called Borro wed Context ( B C ) technique [ 7 ] for the special case of (h yper-)graph transformation in Section 2. T o make the analogy between C C S and B C as formal as possible, we introduce the system S O S B C in Section 3, which is meant to provide the uninitiated reader with a ne w perspectiv e on the B C technique. Moreover , the system S O S B C emphasizes the “local” character of graph transformations as e very transition can be decomposed into a “basic” action in some context. In particular , we do not ha ve any counterpart to the communication rule of C C S , which shall be addressed in Section 4. W e illustrate why it is not e vident when and ho w two labeled transitions of tw o states that share their interface can be combined into a single synchronized action. Howe ver , we will be able to describe sufficient conditions on (hyper -)graph transformation systems that allo w to deriv e the counterpart of the communication rule of C C S in the system S O S B C . Systems of this kind ha ve a natural notion of “complementarity of actions” in the LT S . 2 Pr eliminaries W e first recall the standard definition of (hyper -)graphs and a formalism of transformation of hyper -graphs (follo wing the double pushout approach). W e also present the labelled transition semantics for hyper -graph transformation systems that has been proposed in [ 7 ]. In the present paper , the more general case of categories of graph-like structures is not of central importance. Ho wev er, some of the proofs will use basic results of category theory . Definition 2.1 (Hypergraphs and hyper graph morphisms) . Let Λ be a set of labels with associated arity function ar : Λ → N . A ( Λ -labelled) hyper -graph is a tuple G = ( E , V , ` , cnct ) where E is a set of (hyper-)edg es , V is a set of vertices or nodes , ` : E → Λ is the labelling function , and cnct is the connection function, which assigns to each edge e ∈ E a string (e.g. a finite sequence) of incident vertices cnct ( e ) = v 1 · · · v n of length ar ( ` ( e )) = n (where { v 1 , . . . , v n } ⊆ V ). Let v ∈ V be a node; its degr ee , written deg ( v ) is the number of edges of which it is an incident node, i.e. deg ( v ) = |{ e ∈ E | v incident to e }| (where for any finite set M , the number of elements of M is | M | ). W e also write v ∈ G and e ∈ G if v ∈ V and e ∈ E . Let G i = ( E i , V i , ` i , cnct i ) ( i ∈ { 1 , 2 } ) be h yper-graphs; a hyper -graph morphism from G 1 to G 2 , written f : G 1 → G 2 is a pair of functions f = ( f E : E 1 → E 2 , f V : V 1 → V 2 ) such that ` 2 ◦ f E = ` 1 and for each edge e 1 ∈ E 1 with attached nodes cnct ( e ) = v 1 · · · v n we hav e cnct 2 ( f E ( e )) = f V ( v 1 ) · · · f V ( v n ) . A hyper-graph morphism f = ( f E , f V ) : G 1 → G 2 is injective (bijective) if both f E and f V are injecti ve (bijecti ve); it is an inclusion if both f E ( e ) = e and f V ( v ) = v hold for all e ∈ E 1 and v ∈ V 1 . W e write G 1 → G 2 or G 2 ← G 1 if there is an inclusion from G 1 to G 2 , in which case G 1 is a sub-graph of G 2 . T o define double pushout graph transformation and the Borro wed Context technique [ 7 ], we will need the following constructions of hyper-graphs, which roughly amount to intersection and union of hyper -graphs. Definition 2.2 (Pullbacks & pushouts of monos) . Let G i = ( E i , V i , ` i , cnct i ) ( i ∈ { 0 , 1 , 2 , 3 } ) be hyper- graphs and let G 1 → G 3 ← G 2 be inclusions. The intersection of G 1 and G 2 is the hyper-graph G 0 = ( E 1 ∩ E 2 , V 1 ∩ V 2 , ` 0 , cnct 0 ) where ` 0 ( e ) = ` 1 ( e ) and cnct 0 ( e ) = cnct 2 ( e ) for all e ∈ E 1 ∩ E 2 . The pullback of G 1 → G 3 ← G 2 is the pair of inclusions G 1 ← G 0 → G 2 and the resulting square is a pullback square (see Figure 1). Andrei Dorman, T obias Heindel 39 G 3 G 1 G 2 G 0 G 0 G 1 G 2 G 00 Figure 1: Pullback and pushout square Let G 1 ← G 0 → G 2 be inclusions; they are non-overlapping if both E 1 ∩ E 2 ⊆ E 0 and V 1 ∩ V 2 ⊆ V 0 hold. The pushout of non-overlapping inclusions G 1 ← G 0 → G 2 is the pair of inclusions G 1 → G 00 ← G 2 where G 00 = ( E 1 ∪ E 2 , V 1 ∪ V 2 , ` 00 , cnct 00 ) is the hyper-graph that satisfies ` 00 ( e ) = ( ` 1 ( e ) if e ∈ E 1 ` 2 ( e ) otherwise and cnct 00 ( e ) = ( cnct 1 ( e ) if e ∈ E 1 cnct 2 ( e ) otherwise for all e ∈ E 1 ∪ E 2 . Finally , we are ready to introduce graph transformation systems and their labelled transition semantics. Definition 2.3 (Rules and graph transformation systems) . A rule (scheme) is a pair of non-o verlapping inclusions of hyper -graphs ρ = ( L ← I → R ) . Let A , B be hyper -graphs such that A ← L and moreov er A ← I → R is non-o verlapping. Now , ρ transforms A to B if there exists a diagram as sho wn on the right such that the two squares are pushouts and there is an isomorphism ι : B 0 → B . A graph transformation system ( G T S ) is pair S = ( Λ , R ) where Λ is a set of labels and R is a set of rules. L I R A D B 0 A graph transformation rule can be understood as follows. Whene ver the left hand side L is (isomorphic to) a sub-graph of some graph A then this sub-graph can be “removed” from A , yielding the graph D . The v acant place in D is then “replaced” by the right hand side R of the rule. The middleman I is the memory of the connections L had with the rest of the graph in order for R to be attached in exactly the same place. W e now present an e xample that will be used throughout the paper to illustrate the main ideas. Example 2.1. The system S ex = ( Λ , R ) will be the following one in the sequel: Λ = { α , β , γ , . . . } such that ar ( α ) = 2, ar ( β ) = 3 and ar ( γ ) = 1; moreover R is the set of rules giv en in Figure 2 where the R i represent dif ferent graphs (e.g. edges with labels R i ). T o keep the graphical representations clear , all inclusions in the running example are gi ven implicitly by the spatial arrangement of nodes and edges. β α ← → R 1 (a) Rule “ α / β ” α γ ← → R 2 (b) Rule “ α / γ ” β γ ← → R 3 (c) Rule “ β / γ ” β α γ ← → R 4 (d) Rule “ α / β / γ ” Figure 2: Reaction rules of S ex . 40 SOS for Graph Rewriting Remark 2.1 (Rule instances) . Giv en a rule L ← I → R and a graph A such that A ← L , one can assume w .l.o.g. that A ← I → R is non-overlapping. The reason is that in each case, the rule L ← I → R could be replaced by an isomorphic “rule instance” ρ 0 = L 0 ← I 0 → R 0 (based on the standard notion of rule isomorphism). In fact the result of each transformation step is unique (up to isomorphism). This is a consequence of the follo wing fact. F act 2.4 (Pushout complements) . Let G 2 ← G 1 ← G 0 be a pair of hyper -graph inclusions wher e G i = ( E i , V i , ` i , cnct i ) ( i ∈ { 0 , 1 , 2 } ) such that for all v ∈ V 1 \ V 0 ther e does not exist any edg e e ∈ E 2 \ E 0 such that v is incident to e . Then ther e exists a unique sub-gr aph G 2 ← D such that (1) is a pushout square . G 1 G 0 G 2 D (1) Definition 2.5 (Pushout Complement) . Let G 2 ← G 1 ← G 0 be a pair of hyper -graph inclusions that satisfy the conditions of Fact 2.4; the unique completion G 2 ← D ← G 0 in (1) is the pushout complement of G 2 ← G 1 ← G 0 . Definition 2.6 (Labelled transition system) . A labelled transition system ( LT S ) is a tuple ( S , Ł , R ) where S is a set of states , Ł is a set of labels and R ⊆ S × Ł × S is the transition r elation . W e write s α − → s 0 if ( s , α , s 0 ) ∈ R and say that s can ev olve to s 0 by performing α . Definition 2.7 (DPOBC) . Let S = ( Λ , R ) be a graph transformation system. Its LT S has all inclusions of hyper-graphs J → G as states where J is called the interface ; the labels are all pairs of inclusions J → F ← K , and a state J → G e volv es to another one K → H if there is a diagram as sho wn on the right, which is called a D P O B C -diagram or just a B C -diagram . In this diagram, the graph D is called the partial match of L . D L I R G G c C H J F K For a technical justification of this definition, see [ 16 ], but let us gi ve some intuitions on what this diagram expresses. States are inclusions, where the “larger” part models the whole “internal” state of the system while the “smaller” part, the interf ace, models the part that is directly accessible to the en vironment and allo ws for (non-trivial) interaction. As a particular simple example, one could hav e a Petri net where the set of places (with markings) is the complete state and some of the place are “open” to the en vironment such that interaction takes place by e xchange of tokens. The addition of agents/resources from the en vironment might result in “ne w” reactions, which hav e not been possible before. The idea of the LT S semantics for graph transformation is to consider (the addition of) “minimal” contexts that allo w for “ne w” reactions as labels. The minimality requirement of an addition J → E or J → F is captured by the two leftmost squares in the BC diagram abov e: the addition J → F is “just enough” to complete part of the left hand side L of some rule. If the reaction actually takes place, which is captured by the other two squares in the upper ro w in the BC diagram, some agents might disappear / some resources might be used (depending on the preferred metaphor) and ne w ones might appear . Finally the pullback square in the BC diagram restricts the changes to obtain the ne w interface into the result state after reaction. As different rules might result in dif ferent deletion effects that are “visible” to the en vironment, the full label of each such “ne w” reaction is the “trigger” J → F together with the “observ able” change F ← K (with state K → H after interaction). Andrei Dorman, T obias Heindel 41 3 Thr ee Layer SOS semantics W e start with a reformulation of the borrowed context technique that breaks the “monolithic” B C -step into axioms (that allo w to deri ve the basic actions ) and two rules that allo w to perform these basic actions within suitable contexts. The axioms corresponds to the C C S -axioms that describe that the process α . P can perform the action α and then behav es as P , written α . P − α P where α ranges ov er the actions a , a , and τ . In the case of graphs, each rule L ← I → R gi ves rise to such a set of actions. More precisely , each subgraph D of L can be seen as an “action” with co-action b D L → L such that L is the union of D and b D L . For e xample, in the rule α / β , both edges α and β yield (complementary) basic actions. Formally , in T able 1, we ha ve the family of Basic Action axioms. It essentially represents all the possible uses of a transformation rule. In an (encoding of) C C S , the left hand side would be a pair of unary edges a and a , which both disappear during reaction. Now , if only a is present “within” the system, it needs a to perform a reaction; thus, the part a of the left hand side induces the (inter-)action that consists in “borro wing” a and deleting both edges (and similarly for a ). In general, e.g. in the rule α / β / γ there might be more than two edges that are in volved in a reaction and thus we ha ve a whole family of actions. More precisely , each portion of a left hand side induces the action that consists in borrowing the missing part to perform the reaction (thus obtaining the coplete left hand side), followed by applying the changes that are described by the right part of the rule. Next, we shall gi ve counterparts for two C C S -rules that describe that an action can be performed in parallel to another process and under a restriction. More precisely , whenev er we hav e the transition P − α P 0 and another process Q , then there is also a transition P k Q − α P 0 k Q ; similarly , we also hav e ( ν b ) P − α ( ν b ) P 0 whene ver α / ∈ { b , b } . More abstractly , actions are preserved by certain contexts. The notion of context in the case of graph transformation, which will be the counterpart of process contexts such as P k [ · ] and ( ν b )[ · ] , is as follows. Definition 3.1 (Context) . A conte xt is a pair of inclusions C = J → E ← J 0 . Let J → G be a state (such that E ← J → G is non-ov erlapping); the combination of J → G with the context C , written C [ J → G ] , is the inclusion of J 0 into the pushout of E ← J → G as illustrated in the following display . state: J G context: J E J 0 construction: J G E J 0 G combination: J 0 G The left inclusion of the conte xt, i.e. J → E , can also be seen as a state with the same interf ace. The pushout then giv es the result of “gluing” E to the original G at the interface J ; the second inclusion J 0 → E models a ne w interface, which possibly contains part of J and additional “ne w” entities in E . W ith this general notion of context at hand, we shall next address the counterpart of name restriction, which we call interface narr owing , the second rule f amily in T able 1. In C C S , the restriction ( ν a ) preserves only those actions that do not in volve a . The counterpart of the conte xt ( ν a )[ · ] is a context of the form J → J ← J 0 . In certain cases, one can “narrow” a label while “maintaining” the “proper” action as made formal in the follo wing definition. Definition 3.2 (Narro wing) . A narr owing context is a context of the form C = J → J ← J 0 . Let J → F ← K be a label such that the pushout complement of F ← J ← J 0 exists; then the C -narr owing of the label, written C [ J → F ← K ] is the lo wer row in the follo wing display C [ J → F ← K ] : = J 0 J F 0 F K 0 K where C = J → J ← J 0 42 SOS for Graph Rewriting where the left square is a pushout and the right one a pullback. Whenev er we write C [ J → F ← K ] , we assume that the rele vant pushout complement e xists. If we think of the interface as the set of free names of a process, then restricting a name means remov al from the interface. Thus, J 0 is the set of the remaining free names. If the pushout complement F 0 exists, it represents F with the restricted names erased. Finally , since a pullback here can be seen as an intersection, K 0 is K without the restricted names. So we finally obtain the “same” label where “irrele v ant” names are not mentioned. It is of course not always possible to narro w the interface. For instance, one cannot restrict the names that are in volved in labelled transitions of C C S -like process calculi. This impossibility is captured by the non-existence of the pushout complement. W ith the notion of narrowing, we can finally define the interface narro wing rule in T able 1. The final rule in T able 1 captures the counterpart of performing an action in parallel composition with another process P . In the case of graph transformation, this case is non-tri vial since even the pure addition of conte xt potentially interferes with the action of some state J → G . F or e xample, if an interaction in volves the deletion of an (isolated) node, the addition of an edge to this node inhibits the reaction. Ho wev er, for each transition there is a natural notion of non-inhibiting context; moreov er , to stay close to the intuition that parallel composition with a process P only adds new resources and to av oid ov erlap with the narro wing rule, we restrict to monotone contexts. Definition 3.3 (Compatible contexts) . Let C = J → E ← J be a context; it is monotone if J → J . Let J → F ← K be a label; no w C is non-inhibiting w .r .t. J → F ← K if it is possible to construct the diagram (2) where both squares are pushouts. Finally , a context J → E ← J is compatible with the label J → F ← K if it is non-inhibiting w .r .t. it and monotone. E J E 1 F E 0 K (2) In a label J → F ← K , the left inclusion represents the addition of new entities that “trigger” a certain reaction. A compatible conte xt is simply a context that is able to provide at least F , usually more than F , while not attaching ne w edges to nodes that disappear during reaction. The last rule in the S O S B C -system of T able 1 is the embedding of a whole transition into a monotone context. T o define this properly , we introduce a partial operation for the “combination” of co-spans (which happens to be a particular type of relative pushout of co-spans); this generalizes the narro wing construction. Definition 3.4 (Cospan combination) . Let C = ( J → F ← K ) and C = ( J → E ← J ) be two cospans. They are combinable if there e xists a diagram of the follo wing form. E J E 1 F E 0 K J F K = : C [ J → F ← K ] The label J → F ← K is the combination of C with C , and is denoted by C [ J → F ← K ] . In fact, it is easy to sho w that compatible contexts are combinable with their label. Lemma 3.5. Given a r eduction label J → F ← K and a compatible context J → E ← J for it, we can split the diagr am 2 in or der to get Andrei Dorman, T obias Heindel 43 E E 1 E 0 J F K J F K and E J E 1 F E 0 K J F K = C [ J → F ← K ] . W ith this lemma we can finally define the rule that corresponds to “parallel composition” of an action with another “process”. Now the S O S B C -system does not only gi ve an analogy to the standard S O S -semantics for C C S , we shall also see that the labels that are deriv ed by the standard B C technique are exactly those labels that can be obtained from the basic actions by compatible contextualization and interface narro wing. In technical terms, the S O S B C -system of T able 1 is sound and complete. • Basic Actions ( D → D ) D → L ← I − − − − − → ( I → R ) where ( L ← I → R ) ∈ S and D → L • Interface Narrowing ( J → G ) J → F ← K − − − − − → ( K → H ) ( J 0 → G ) J 0 → F 0 ← K 0 − − − − − − → ( K 0 → H ) where C = J → J ← J 0 and J 0 → F 0 ← K 0 = C [ J → F ← K ] • Compatible Contextualization ( J → G ) J → F ← K − − − − − → ( K → H ) C [ J → G ] C [ J → F ← K ] − − − − − − → C [ K → H ] where C = J → E ← J compatible with J → F ← K and C = ( J → F ← K )[ C ] T able 1: Axioms and rules of the S O S B C -system. Theorem 3.6 (Soundness and completeness) . Let S be a graph transformation system. Then ther e is a B C -transition ( J → G ) J → F ← K − − − − − → ( K → H ) if and only if it is derivable in the S O S B C -system. The main role of this theorem is not its technical “backbone”, which is similar to many other theorems on the Borro wed Context technique. The main insight to be gained is the absence of any “real” communication between sub-systems; roughly , e very reaction of a state can be “localized” and then deri ved from a basic action (follo wed by contextualization and narro wing). In particular , we do not hav e any counterpart to the communication-rule in C C S , which has complementary actions P − a P 0 and Q − a Q 0 as premises and concludes the possibility of communication of the processes P and Q to perform the silent “internal” transition P k Q − τ P 0 k Q 0 . The main goal is to provide an analysis of possible issues with a counterpart of this rule. 44 SOS for Graph Rewriting 4 The composition rule f or CCS-like systems Process calculi, such as C C S and the π -calculus, hav e a so-called communication rule that allo ws to synchronize sub-processes to perform silent actions. The in v olved process terms hav e complementary actions that allow to interact by a “hand-shake”. Ho wev er, it is an open question ho w such a communication rule can be obtained for general graph transformations systems via the Borrowed Context technique. Roughly , the label of a transition does not contain information about which reaction rule was used to deri ve it; in fact, the same label might be derived using dif ferent rules. Intuitiv ely , we do not know ho w to identify the two hands that ha ve met to shak e hands. T o elaborate on this using the metaphor of handshakes, assume that we have an agent that needs a hand to perform a handshake or to deliver an object. If we observe this agent reaching out for another hand, we cannot conclude from it which of the two possible actions will follow . In general, ev en after the action is performed, it still is not possible to kno w the decision of the agent – without extra information, which might howe ver not be observ able. Ho wev er, with suitable assumptions about the “allo wed actions”, all necessary information might be av ailable. First, we recall from [ 2 ] that D P O B C -diagrams (as defined in Definition 2.7) can be composed under certain circumstances. F act 4.1. Let ( J → G ) J → F ← K − − − − − → ( K → H ) and ( J 0 → G 0 ) J 0 → F 0 ← K 0 − − − − − − → ( K 0 → H 0 ) be two transitions obtained from two D P O B C -diagrams with the same rule ρ = L ← I → R . Then, it is possible to b uild a D P O B C -diagram with the same rule for the composition of J → G and J 0 → G 0 along some common interface J ← J L D → J 0 . T ake the follo wing example as illustration of this f act. Example 4.1 (Composition of transitions) . Let J → G be a state of S ex that contains an edge α with its second connection in the interf ace as sho wn in Figure 3(a). Further , let J 0 → G 0 be a state that contains an edge β with its second connection in the interface as sho wn in Figure 3(b). Both graphs can trigger a reaction from rule α / β / γ . Such a composition is sho wn in Figure 3(c). Hence, we see that is in general possible to combine transitions to obtain ne w transitions. Ho wever , we emphasize at this point, that deriv ability of a counterpart of the communication rule of C C S is not the same question as the composition of pairs of transitions that come equipped with complete B C -diagrams. T o clarify the problem, consider the following e xample where we cannot infer the used rule from the transition label. Example 4.2. Let G be a graph composed of two edges α and β and consider a transition label where an edge γ is “added”. Then it is justified by both rules α / γ and β / γ (see Figure 4). W e shall av oid this problem by restricting to suitable classes of graph transformation systems. More- ov er , for simplicities sake, we shall focus on the deri v ation of “silent” transitions in the spirit of the communication rule of C C S . Definition 4.2 (Silent label) . A label J → F ← K is silent or τ if J = F = K ; a silent transition is a transition with a silent label. Intuiti vely , a silent transition is one that does not induce any “material” change that is visible to an external observ er that only has access to the interface of the states. Hence, in particular , a silent transition does not in volv e additions of the en vironment during the transition. Moreov er , the interface remains Andrei Dorman, T obias Heindel 45 β γ α R 4 G G (a) A first transition α γ β G 0 G 0 R 4 (b) A second transition γ G G α G 0 β R 4 G 0 (c) The composition of the transitions Figure 3: An example of composition. unchanged. This latter requirement does not ha ve an y counterpart in process cal culi, as the interface is gi ven implicitly by the set of all free names. (In graphical encodings of process terms [ 3 ] it is possible to hav e free names in the interface ev en though there is no corresponding input or output prefix in the term.) No w , with the focus on silent transitions, for a given rule L ← I → R we can illustrate the idea of complementary actions as follo ws. If a graph G contains a subgraph D of L and moreover a graph G 0 has the complementary subgraph of D in L in it, then G and G 0 can be combined to obtain a big graph G – the “parallel composition” of G and G 0 – that has the whole left hand side L as a subgraph and thus G can perform the reaction. A natural example for this are Lafont’ s interaction nets where the left hand side consist exactly of two hyper -edges, which in this case are called cells. The intuitiv e idea of complementary (basic) actions is captured by the notion of active pairs . Definition 4.3 (Acti ve pairs) . For any inclusion D → L , where D 6 = L and for all nodes v of D , deg ( v ) > 0 , let the follo wing square be its initial pushout J L D D b D L L , i.e. b D L is the smallest subgraph of L that allo ws for completion to a pushout. W e call b D L the complement of D in L and J L D the minimal interface of D in L and we write { D , D 0 } ≡ L if D 0 = b D L . The set of active 46 SOS for Graph Rewriting β γ β α R 2 (a) A transition from rule α / γ β γ α α R 3 (b) A transition from rule β / γ Figure 4: Same transition label for different rules. pairs is D = { D , b D L } | L ← I → R ∈ R , D → L , D 6 = L , ∀ v ∈ D . deg ( v ) > 0 . Abusing notation, we also denote by D the union of D . It is easy to verify that the complement of b D L in L is D itself and that its minimal interface is also J L D . It is the set of “acceptable” partial matches in the sense that they do not yield a τ -reaction on their o wn. Indeed, if D is equal to L , then the resulting transition of this partial match is a τ -transition. And if it is just composed of vertices, its complement is L and thus not acceptable. Example 4.3 (Acti ve pairs) . In our running example, the set D of our example is in obvious bijection to { α , β } , { α , γ } , { β , γ } , { α , β + γ } , { α + β , γ } , { α + γ , β } . The minimal interface of an y pair is a single verte x. This completes the introduction of preliminary concepts to tackle the issues that ha ve to be resolv ed to obtain “proper” compositionality of transitions. 4.1 T o wards a partial solution Let us address the problem of identifying the rule that is “responsible” for a given interaction. W e start by considering the left inclusions of labels, which intuitively describe possible borrowing actions from the en vironment. Relati ve to this, we define the admissible rules as those rules that can be used to let states e volv e while borro wing the specified “extra material” from the en vironment. Definition 4.4 (Admissible rule) . Let J → G be a state and let J → F be an inclusion (which represents a possible contribution of the context). A rule ρ is admissible (for J → F ) if L 6→ G and it is possible to find D ∈ D and L the left-hand side of ρ , such that the following diagram commutes J L D G J F G c D L \ Andrei Dorman, T obias Heindel 47 where J L D → D is the minimal interface of D in L . W e call D the rule addition . This just means that G can e volv e using the rule ρ if D is added at the proper location. Proposition 4.5 (Precompositionality) . Let J → G J → F ← K − − − − − → K → H and J 0 → G 0 J 0 → F 0 ← K 0 − − − − − − → K 0 → H 0 be two transitions suc h that a single rule ρ is admissible for both, and let D and D 0 be their r espective rule additions. If { D , D 0 } ∈ D , it is possible to compose G and G 0 into a graph G in a way to be able to derive a τ -transition using rule ρ . Pr oof. W e first sho w that in such a case, D 0 → G and the pushout of G ← D 0 → L is e xactly G c . Similarly , D → G 0 and the pushout of G 0 ← D → L is e xactly G 0 c . Then, it is easy to see that it is possible to build the D P O B C -diagram D 1 using rule ρ on G (respecti vely G 0 ) yelding the transition ( J → G ) J → F ← K 1 − − − − − → ( K 1 → H 1 ) for some K 1 , H 1 (respecti vely the D P O B C -diagram D 2 yelding the transition ( J → G ) J → F ← K 2 − − − − − → ( K 2 → H 2 ) for some K 2 , H 2 ), and then compose D 1 and D 2 . This follows from { D , D 0 } ∈ D and G ≡ G c . Indeed, E = L so the top left morphism of the composed D P O B C -diagram is an isomorphism and so are the ones under it, using basic pushout properties. This first result moti vates the follo wing definition. Definition 4.6 ( τ -compatible) . In the situation of Proposition 4.5, we say the two transitions are τ - compatible . Remark 4.1 . In general, in Proposition 4.5, the result of the τ -transition cannot be constructed from H and H 0 ; thus we do not yet speak of compositionality . Example 4.4. Let G be a graph composed of two edges α and γ and G 0 of two edges β and γ (see Figure 5). Then the rule α / β is admissible for both transitions and moreover the y are τ -compatible. The rule α / β yields the respective rule additions. “Glueing” G and G 0 by their interface results in a graph with edges α , β and two γ s; the latter graph can perform a τ -reaction from rule α / β , which howe ver does not gi ve the desired result since the tar get state is not the “expected composition” of H and H 0 . In other words, although we hav e been able to construct a τ -transition, it is not the composition of the original transitions. β γ R 3 α α (a) A transition from rule β / γ γ β β α R 2 (b) A transition from rule α / γ Figure 5: τ -compatible, but not composable: different rules. W e can see from the examples here that the difficulty of defining a composition of transitions comes mainly from three facts. The first is that a partial match can have se veral subgraphs triggering a reaction. This is delt with by the construction of the set of active pairs. The second one is the possibility to connect multiple edges together , not knowing which one exactly is consumed in the reaction. Finally , a giv en edge can hav e multiples ways of triggering a reaction. 48 SOS for Graph Rewriting 4.2 Sufficient conditions W e now gi ve two frame works in which neither of the two last problems do occur . A voiding each of them separately is enough to define compositionality properly . Both cases are inspired by the study of interaction net systems [ 12 , 6 , 14 ], which can be represented in the obvious manner as graph transformation systems. In these systems, the D P O B C -diagram built from an admissible rule of a transition is necessarily the one that has to be used to deri ve the transition. In one case, it works for essentially the same reasons as in C C S : e very acti ve element can only interact with a unique other element, such as a vs. a , b vs. b . In the other one, the label itself is not enough, but since we also kno w where it “connects” to the graph, it is possible to “find” the partner that was in volv ed in the transition. W e introduce interaction graph systems, which are caracterized among other re writing systems by the form of the left-hand sides of the reaction rules, composed of exactly two hyperedges connected by a single node. W e fix a labeling alphabet Λ . Definition 4.7. An activated pair is a hyper graph L on Λ composed of two hyperedges e and f and a node v such that v appears exactly once in cnct ( e ) and once in cnct ( f ) . If v is the i -th incident verte x of e labelled α and the j -th incident verte x of f labelled β , we denote the acti vated pair by e i o n f j and label it by α i o n β j . An inter action gr aph system ( Λ , R ) is gi ven by a set of reaction rules R ov er hyper graphs on Λ where all left-hand side of rules are acti v ated pairs, and nodes are nev er deleted, i.e. for any rule ρ = L ← I → R , • L is an activ ated pair; • for any node v , v ∈ L ⇒ v ∈ I . Note that for an y interaction graph system, the set D is composed of pairs { D , D 0 } where each of them is composed of an edge and its connected vertices. Also the minimal interface of any acti ve pair { D , D 0 } is a single node. It is also the case that it is enough for interfaces to be composed of vertices only . Example 4.5. S I M P L Y W I R E D H Y P E R G R A P H S Lafont interaction nets are historically the first interaction nets. They appear as an abstraction of linear logic proof-nets [ 12 ]. Originally , Lafont nets hav e several particular features, but the one we are interested in is the condition on connecti vity . Definition 4.8. Let N = ( E , V , ` , cnct ) be a hypergraph on Λ . The graph N is simply wired if ∀ v ∈ V , deg ( v ) ≤ 2. When deg ( v ) = 1, we say that v is free . In other words, vertices are only incident to at most two edges of a graph. Note that in this special case no issues arise if we restrict to the sub-category of simply wired hypergraphs. F or this, we argue that the purpose of the interface is the possible addition of extra context; thus, in simply wired hypergraphs, it is meaningless for a verte x that is already connected to two edges to be in the interface. Definition 4.9 (Lafont interaction graph system) . A Lafont interaction gr aph is a simply connected graph such that its interface consists of free v ertices only . A Lafont system L = ( Λ , R ) is gi ven by reaction rules ov er Lafont interaction graphs; it is partitioned if two left-hand sides only overlap tri vially , i.e. for two rules ρ j = L j ← I j → R j ∈ R ( j = 1 , 2 ), either L 1 = L 2 or L 1 ∩ L 2 is the empty graph (without any nodes and any hyperedges). Lemma 4.10. Let L be a partitioned Lafont system, let J → G be a state, let ( J → G ) J → F ← K − − − − − → ( K → H ) be a non- τ transition. Then ther e is exactly one admissible rule for this tr ansition. Example 4.6. H Y P E R G R A P H S W I T H U N I Q U E P A RT N E R S By generalizing Lafont interaction nets, we obtain so called multiwir ed interaction nets. But then we lose the unicity of the rule for a given transition label. It can be recovered by another condition. Andrei Dorman, T obias Heindel 49 Definition 4.11 (Unique partners) . Let I = ( Λ , R ) be an interaction graph system. W e say it is with unique partners if for an y α ∈ Λ and for all i ≤ ar ( α ) , there exists a unique β ∈ Λ and a unique j ≤ ar ( β ) such that α i o n β j is the label of a left-hand side of a rule in R . Lemma 4.12. Let J → G a state of I and ( J → G ) J → F ← K − − − − − → ( K → H ) a non- τ r eaction label. Then ther e is exactly one admissible rule ρ for this transition. Finally , we conclude our inv estigation with the follo wing positi ve result. Theorem 4.13 (Compositionality) . Let ( Λ , R ) be a Lafont interaction gr aph system, or an interaction graph system with unique partner s. Let D be its set of active pairs. Let t 1 = ( J → G ) J → F ← K − − − − − → ( K → H ) and t 2 = ( J 0 → G 0 ) J 0 → F 0 ← K 0 − − − − − − → ( K 0 → H 0 ) be two non- τ transitions and D and D 0 their r espective rule additions. If { D , D 0 } ≡ L ∈ D , let G and H ar e described by the following diagrams J L D J J 0 G G 0 G J R H H 0 H wher e J L D → J and J L D → J 0 ar e the inclusions fr om the admissibility of ρ for states J → G and J 0 → G 0 (Definition 4.4). Then ( J → G ) J → J ← J − − − − → ( J → H ) . Sketc h of pr oof. By Lemma 4.10 or 4.12, there e xists exactly one rule ρ ∈ R with L as a left-hand side that allo ws to deri ve transitions t 1 and t 2 – it is indeed the same rule for both. Let D be the composition diagram of the D P O B C -diagrams justifying the transitions. It is first sho wn that G ≡ G c . Since the upper and lower left squares of D are pushouts we can infer that D ≡ L and J ≡ F . Finally , since no vertex is deleted (see Definition 4.7), we ha ve J → C and thus K ≡ J . So D is a B C -diagram of a τ -reaction from J → G to J → H . In fact, the main property that we ha ve used is the follo wing. Definition 4.14 (Complementarity of Actions) . A graph transformation systems satisfies Complementarity of Actions if for each transition ( J → G ) J → F ← K − − − − − → ( K → H ) there is a unique rule L ← I → R such that there exists a D P O B C -diagram as sho wn to the right. D L I R G G c C H J F K In this situation, we can effecti vely determine if two transitions are τ -compatible. Thus we can deri ve a counterpart of the communication rule of C C S . Hence, if a graph transformation systems satisfies Complementarity of Actions then a rule of the follo wing form is deriv able in S O S B C . t = ( J → G ) J → F ← K − − − − − → ( K → H ) t 0 = ( J → G 0 ) J → F 0 ← K 0 − − − − − − → ( K 0 → H 0 ) ( J → G ) J → J ← J − − − − → ( J → H ) t and t 0 τ -compatible In other words, in a graph transformation system with Complementarity of Actions we can apply the results of [2] to obtain a counterpart to the communication rule. 50 SOS for Graph Rewriting 5 Related and Futur e work On a very general level, the present work is meant to strengthen the conceptual similarity of graph transformation systems and process calculi; thus it is part of a high-le vel research program that has been the theme of a Dagstuhl Seminar in 2005 [ 9 ]. In this wide field, structural operational semantics is occasionally considered as an instance of the tile model (see [ 8 ] for an overvie w). W ith this interpretation, S O S has served as motiv ation for work on operational semantics of graph transformation systems (e.g. [ 5 ]). A ne w perspectiv e on operational semantics, namely the “automatic” generation of labeled transition semantics from reaction rules, has been pro vided by the seminal w ork of Leifer and Milner [ 13 ] and its successors [ 16 , 7 ]; as an example application, we want to mention the “canonical” operational semantics for the ambient calculus [ 15 ]. The main point of the latter work is the focus on the “properly” inductive definition of structural operational semantics. T o the best of our knowledge, there is no recent work on the operational semantics of graph transformation systems that pro vides a general method for the inductiv e definition of operational semantics . This is not to be confused with the inductiv e definition of graphical encodings of process calculi on (global) states. W ith this narro wer perspectiv e on techniques for the “automatic” generation of LT S s, we want to mention that some ideas of our three layer semantics in Section 3 can already be found in [ 3 ], where all rules of the definition of the labelled transition semantics ha ve at most one premise. This is in contrast to the work of [ 15 ] where the labelled transition semantics is deri ved from two smaller subsystems: the process view and the context vie w; the subsystems are combined to obtain the operational semantics. The latter work is term based and it manipulates complete subterms of processes using the lambda calculus in the meta-language. W e conjecture that the use of this abstraction mechanism is due to the term structure of processes. Concerning future work, the first e xtension of the theory concerns more general (hierarchical) graph- like structures as captured by adhesiv e categories [ 10 ] and their generalizations (e.g. [ 4 ]). Moreover , as an orthogonal development, we plan to consider the case of more general rules that are allo wed to hav e an arbitrary (graph) morphism on the right hand side; moreover , also states are arbitrary morphisms. The general rule format is important to model substitution in name passing calculi while arbitrary graph morphisms as states yield more natural representations of (multi-wire) interaction nets. The main challenge is the quest for more general suf ficient conditions that allo w for non-trivial compositions of labelled transitions, which can be seen as a general counterpart of the C C S communication rule. 6 Conclusion W e hav e reformulated the B C technique as the S O S B C -system in T able 1 to make a general analogy to the S O S -rules for C C S . There is no need for a counterpart of the communication rule. W e conjecture that this is due to the “flat” structure of graphs as opposed to the tree structure of C C S -terms. The main contribution concerns questions about the deriv ability of a counterpart of the communication rule. First, we giv e an e xample, which illustrates that the deri vability of such a rule is non-trivial; ho wev er , it is deri vable if the rele vant graph transformation system satisfies Complementarity of Actions . W e have gi ven tw o classes of examples that satisfy this requirement, namely hyper -graphs with unique partners and simply wired hyper-graphs. This is a first step towards a “properly” inducti ve definition of structural operational semantics for graph transformation systems. Acknowledgements W e would like to thank Barbara K ¨ onig, Filippo Bonchi and Paolo Baldan for providing us Andrei Dorman, T obias Heindel 51 with drafts and ideas about a more general research program on compositionality in graph transformation. W e are also grateful for the constructiv e criticism and the helpful comments of the anonymous referees. Refer ences [1] V . Alexie v (1999): Non-deterministic interaction nets . Ph.D. thesis, University of Alberta, Edmonton, Alta., Canada. [2] P . Baldan, H. Ehrig & B. K ¨ onig (2006): Composition and Decomposition of DPO T ransformations with Borr owed Context . In: Proc. of ICGT ’06 (International Conference on Graph Transformation) , Springer , pp. 153–167, doi:10.1007/11841883 12. LNCS 4178. [3] F . Bonchi, F . Gadducci & G. V . Monreale (2009): Labelled transitions for mobile ambients (as synthe- sized via a graphical encoding) . Electronic Notes in Theoretical Computer Science 242(1), pp. 73–98, doi:10.1016/j.entcs.2009.06.014. [4] B. Braatz, H. Ehrig, G. Karsten & U. Golas (2010): F initary M-adhesive cate gories . In: Graph T ransforma- tions: 5th International Conference, ICGT 2010, T wente, the Netherlands, September 27–October 2, 2010, Proceedings , Springer-V erlag, pp. 234–249, doi:10.1007/978-3-642-15928-2 16. [5] Andrea Corradini, Reiko Heckel & Ugo Montanari (2000): Graphical Operational Semantics . In: ICALP Satellite W orkshops , pp. 411–418. [6] T . Ehrhard & L. Regnier (2006): Differ ential inter action nets . Theoretical Computer Science 364(2), pp. 166–195, doi:10.1016/j.tcs.2006.08.003. [7] H. Ehrig & B. K ¨ onig (2006): Deriving Bisimulation Congruences in the DPO Appr oach to Gr aph Rewriting with Borr owed Contexts . Mathematical Structures in Computer Science 16(6), pp. 1133–1163, doi:10.1017/S096012950600569X. [8] F . Gadducci & U. Montanari (2000): The tile model . In Gordon D. Plotkin, Colin Stirling & Mads T ofte, editors: Proof, Language, and Interaction , The MIT Press, pp. 133–166. [9] B. K ¨ onig, U. Montanari & P . Gardner , editors (2005): 04241 Abstracts Collection . Dagstuhl Seminar Proceed- ings 04241, Internationales Begegnungs- und Forschungszentrum f ¨ ur Informatik (IBFI), Schloss Dagstuhl, Germany , Dagstuhl, Germany . A vailable at http://drops.dagstuhl.de/opus/volltexte/2005/27 . [10] S. Lack & P . Soboci ´ nski (2005): Adhesive and quasiadhesive cate gories . RAIR O - Theoretical Informatics and Applications 39(2), pp. 522–546, doi:10.1051/ita:2005028. [11] Y . Lafont (1990): Interaction nets . In: Proceedings of the 17th ACM SIGPLAN-SIGA CT symposium on Princi- ples of programming languages , POPL ’90, A CM, Ne w Y ork, NY , USA, pp. 95–108, doi:10.1145/96709.96718. [12] Y . Lafont (1995): F r om proof-nets to inter action nets . In: Proceedings of the workshop on Advances in linear logic , Cambridge Univ ersity Press, New Y ork, NY , USA, pp. 225–247, doi:10.1017/CBO9780511629150.012. [13] J. J. Leifer & R. Milner (2000): Deriving Bisimulation Congruences for Reactive Systems . In Catus- cia Palamidessi, editor: CONCUR , Lecture Notes in Computer Science 1877, Springer , pp. 243–258, doi:10.1007/3-540-44618-4 19. [14] D. Mazza (2006): Interaction Nets: Semantics and Concurrent Extensions . Ph.D. thesis, Universit ´ e de la M ´ editerran ´ ee & Roma T re. [15] J. Rathke & P . Soboci ´ nski (2010): Deriving structural labelled transitions for mobile ambients . Information and Computation 208, pp. 1221–1242, doi:10.1016/j.ic.2010.06.001. [16] V . Sassone & P . Soboci ´ nski (2003): Deriving Bisimulation Congruences Using 2-cate gories . Nordic Journal of Computing 10(2), pp. 163–183. [17] A. Simpson (2004): Sequent calculi for pr ocess verification: Hennessy-Milner logic for an arbitrary GSOS . Journal of Logic and Algebraic Programming 60–61, pp. 287–322, doi:10.1016/j.jlap.2004.03.004.
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment