• Non ci sono risultati.

Concatenable Graph Processes

Nel documento Chapter 3 (pagine 36-40)

3.4 Process Semantics

3.4.2 Concatenable Graph Processes

A concatenable graph process is a graph process equipped with two isomor-phisms relating its source and target graphs to the corresponding canonical graphs. The two isomorphisms allow us to define a deterministic operation of sequential composition of processes consistent with causal dependencies, which

is then exploited to define a category CP[G] having abstract graphs as objects and concatenable processes as arrows.

Definition 3.4.13 (concatenable process)

Let G = hT G, Gs, P, πi be a typed graph grammar. A concatenable process (c-process) for G is a triple

cp = hm, p, M i

where p is a process and m : Can(M in(p)) → M in(p), M : Can(M ax(p)) → M ax(p) are isomorphisms (of T G-typed graphs). We denote with M in(cp) and M ax(cp) the graphs M in(p) and M ax(p).

If the occurrence grammar Op associated to the process has an empty set of productions (and thus M in(p) = M ax(p) = T Gp), the c-process cp is called a discrete process and denoted as SymG(m, hT Gp, mgpi, M ).f

It should be noted that the two isomorphisms to the source and target graphs of a process play the same rˆole of the ordering on maximal and minimal places of concatenable processes in Petri net theory [22]. From this point of view, concatenable graph processes are related to the graph processes of [16] in the same way as the concatenable processes of [22] are related to the classical Goltz-Reisig processes for P/T nets [9].

The notion of isomorphism between c-processes is the natural generalization of that of graph processes isomorphism, namely the mapping between the type graphs of the two processes is required to be “consistent” with the decorations.

Definition 3.4.14 (isomorphism of c-processes)

Let cp1 = hm1, p1, M1i and cp2= hm2, p2, M2i be two c-processes of a gram-mar G. An isomorphism between cp1 and cp2 is an isomorphism of processes hf g, f pi : p1→ p2such that the following diagrams commute: restrictions of f g to the corresponding graphs.g If there exists an isomorphism

fWe omit the typing morphism mg and denote the discrete process as SymG(m, T Gp, M ), when this cannot generate confusion.

gAs shown in Corollary 3.4.12, for each pair of isomorphic processes p1 and p2 the cor-responding Min and Max graphs are isomorphic as well, i.e., M in(p1) ' M in(p2) and M ax(p1) ' M ax(p2)

f : cp1→ cp2 we say that cp1 and cp2 are isomorphic and we write cp1∼= cp2. Definition 3.4.15 (abstract c-process)

An abstract c-process is an isomorphism class of c-processes. It is denoted by [cp], where cp is a member of that class.

Proposition 3.4.16

Let G be a graph grammar and let SymG(mj, T Gj, Mj), for j = 1, 2, be two discrete processes, with T G1' T G2. Then they are isomorphic if and only if

m−11 ◦ M1= m−12 ◦ M2. Proof

First of all let us notice that in the case of discrete processes, since the sets of productions are empty and M in(Oj) = M ax(Oj) = T Gj, using the fact that T G1' T G2, the isomorphism conditions reduce to the existence of a (typed) graph isomorphism f g : hT G1, mg1i → hT G2, mg2i such that the following diagram commutes:

T G1

f g



Can(T G1) k Can(T G2)

ml1lll 55l l

mR2RRR ))R R

Can(T G1) k Can(T G2)

M1

iiRRRRRR

M2

uullllll T G2

Now if m−11 ◦ M1= m−12 ◦ M2then we can define f g = M2◦ M1−1 = m2◦ m−11 . Viceversa if the discrete processes are isomorphic then, by commutativity of the above diagram, we conclude that m−11 ◦ M1= m−12 ◦ M2. 2 By the previous proposition, an abstract discrete process [SymG(m, T G, M )]

can be characterized as:

{SymG(m0, T G, M0) | T G ' T G0, m0−1◦ M0 = m−1◦ M }.

The isomorphism m−1◦ M is called the automorphism on Can(T G) induced by the (abstract) discrete process.

Given two concatenable processes cp1and cp2such that the target graph of the first one and the source graph of the second one, as well as the corresponding decorations, coincide, we can concatenate them by gluing the type graphs along the common part.

Definition 3.4.17 (sequential composition)

Let G = hT G, Gs, P, πi be a typed graph grammar and let cp1= hm1, p1, M1i and cp2 = hm2, p2, M2i be two c-processes for G, such that M ax(cp1) =

M in(cp2) and M1 = m2. Suppose moreover that the type graphs of cp1 and cp2 overlap only on M ax(cp1) = M in(cp2) and suppose also Pp1 and Pp2 dis-joint. Then the concrete sequential composition of cp1 and cp2, denoted by cp1; cp2 is defined as

cp = hm1, p, M2i,

where p is the (componentwise) union of the processes p1 and p2. More pre-cisely the type graph T Gp is

T Gp= hNT Gp1∪ NT Gp2, ET Gp1∪ ET Gp2, s1∪ s2, t1∪ t2i,

where si and ti are the source and target functions of the graph T Gpi for i ∈ {1, 2}, and analogously the typing morphism mgp= mgp1∪mgp2. Similarly Pp= Pp1∪ Pp2, πp = πp1∪ πp2, mpp= mpp1∪ mpp2 and ιp= ιp1∪ ιp2. Finally, the start graph is G0s= M in(cp1).

It is not difficult to check that the sequential composition cp1; cp2 is a well-defined c-process. First of all Op is an occurrence grammar. In fact, T Gp1 and T Gp2 overlap only on M ax(cp1) = M in(cp2) and thus it is immediate to see that the causal relation ≤p on Op is a partial order. Such relation can be expressed as the transitive closure of the union of the causal orders of the two processes with a “connection relation” rc, suitably relating productions of cp1

which use items of M ax(cp1) with productions of cp2using the corresponding items of M in(cp2). Formally, ≤p= (≤p1 ∪ ≤p2 ∪ rc), where relation rc ⊆ Pp1× Pp2 is defined by

rc=



hq1, q2i | ∃x ∈ M ax(cp1) = M in(cp2).

x ∈ (q1q2) ∪ (q1q2) ∪ (q1∩ q2)

 .

A routine checking allows us to conclude that Conditions 1 − 4 of the definition of occurrence grammar are satisfied. In particular M in(cp0) = M in(cp1) = G0s and each element in Items(T Gp) is created (consumed) by at most one productions since elements “shared” by the original processes can be created only in cp1 and consumed only in cp2. Finally, the validity of conditions regarding φp (see Definition 3.4.9) easily follows from the way it is defined using φp1 and φp2.

The reader could be surprised and somehow displeased by the restrictiveness of the conditions which have to be satisfied in order to be able to compose two concrete processes. To understand our restriction one should keep in mind that the notion of sequential composition on concrete processes is not interesting in itself, but it is just introduced to be lifted to a meaningful notion of sequential composition on abstract processes. Since the restricted definition fulfills this

aim, we found it better to avoid a technically more involved (although more general) definition, leading to a non-deterministic result. As in the case of derivations, in fact, processes can be seen up to renaming of the items in their components and thus, if M ax(cp1) ' M in(cp2), we can always rename the items of cp2 to make the sequential composition defined.

Proposition 3.4.18

Let G = hT G, Gs, P, πi be a typed graph grammar and let cp1 ∼= cp01 and cp2∼= cp02be c-processes for G. Then (if defined) cp1; cp2∼= cp01; cp02.

Proof

Just notice that if fj = hf gj, f pji : cpj → cp0j (j = 1, 2) are c-process isomor-phisms, then the isomorphism between cp1; cp2 and cp01; cp02 can be obtained

as hf g1∪ f g2, f p1∪ f p2i. 2

By the previous proposition we can lift the concrete operation of sequential composition of c-processes to abstract processes:

[cp1] ; [cp2] = [cp01; cp02]

for cp01∈ [cp1] and cp02∈ [cp2] such that the concrete composition is defined.

Definition 3.4.19 (category of concatenable processes)

Let G = hT G, Gs, P, πi be a typed graph grammar. We denote with CP[G]

the category of (abstract) c-processes having abstract graphs typed over T G as objects and abstract c-processes as arrows. An abstract c-process [cp] is an arrow from [M in(cp)] to [M ax(cp)]. The identity on an abstract graph [G] is the discrete process [SymG(i, G, i)] (where i : Can(G) → G is any isomorphism), whose induced automorphism is identity.

A routine checking proves that the operation o5f sequential composition on c-processes is associative and that [SymG(i, G, i)] satisfies the identity axioms.

Nel documento Chapter 3 (pagine 36-40)