• Non ci sono risultati.

Relating processes and unfolding

9. PROCESSES AND UNFOLDING

9.3. Relating processes and unfolding

LetN = hS, T, F, C, mi be a c-net and consider the comma category (m ↓ CP[N ]). The objects of such category are concatenable processes ofN starting from the initial marking.

An arrow exists from a processδ1toδ2if the second one can be obtained by concatenating the first one with a third processδ. This can be interpreted as a kind of prefix ordering.

Lemma 9.1. For any c-netN = hS, T, F, C, mi the comma category (m ↓ CP[N ]) is a preorder.

Proof. Let δi : m → Mi (i ∈ {1, 2}) be two objects in (m ↓ CP[N ]), and suppose there are two arrows δ, δ′′ : δ1 → δ2. By definition of comma category δ1; δ = δ1; δ′′ = δ2, which, by definition of sequential composition, easily implies δ= δ′′.

In the sequel the preorder relation over(m ↓ CP[N ]) (induced by sequential composi-tion) will be denoted by.N or simply by., when the netN is clear from the context.

Therefore we writeδ12if there existsδ such that δ1; δ = δ2.

We provide an alternative characterization of the preorder relation.N which will be useful in the sequel. It essentially formalizes the intuitive idea that the preorder on(m ↓ CP[N ]) is a generalization of the prefix relation. First, we need to introduce the notion of left-injection for processes.

Definition 9.38 (left injection). Letδi : m → Mi(i ∈ {1, 2}) be two objects in (m ↓ CP[N ]), with δi= hµi, πi, νii. A left injection ι : δ1→ δ2is a morphism of marked processesι : π1→ π2, such that

1. ι is consistent with the indexing of minimal places, namely µ1(s) = µ2(ι(s)) for all s ∈ min(π1);

2. ι is “rigid” on transitions, namely for t2 inOπ2 andt1inOπ1, ift2 ր ι(t1) then t2= ι(t1) for some t1inOπ1.

The name “injection” is justified by the fact that a morphismι between marked determin-istic processes (being a morphism between the underlying determindetermin-istic occurrence c-nets) is injective on places and transitions, as it can be shown easily by using the properties of (occurrence) c-nets morphisms proved in Section 5. The word “left” is instead related to the requirement of consistency with the decoration of the minimal items. Finally, the rigidity of the morphism ensures thatδ2does not extendδ1with transitions inhibited inδ1. Lemma 9.2. Letδi : m → Mi (i ∈ {1, 2}) be two objects in (m ↓ CP[N ]), with δi= hµi, πi, νii. Then

δ12 iff there exists a left injectionι : δ1→ δ2.

Proof. (⇒) Let δ12, namelyδ2= δ1; δ for some process δ = hµ, π, νi. Without loss of generality, we can imagine thatπ2is obtained as the componentwise union ofπ1and π and this immediately gives a morphism of marked processes (the inclusion) ι : π1→ π2, consistent with the indexing of minimal places. To conclude it remains only to show thatι is rigid. Suppose thatt2ր ι(t1) for some transitions t1inOπ1andt2inOπ2, and thus, by

54

Definition 5.23, eithert2 ι(t1) or t2 < ι(t1). To conclude that ι is rigid we must show that in both casest2is inOπ1.

• If t2 ι(t1), since the process π2is deterministic,t2andι(t1) cannot be in conflict and thus it must bet2ι(t1) 6= ∅. Since t2uses as context a place which is not maximal inOπ1, necessarilyt2is inOπ1, otherwise it could not be added by concatenatingπ to π1.

• If t2 < ι(t1) then we can find a transition t3 inOπ2 such that t2 < t3 andt3∩ (ι(t1) ∪ ι(t1)). As above, t3must be inOπ1since it uses as postcondition a place inOπ1. An inductive reasoning based on this argument shows that alsot2is inOπ1.

(⇐) Let ι : δ1 → δ2be a left injection. We can suppose without loss of generality that Oπ1is a subnet ofOπ2, in such a way thatι is the inclusion and µ1= µ2. LetOπbe the net (Oπ2\ Oπ1) ∪ max(Oπ1), where difference and union are defined componentwise. More preciselyOπ= hS, T, F, Ci, with:

• S = (S2\ S1) ∪ max(π1)

• T = T2\ T1

• the relations F and C are the restrictions of F2andC2toT .

It is easy to see thatOπis a well-defined occurrence c-net andmin(Oπ) = max(Oπ1). In particular, the fact thatF is well-defined namely that if t ∈ T thent, t⊆ S immediately derives from the fact that the inclusionι is a morphism of deterministic occurrence c-nets.

On the other hand the well-definedness ofC is related to the fact that the injection is rigid.

In fact, lets ∈ t for t ∈ T and suppose that s 6∈ S. Therefore s ∈ t1, for somet1 ∈ T1

and thust ր t1, which, by rigidity, impliest ∈ T1, contradictingt ∈ T .

Therefore if we denote byδ the concatenable process hν1, π, ν2i, then δ1; δ = δ2, and thus δ12.

We can now show that the ideal completion of the preorder(m ↓ CP[N ]) is isomorphic to the domain obtained from the unfolding of the netN , namely La(Ea(Ua(N ))). Besides exploiting the characterization of the preorder relation on(m ↓ CP[N ]) given above, the result strongly relies on the description of the unfolding construction as chain of adjunctions.

First, it is worth recalling some definitions and results on the ideal completion of (pre)orders.

Definition 9.39 (ideal). LetP be a preorder. An ideal of P is a subset S ⊆ P , directed and downward closed (namelyS =S{↓ x | x ∈ S}). The set of ideals of P , ordered by subset inclusion is denoted by Idl(P ).

Given a preorderP , the partial order Idl(P ) is an algebraic cpo, with compact elements K(Idl(P )) = {↓ p | p ∈ P }. Moreover Idl(P ) ≃ Idl(P/), where P/ is the partial order induced by the preorder P . Finally, recall that if D is an algebraic cpo, then Idl(K(D)) ≃ D.

Lemma 9.3. LetP1andP2be preorders and letf : P1→ P2be a surjective function such thatp1⊑ p1ifff (p1) ⊑ f (p1). Then the function f: Idl(P1) → Idl(P2), defined by f(I) = {f (x) | x ∈ I}, for I ∈ Idl(P1), is an isomorphism of partial orders.

Proof. The functionfis surjective since for every idealI2∈ Idl(P2) it can be easily proved thatf−1(I2) is an ideal and f(f−1(I2)) = I2 by surjectivity off . Moreover,

55

notice that ifI1, I1 ∈ Idl(P1) are two ideals then I1 ⊆ I1 if and only iff(I1) ⊆ f(I1).

The right implication is obvious. For the left one, assumef(I1) ⊆ f(I1). Then observe that if x ∈ I1 then f (x) ∈ f(I1) ⊆ f(I1). Hence there exists x ∈ I1 such that f (x) = f (x). Thus by hypothesis on f we have x ⊑ x and therefore, by definition of ideal,x ∈ I1.

Then we can conclude thatfis also injective, thus it is a bijection, and clearlyfas well as its inverse are monotone functions.

Notice that in particular, ifP is a preorder, D is an algebraic cpo and f : P → K(D) is a surjection such thatp ⊑ pifff (p) ⊑ f (p), then Idl(P ) ≃ Idl(K(D)) ≃ D.

We can now prove the main result of this section, which establishes a tight relationship between the unfolding and the process semantics of semi-weighted c-nets. We show that the ideal completion of the preorder(m ↓ CP[N ]) and the domain associated to the net N through the unfolding construction are isomorphic. To understand which is the meaning of taking the ideal completion of the preorder(m ↓ CP[N ]), first notice that the elements of the partial order induced by the preorder(m ↓ CP[N ]) are classes of concatenable processes with respect to an equivalence≡ldefined byδ1l δ2if there exist a discrete concatenable processδ such that δ1; δ = δ2. In other words,δ1lδ2can be read as “δ1and δ2left isomorphic”, where “left” means that the isomorphism is required to be consistent only with respect to the ordering of the minimal places. Since the netN is semi-weighted, the equivalence≡lturns out to coincide with isomorphism of marked processes. In fact, being the initial marking of N a set, only one possible ordering function exists for the minimal places of a marked process. Finally, since processes are finite, taking the ideal completion of the partial order induced by the preorder(m ↓ CP[N ]) (which produces the same result as taking directly the ideal completion of(m ↓ CP[N ])) is necessary to move from finite computations to arbitrary ones.

Theorem 9.1 (unfolding vs. concatenable processes). Let N be a semi-weighted c-net. Then Idl((m ↓ CP[N ])) is isomorphic to the domain La(Ea(Ua(N ))).

Proof. LetN = hS, T, F, C, mi be a c-net. It is worth recalling that the compact ele-ments of the domainLa(Ea(Ua(N ))), associated to N , are exactly the finite configurations ofEa(Ua(N )) (see Theorem 3.1). By Lemma 9.3, to prove the thesis it suffices to show that it is possible to define a functionξ : (m ↓ CP[N ]) → K(La(Ea(Ua(N )))) such that f is surjective, and for allδ1, δ2in(m ↓ CP[N ]),

δ12 iff ξ(δ1) ⊑ ξ(δ2).

The functionξ can be defined as follows. Let δ = hµ, π, νi be a concatenable process in (m ↓ CP[N ]). Since π is a marked process of N (and thus a c-net morphism π : Oπ → N ), by the universal property of coreflections, there exists a unique arrowπ : Oπ → Ua(N ), making the diagram below commute.

Ua(N ) fN N

Oπ

π π

56

In other words, the coreflection between SW-CN and O-CN gives a one-to-one correspon-dence between the (marked) processes ofN and of those of its unfolding Ua(N ).

Then we defineξ(δ) = πT(Tπ), where Tπ is the set of transitions ofOπ. To see that ξ is a well defined function, just observe that it could have been written, more precisely, as Ea(Ua(π))(Tπ) and Tπ is a configuration of Ea(Ua(Oπ)) = Ea(Oπ) since Oπ is a deterministic occurrence c-net.

• ξ is surjective

LetC ∈ K(La(Ea(Ua(N )))) be a finite configuration. Then C determines a deterministic processπC : OπC → Ua(N ) of the unfolding of N , having C as set of transitions.11 Thus π = fN ◦ πC is a deterministic process ofN , and, by the definition of ξ, we immediately get thatξ(π) = πC (TπC) = C.

• ξ is monotone

Letδ1andδ2be processes in(m ↓ CP[N ]) and let δ12. Then, by Lemma 9.2, there exists a left-injectionι : δ1→ δ2. The picture below illustrates the situation, by depicting also the processesπ1 andπ2of the unfolding ofN , induced by π1andπ2, respectively.

Ua(N ) fN N

Oπ2

π2

π2

Oπ1

ι

π1 π1

We have thatξ(δ1) = π1(Tπ1) = π2(ι(Tπ1)) ⊆ π2(Tπ2) = ξ(δ2). Therefore, to conclude thatξ(δ1) ⊑ ξ(δ2) we must show that also the second condition of Definition 3.14 is satisfied. Lett2∈ ξ(δ2) and t1∈ ξ(δ1), with t2ր t1. By definition ofξ, ti= πi(ti) with tiinOπi, fori ∈ {1, 2} and thus:

π2(t2) ր π1(t1) = π2(ι(t1))

By properties of occurrence net morphisms (Theorem 5.1 and the fact thatOπ2 is deter-ministic), this impliest2 ր ι(t1) and thus, since ι is a left injection, by rigidity t2= ι(t) for somet in Oπ1. Thereforet2= π2(t2) = π2(ι(t)) = π1(t) belongs to ξ(δ1), as desired.

• ξ(δ1) ⊑ ξ(δ2) implies δ12.

Letξ(δ1) ⊑ ξ(δ2). The inclusion ξ(δ1) ⊆ ξ(δ2), immediately induces a mapping ι of the transitions ofOπ1 into the transitions of Oπ2, defined byι(t1) = t2 ifπ1(t1) = π2(t2) (see the picture above). This function is well-defined since processes are deterministic and thus morphismsπi are injective. Since the initial marking ofN is a set, the mapping of min(π1) into min(π2) is uniquely determined and thus ι uniquely extends to a (marked) process morphism betweenπ1 andπ2. Again for the fact thatN is semi-weighted (and thus there exists a unique indexing for the minimal places of each process starting from the

11Essentially Oπ

C is the obvious subnet ofUa(N ) having C as set of transitions and πCis an inclusion.

57

initial marking) such morphism is consistent with the indexing of minimal places. Finally, ι is rigid. In fact, let t2ր ι(t1), for t1inOπ1 andt2inOπ2. By properties of occurrence c-net morphisms (Lemma 5.3),π2(t2) ր π2(ι(t1)). The way ι is defined implies that π2(ι(t1)) = π1(t1), and thus

π2(t2) ր π1(t1).

Since πi(ti) ∈ ξ(δi) for i ∈ {1, 2}, by definition of the order on configurations, we immediately have thatπ2(t2) ∈ ξ(δ1), hence there is t1inOπ1such thatπ1(t1) = π2(t2), and thusι(t1) = t2.

By Lemma 9.2, the existence of the left injectionι : δ1→ δ2, impliesδ12.