• Aucun résultat trouvé

Low- and High-Level Petri Nets with Individual Tokens

N/A
N/A
Protected

Academic year: 2021

Partager "Low- and High-Level Petri Nets with Individual Tokens"

Copied!
82
0
0

Texte intégral

(1)

Forschungsberichte

der Fakultät IV – Elektrotechnik und Informatik

Low- and High-Level Petri Nets with Individual Tokens

Tony Modica, Karsten Gabriel, Hartmut Ehrig, Kathrin Hoffmann, Sarkaft Shareef, Claudia Ermel,

Ulrike Golas, Frank Hermann, Enrico Biermann

Bericht-Nr. 2009-13 ISSN 1436-9915

(2)
(3)

Low- and High-Level Petri Nets with Individual Tokens

Tony Modica, Karsten Gabriel, Hartmut Ehrig, Kathrin Hoffmann, Sarkaft Shareef, Claudia Ermel,

Ulrike Golas, Frank Hermann, Enrico Biermann

Bericht-Nr. 2009/13

ISSN 1436-9915

(4)
(5)

Technical Report 13/2009

Low- and High-Level Petri Nets with Individual Tokens

Tony Modica, Karsten Gabriel, Hartmut Ehrig, Kathrin Homann, Sarkaft Shareef, Claudia Ermel,

Ulrike Golas, Frank Hermann, Enrico Biermann E-Mail: {modica,kgabriel,ehrig,homann,sarkaft,

lieske,ugolas,frank,enricob}@cs.tu-berlin.de July 8, 2010

TFS - Fakultät IV - Elektrotechnik und Informatik Technische Universität Berlin

This work has been supported by the Integrated Graduate Program on Human-Centric Communi- cation at TU Berlin and by the research project forMAlNET(see http://tfs.cs.tu-berlin.de/

formalnet/) of the German Research Council.

1

(6)

2

Abstract

In this article, we present a new variant of Petri nets with markings called Petri nets with individual tokens, together with rule-based transformation following the double pushout approach. The most important change to former Petri net transformation approaches is that the marking of a net is no longer a collective set of tokens, but each each has an own identity leading to the concept of Petri nets with individual tokens. This allows us to formulate rules that can change the marking of a net arbitrarily without necessarily manipulating the structure. As a rst main result that depends on nets with individual markings we show the equivalence of transition ring steps and the application of ring-simulating rules.

We dene categories of low-level and of algebraic high-level nets with indi- vidual tokens, called PTI nets and AHLI nets, respectively, and relate them with each other and their collective counterparts by functors.

To be able to use the properties and analysis results of M-adhesive HLR systems (formerly know as weak adhesive high-level replacement systems) we show in further main results that both categories of PTI nets and AHLI nets areM-adhesive categories. By showing how to construct initial pushouts we also give necessary and sucient conditions for the applicability of transfor- mation rules in these categories, known as gluing condition in the literature.

(7)

CONTENTS 3

Contents

1. Introduction 4

1.1. The Notion of Individual Tokens . . . 5

2. Place/Transition Nets with Individual Tokens 6

2.1. Denition and Firing Behavior . . . 6 2.2. Transformation of PTI Nets . . . 9 2.3. Correspondence of Transition Firing and Rules . . . 13

3. Algebraic High-Level Nets with Individual Tokens 18

3.1. Denition and Firing Behavior . . . 18 3.2. Transformation of AHLI Nets . . . 23 3.3. Correspondence of Transition Firing and Rules . . . 28

4. Functors for Individual Net Classes 35

5. Nets with Individual Tokens are M-adhesive Categories 41

6. Conclusion 43

7. Future Work 44

A. Appendix 49

A.1. Categorical Gluing Condition with Initial Pushouts . . . 49 A.2. Initial Pushouts inSets . . . 56 A.3. Initial Pushouts inPTNets . . . 61

B. Proofs 63

(8)

4 1. INTRODUCTION

1. Introduction

Petri nets are one of the main formalisms to describe and analyze concurrent processes [Rei85a]. To be able to utilize them in modeling of additional complex aspects, a lot of work has been done so far to extend the classical Petri nets or to integrate them with other formal techniques.

One of those challenging extensions is the manipulation of running processes, which has been formulated under the notion of adaptive workows [vdABV+99]. In the past, several approaches have been proposed that tried to deal with this aspect of process modeling by using Petri nets that can change their ring behavior, e.g. self-modifying nets [Val78], mobile nets [AB09], recursive nets [HP00, HB08], and nets with dynamic transition renement [KR07].

In this article, we concentrate on the approach to combine Petri nets with transforma- tion rules based on graph transformation [EEPT06], which has been applied to adaptive workows in [HME05, BDHM06]. This exploits the graph-like structure of Petri nets and allows us to formulate rules to change the structure of a Petri net [EHP+08]. In general, rule-based Petri net transformation can also be applied to Petri systems, i.e. Petri nets with a marking, which is especially useful for manipulation of processes at runtime.

Petri nets have been shown in [EEPT06, EHP+08] to be dene a weak adhesive HLR category for the classM of all injective net morphisms. This allows us to apply all the results for adhesive HLR systems shown in [EEPT06] also for Petri net transformation systems. In this paper, we use the short notion M-adhesive category for weak ad- hesive HLR category. the concept of Petri systems leads to a category PTSys with morphisms allowing to increase the number of tokens on corresponding places. Unfortu- nately,(PTSys,Minj)with the classMinj of all injective morphisms is notM-adhesive in contrast to(PTSys,Mstrict), whereMstrict is the class of injective morphisms where the number of tokens on corresponding places is equal. This, however, is an unpleas- ant restriction for the usability of the transformation approach, especially the ring of a transition cannot be simulated in a natural way by the application of a corresponding transition rule.

To overcome this restriction we present a new Petri net formalism, called Petri nets with individual tokens, together with a rule-based transformation approach that is al- most equivalent to [EHP+08]1. The most important change is that a net's marking is no longer a (collective) sum of a monoid but a set of individuals. This allows us to formu- late rules that can change the marking of a net arbitrarily so that, as major advantage, ring of nets can be modeled by rule applications.

As a main result we will show that Petri nets with individual tokens are M-adhesive systems with all their nice properties.

With individual tokens, the category of Petri systems is even closer to typed attributed graphs, which opens an elegant way to simulate Petri net transformations with graph

1The approach in [EHP+08] follows the concept Petri nets are monoids [MM90] so that a net and its marking are represented as sets and monoids over these sets, rather than e.g. with an explicit ow relation. This makes it easier to handle categories of Petri nets and systems.

(9)

1.1. THE NOTION OF INDIVIDUAL TOKENS 5 transformation tools [Syl09].

In Sect. 2, we introduce low-level Petri nets with individual tokens and dene rule- based transformation. As a main result we show the equivalence of transition ring steps and the application of ring-simulating rules.

In Sect. 3, we lift the denitions and results of Sect. 2 to high-level nets that have data elements of an algebra [EM85] as tokens rather than low-level black tokens. The rst approach of inscripting Petri nets with algebraic terms was developed in [Rei91], however, we use the approach of [EPR93], which allows us to use an arbitrary algebra, as long as it complies to the given signature.2

Section 4 relates the Petri net classes of Sect. 2 and 3 with each other and with their collective counterparts by functors and we show a compatibility result for these functors.

We dene M-adhesive systems for both low and high-level Petri nets with individual tokens in Sect. 5 and discuss the results and some nal remarks in the last sections.

1.1. The Notion of Individual Tokens

The term of individual tokens has been used in two senses for Petri nets so far:

1. It was mentioned rst in [Rei85b], where it was used to describe tokens that can be identied as individual objects. The main contribution of this article was to dene markings as multisets of distinguished elements rather than amounts of indistinguishable black tokens. In the end, individual tokens in this context is a synonym for what by now is called high-level tokens. This is not our intended meaning of individuality, moreover we will consider both low-level and high-level Petri nets with individual tokens.

2. The other notion of token individuality has been coined in [vGP95]3 as individual token interpretation of ring steps, which entitles the denition of processes in [GR83].

In [vG05], the author investigates the collective-individual dichotomy of ring steps, where under the individual approach ring sequences consider not only the number and value of tokens (as in the collective approach) but also the history, i.e. the origin tran- sition, of tokens. [BMMS99] introduces a category of Petri nets to be interpreted with a functorial individual semantics.

Individual tokens in this article The Petri net approach we present in this article is related to 2., but in contrast, we will already introduce individual tokens in the (syntac- tical) denition of the Petri nets (and their category) themselves, so that we can exploit the individuality of tokens in the transformation approach, independently of the ring rule. The individual ring rule of [vG05] is very close to the one presented in the next sections, but it is still an interpretation of ring steps of a classic representation of Petri nets.

2Both articles consider algebraic specications with equations instead of signatures (which can be understood as specications without equations). In this article we take into account signatures only.

3Meanwhile, there is an updated version of this article: [vGP09].

(10)

6 2. PLACE/TRANSITION NETS WITH INDIVIDUAL TOKENS The main purpose of our notion of nets with individual tokens is the possibility of formulating marking-changing rules for this kind of nets. We have demonstrated the practicability of such a transformation approach with modeling case studies on applica- tions to Communication Spaces [BEE+09, Mod10, MEE+10].

2. Place/Transition Nets with Individual Tokens

In this section we treat low-level Petri nets and equip them with markings of individual tokens. After describing their ring behavior and introducing rules for the transformation of marked nets we show how special transformations correspond to transition ring steps.

2.1. Denition and Firing Behavior

With the denition of nets with individual tokens, we follow the concept Petri nets are monoids from [MM90]:

Denition 2.1 (Place/Transition Nets with Individual Tokens (PTI)).

We dene a marked P/T net with individual tokens, short PTI net, as NI = (P, T, pre, post, I, m),

where

• N = (P, T, pre, post : T → P) is a classical P/T net, where P is the free commutative monoid overP,

• I is the (possibly innite) set of individual tokens ofNI, and

• m:I →P is the marking function, assigning the individual tokens to the places.

Further, we introduce some additional notations:

• the environment of a transitiont∈T asEN V(t) =P RE(t)∪P OST(t)⊆P with PRE(t) ={p∈P|pre(t)(p)6= 0},

POST(t) ={p∈P|post(t)(p)6= 0},

Example. Figure 1 on the facing page shows the graphical representation of a PTI net withI ={x1, y1, x2, x3},m(x1) =m(y1) =p1,m(x2) =p2,m(x3) =p3.

Now that we have marked Petri nets, also called Petri systems, we have to dene their behavior as ring steps. Because we have individual tokens, we have to consider a possible ring step in the context of a selection of tokens.

Denition 2.2 (Firing of PTI Nets).

A transition t∈T in a PTI net NI = (P, T, pre, post, I, m)

is enabled under a token selection (M, m, N, n), where

(11)

2.1. DEFINITION AND FIRING BEHAVIOR 7

t p1

p2

p3 2

x1

y1

x2

x3

Figure 1: Example PTI net

• M ⊆I,

• m is the token mapping ofNI,

• N is a set with (I\M)∩N =∅,

• n:N →P is a function,

if it meets the following token selection condition:

"

X

i∈M

m(i) =pre(t)

#

"

X

i∈N

n(i) =post(t)

#

If an enabled tres, the follower marking (I0, m0) is given by I0= (I\M)∪N, m0 :I0 →P withm0(x) =

(m(x), x∈I \M n(x), x∈N

leading to NI0 = (P, T, pre, post, I0, m0) as the new PTI net in the ring step NI i−→t NI0 via (M, m, N, n).

Remark (Token Selection). The purpose of the token selection is to specify exactly which tokens should be consumed and produced in the ring step. Thus, M ⊆ I selects the individual tokens to be consumed, and N contains the set of individual tokens to be produced. Clearly, (I \M) ∩N = ∅ must hold because it is impossible to add an individual token to a net that already contains this token. mand nrelate the tokens to their carrying places. It would be sucient to consider only the restriction m|M here or to infer it from the net but as a compromise on symmetry and readability we denote m in the token selection.

For the next subsection we need a category of Petri systems.

Denition 2.3 (PTI Net Morphisms and Category PTINets).

Given two PTI nets NIi = (Pi, Ti, prei, posti, Ii, mi), i∈ {1,2}, a PTI net morphism is a triple of functions f = (fP :P1 → P2, fT :T1 → T2, fI :I1 → I2) : NI1 → NI2, such that the following diagrams commute (componentwise for prei and posti):

(12)

8 2. PLACE/TRANSITION NETS WITH INDIVIDUAL TOKENS

T1

fT

pre1 //

= post1

//P1

fP

I1

fI

m1 //

=

P1

fP

T2

pre2 //

post2

//P2 I2

m2 //P2

or, explicitly, thatfP◦pre1 =pre2◦fT, fP◦post1=post2◦fT, fP ◦m1=m2◦fI. The categoryPTINetsconsists of all PTI nets as objects with all PTI net morphisms.

Remark. For a general PTI net morphismf we do not require that its token component fIis injective in order to have pushouts, pullbacks, and aM-adhesive category. But later we may require injectivity of fI for rule and match morphisms and to have morphisms preserving ring behavior.

Fact 2.4 (Construction of Pushouts inPTINets).

Pushouts in PTINets are constructed componentwise in PTNets and Sets. So, (1) is a PO in PTINets i (2) is a PO in PTNets and (3) is a PO in Sets with the components of thePTINets morphisms, where m3 :I3 → P3 is induced by PO object I3 in the commuting cube below (whose front is the PO of place sets).

NI0

f1 //

f2

(1)

NI1 g1

NI2 g

2

//NI3

N0 f

0

1 //

f20

(2)

N1

g01

N2 g20

//N3

I0 f1I //

f2I

(3)

I1

g1I

I2 g2I

//I3

I0 f1I //

f2I

m0

I1

g1I

m1

P0

f1P //

f2P

P1

g1P

I2 g

2I

//

m2

I3

m3

P2 g2P //P3

If f1X, forX ∈ {P, T, I}, is injective then g2X is as well; analogously for components off2 andg1.

Example. Figure 2 on page 14 shows two pushouts in PTINets.

Fact 2.5 (Construction of Pullbacks inPTINets).

Pullbacks in PTINets along injective PTINets morphisms4 are constructed compo- nentwise inPTNetsand Sets.

Consider a commutative square(1)inPTINetswithg1 having an injective net com- ponentg10. (1) is a PB inPTINets i (2)is a PB in PTNetsand (3)is a PB in Sets with the components of thePTINetsmorphisms, wherem0 :I0 →P0 is induced by PB objectP0 in the commuting cube below (whose front is the PB of place sets).

4We require morphisms that are injective in order to obtain componentwise pullbacks inPTINets.

See [EEPT06] for details.

(13)

2.2. TRANSFORMATION OF PTI NETS 9

NI0

f1 //

f2

(1)

NI1 g1

NI2 g

2

//NI3

N0

f10

//

f20

(2)

N1 g10

N2

g02

//N3

I0

f1I //

f2I

(3)

I1 g1I

I2 g

2I

//I3

I0 f1I //

f2I

m0

I1

g1I

m1

P0

f1P //

f2P

P1

g1P

I2 g

2I

//

m2

I3

m3

P2 g2P //P3

Example. The pushouts in Fig. 2 on page 14 are pullbacks, too.

2.2. Transformation of PTI Nets

This section is about rule-based transformation of PTI nets. We use the double pushout approach, which has also been used in [EHP+08] and stems from [EEPT06]. We are going to characterize the applicability of rules at some match by initial pushouts.

Denition 2.6 (PTI Transformation Rules).

A PTI transformation rule is a span of injectivePTINets morphisms

%= (L←l K →r R).

Remark. In contrast to [EHP+08], rule morphisms for PTI rules are not required to be marking-strict in order to obtain anM-adhesive category (see Sect. 5 on page 41). This allows to arbitrarily change the marking of a PTI net by applying rules with correspond- ing places and individual tokens in L andR.

Denition 2.7 (PTI Transformation).

Given a PTI transformation rule%= (L←l K→r R) and a PTI netNI1 with a PTI net morphismf :L→NI1, called the match, a direct PTI net transformationNI1 =%,f=⇒NI2

from NI1 to the PTI netNI2 is given by the following double-pushout diagram (DPO) diagram in the category PTINets:

L

f (PO1) K

(PO2)

oo l

r //R

f

NI1 NI0oo //NI2

To be able to decide whether a rule is applicable at a certain match, we formulate a gluing condition for PTI nets, such that there exists a pushout complement of the left rule morphisms and the match if (and only if) they fulll the gluing condition. The correctness of the gluing condition is shown via a proof on initial pushouts over matches, according to [EEPT06].

(14)

10 2. PLACE/TRANSITION NETS WITH INDIVIDUAL TOKENS Denition 2.8 (Gluing Condition inPTINets).

Given PTI netsK, L, andNI and PTI morphismsl:K →Landf :L→NI. We dene the set of identication points5

IP =IPP ∪IPT ∪IPI

with

• IPP ={x∈PL | ∃x0 6=x:fP(x) =fP(x0)},

• IPT ={x∈TL| ∃x0 6=x:fT(x) =fT(x0)},

• IPI={x∈IL | ∃x06=x:fI(x) =fI(x0)}, the set of dangling points6

DP =DPT ∪DPI

with

• DPT ={p∈PL | ∃t∈TNI \fT(TL) :fP(p)∈EN V(t)},

• DPI ={p∈PL | ∃i∈INI \fI(IL) :fP(p) =mNI(i)}, and the set of gluing points7

GP =lP(PK)∪lT(TK)∪lI(IK)

We say that l and f satisfy the gluing condition if IP ∪DP ⊆GP. Given a PTI rule

% = (L ←l K →r R), we say % and f satisfy the gluing condition i l and f satisfy the gluing condition.

L

f

l K

oo r //R

NI

In order to construct the initial pushout for a match f : L → NI, we dene the boundary over the matchf, which is the minimal subnet containing all places, transitions, and individual tokens that must not be deleted by the application of a rule with left hand sideL such that there exists a pushout complement.

Denition 2.9 (Boundary inPTINets).

Given a morphismf :L→NI inPTINets. The boundary off is a PTI net B= (PB, TB, preB, postB, IB, mB)

with

5That is, all elements inLthat are mapped non-injectively byf.

6That is, all places inLthat would leave a dangling arc, if deleted.

7That is, all elements inLthat have a preimage inK.

(15)

2.2. TRANSFORMATION OF PTI NETS 11

• PB=DPT ∪DPI∪IPP ∪PIPT ∪PIPI

• PIPT ={p∈PL| ∃t∈IPT :p∈EN V(t)}

• PIPI ={p∈PL | ∃i∈IPI :p=mL(i)}

• TB=IPT

• preB(t) =preL(t)

• postB(t) =postL(t)

• IB =IPI

• mB(i) =mL(i)

together with an inclusion b:B→L. Well-denedness.

preB, postB:TB →PB:

The well-denedness follows from the well-denedness of Denition A.9 and the fact that B has the same set of transitions as the boundary in A.9 and the set of places in Denition A.9 is a subset ofPB.

mB:IB →PB:

Leti∈IB. Then we have i∈IPI and hence mB(i) =mL(i)∈PIPI ⊆PB

b:B →L:

We obtain an inclusion morphism b : B → L from the fact that preB, postB and mB are restrictions of the respective functions inL.

The following facts about the gluing condition and initial pushouts hold in all M- adhesive categories (PTINets,M) whose morphism class M of monomorphisms con- tains at least inclusions (for concrete instantiations see Sect. 5 on page 41). The next fact completes the construction of initial pushouts for matches and shows that the con- struction of the boundary in Def. 2.9 on the preceding page complies to the categorical notion of boundaries in Def. A.1 on page 49.

Fact 2.10 (Initial Pushout in PTINets).

Given a morphism f :L→NI inPTINets, the boundaryB of f and the PTI net C= (PC, TC, preC, postC, IC, mC)

with

(16)

12 2. PLACE/TRANSITION NETS WITH INDIVIDUAL TOKENS

• PC = (PNI \fP(PL))∪fP(bP(PB))

• TC = (TNI \fT(TL))∪fT(bT(TB))

• IC = (INI \fI(IL))∪fI(bI(IB))

• preC(t) =preNI(t)

• postC(t) =postNI(t)

• mC(i) =mNI(i)

Then diagram (1) whereg:=f|B is an initial pushout in PTINets. B b //

g

L

f C c //

(1)

NI Proof. See section B.1 on page 63.

The following two facts show the correspondence between the gluing condition in PTINets and the categorical gluing condition (see Def. A.2 on page 49), which is a necessary and sucient condition for the (unique) existence of pushout complements in allM-adhesive categories.

Fact 2.11 (Characterization of Gluing Condition inPTINets).

Letl:K→L andf :L→NI be morphisms inPTINets withl∈ M.

The morphisms l and f satisfy the gluing condition in PTINets if and only if they satisfy the categorical gluing condition.

Proof. See section B.2 on page 67.

Fact 2.12 (Gluing Condition for PTI Transformation).

Given a PTI rule % = (L ←l K →r R) and a match f : L → NI into a PTI net NI = (N, I, m : I → PNI). The rule % is applicable on match f, i.e. there exists a (unique) pushout complement NI0 in the diagram below, i % and f satisfy the gluing condition inPTINets.

L

f (P O)

l K

oo

f0

r //R

NI oo NI0

Proof. By Fact 2.11%andf satisfy the gluing condition inPTINetsif and only if%and f satisfy the categorical gluing condition, which by Fact A.3 is a necessary and sucient condition for the (unique) existence of the pushout complementNI0.

(17)

2.3. CORRESPONDENCE OF TRANSITION FIRING AND RULES 13 2.3. Correspondence of Transition Firing and Rules

Now that we can manipulate a net's marking with rules, we have a look at rules that simulate ring steps for a certain transition under a token selection. We show that ring of a transition corresponds to a canonical application of a special rule construction, called transition rules. With this correspondence we can easily show that token-injective PTI morphisms preserve ring steps.

Denition 2.13 (PTI Transition Rules).

We dene the transition rule for a transition t ∈ T enabled under a token selection S = (M, m, N, n) in a PTI net NI = (P, T, pre, post, I, m) as the rule

%(t, S) = (Ltl Ktr Rt), with

• the common xed net structure PNt = (Pt,{t}, pret, postt), where Pt =EN V(t), pret(t) =pre(t)and postt(t) =post(t),

• Lt= (PNt, M, mt:M →Pt), withmt(x) =m(x),

• Kt= (PNt,∅, ∅:∅ →Pt),

• Rt= (PNt, N, nt:N →Pt), withnt(x) =n(x),

• l, r being the obvious inclusions on the rule nets.

mt and nt are well-dened becauset is enabled under S: The token selection condition implies that ∀x ∈ M : m(x) ∈ PRE(t) and due to the construction of PNt we have PRE(t)⊆EN V(t) =Pt. The argument for nt works analogously.

Note that tis enabled underS inLt.

Example. Figure 2 shows a PTI transition rule %(t, S) = (L←l K →r R) for transitiont inNI.

Denition 2.14 (Canonical DPO Transformation of PTI Nets).

We call a direct transformationNI1 =%,f=⇒NI2 by rule% = (L←l K →r R) withl, r being inclusions canonical if

• fI is injective,

• the morphisms in the span (NI1 ← NI0 → NI2) of the DPO transformation diagram below are inclusions, and

• I2 =I0∪(IR\r(IK)).

L

f (PO1) K

(PO2)

oo l

r //R

f

NI1 NI0oo //NI2

(18)

14 2. PLACE/TRANSITION NETS WITH INDIVIDUAL TOKENS Remark. For each rule% being applied to some PTI netNI at a token-injective matchf, there exists a canonical transformation diagram, which is just the particular equivalent DPO diagram with as less isomorphic changes as possible.

Because of the injectivity of the rule morphisms the lower span in the diagram is already injective as well. To construct the canonical transformation diagram we rst regard the last condition on I2, which demands that (IR\r(IK))∩I0 = ∅ because of pushoutPO2. For this, it is sucient to replace the set of tokens inR that are created by the rule, i.e. IR\r(IK), such that is disjoint to the tokens preserved by the rule, i.e.

(I1\f(IL))∪f(l(IK)).8 With this we now can simply replace arbitrary NI0 and NI2, being some pushout complement object of PO1 and pushout object of PO2, with nets such that the lower span morphisms become inclusions.

Example. The diagram in Fig. 2 shows the two pushouts in PTINets resulting from applying the PTI transition rule %(t, S) = (L←l K →r R) to the net NI with identical token morphism component. Moreover, this transformation is canonical.

t

p1 p2

p3 2

x1 y1 x2

L

f (PO1)

t

p1 p2

p3 2

K

(PO2)

oo l

r // t

p1 p2

p3 2

x3 R

t

p1 p2

p3 2

x1 y1 z1 x2 y2

y3 NI

t

p1 p2

p3 2

z1 y2

y3

oo //

t

p1 p2

p3 2

x3

z1 y2

y3

Figure 2: Canonical direct DPO-transformation in PTINets simulating a ring step Theorem 2.1 (Equivalence of Canonical Transformations and Firing of PTI Nets).

1. Each ring step NI i−→t NI0 via a token selection S = (M, m, N, n) corresponds to a canonical direct transformation NI =%(t,S),f====⇒ NI0 via the transition rule %(t, S), matched by the inclusion match f :L%(t,S)→NI.

8This modication of the rule is passable since changing the tokens in R does not aect the ring behavior ofNI2 (up to the token selections) nor the applicability of the rule.

(19)

2.3. CORRESPONDENCE OF TRANSITION FIRING AND RULES 15

2. Each canonical direct transformation NI =%(t,S),f====⇒ NI1, via some transition rule

%(t, S) = (L ←l K →r R) with t ∈ TNI and token selection S = (M, m, N, n), and a token-injective match f : L → NI, implies that the transition fT(t) is enabled in NI under fI(M), fP ◦m◦fI−1

, N, fP ◦m1◦fI∗−1

with ring step NI if−−−T(t)→NI1. Proof.

1. Given the ring step NI i−→t NI0 via S = (M, m, N, n), the canonical direct transfor- mation of the transition rule %(t, S) = (L←l K →r R) is NI =%(t,S),f====⇒ NI1 as in the DPO diagram in Fig. 3. The matchf,d, and d0 are inclusions.

L= (PNt, M, mt)

f (PO1)

K = (PNt,∅,∅)

(PO2)

? _

oo l

 r //R= (PNt, N, nt)

f

NI = (PN, I, m) ? _NI0= (PN, I0, m0)

d

oo 

d0

//NI1 = (PN, I1, m1) Figure 3: DPO diagram for canonical direct transformation of NI with %(t, S) in

PTINets

According to Fact 2.4 on page 8, we haveI0 =I\M andI1 =I0∪(N\∅)as in the DPO diagram of the Sets components in Fig. 4. The ring step condition (I\M)∩N = ∅ grants us the last condition for canonical transformationsI0∪(N \r(∅)) =I1.

M

fI

(PO1)

(PO2)

? _

oo

 //N

fI

nt

''I

m ++

I0 = (I\M)

dI ? _

oo 

d0I //

m0=m◦dI

&&

I1= (I\M)∪N

m1

''

Pt fP=fP

PPN

id PPN

Figure 4: DPO diagram inSetsfor the token components of the transformation in Fig. 3 For m1 as induced morphism for the pushout object I1 follows that

m1(x) =

(m0(x) =m(x) for x∈I\M nt(x) =n(x) for x∈N

henceI1=I0, m1=m0 andNI1 =NI0, according to Def. 2.2 on page 6.

Remark. fI being injective is not only sucient for the existence of (PO1), but also necessary, because IK =∅(see Fact 2.12 on page 12).

2. Given a canonical direct transformation NI =%(t,S),f====⇒NI1 as in the DPO diagrams in Figs. 3 and 4,fT(t)∈TNI is enabled under

fI(M), fP ◦m◦fI−1

, N, fP ◦m1◦fI∗−1

(20)

16 2. PLACE/TRANSITION NETS WITH INDIVIDUAL TOKENS if

1. fI(M)⊆I, 2. fP ◦m1◦fI∗−1

:N →PPN, 3. (I\fI(M))∩N =∅,

4. P

i∈fI(M)

fP ◦m◦fI−1(i)

=preNI(fT(t)) 5. P

i∈N

fP ◦m1◦fI∗−1(i)

=postNI(fT(t))

6. leading to the follower markingI0 = (I\M)∪N withm0(x) =

(m0(x) =m(x) forx∈I\M m1(x) =n(x) for x∈N

By construction of the transition rule %(t, S) and its application to NI we have 1., 2., and for 6. that I0 = I1, m0 = m1. The canonical transformation property grants us 3.

It remains to show 4. and 5., i.e. thatfI(M) and N represent the correct numbers of tokens in the environment of fT(t) to enable it:

X

i∈fI(M)

fP ◦m◦fI−1(i)

= X

i∈M

fP ◦m(i) (fI inj.)

=fPX

i∈M

mt(i) (∀i∈M :mt(i) =m(i),due to def. %(t, S))

=fP◦prePNt(t) (tenabled in L)

=preNI ◦fT(t) (f PTI morph.)

and analogously, X

i∈N

fP ◦m1◦fI∗−1(i)

=X

i∈N

fP ◦m1(i) (fI(N) =N)

=fP∗⊕X

i∈N

nt(i) (∀i∈N :nt(i) =m1(i),due to constr. m1)

=fP∗⊕◦prePNt(t) (t enabled inL)

=postNI ◦fT(t) (f PTI morph.)

(21)

2.3. CORRESPONDENCE OF TRANSITION FIRING AND RULES 17 The second item of the previous theorem covers all possible canonical direct transfor- mations by any transition rule %(t, S) in an arbitrary net NI, without aasuming that t ∈NI or M ⊆INI. For the special case that a transition rule %(t, S) is applied on an inclusion match, the second item reduces to the following corollary, which is more similar to the theorem's rst item.

Corollary 2.2 (Equivalence of Canonical Transformations and Firing of PTI Nets).

Given a canonical transformation NI =%(t,S),f====⇒NI1 such that the match f :L→NI is an inclusion, then tis enabled in NI under S with ring step NI i−→t NI1.

This follows directly from 2. of Theorem 2.1.

Theorem 2.3 (Token-injective PTI Net Morphisms preserve Firing Steps).

For each PTI net morphism f :NI1→NI2 with injective fI component and each ring step NI1 i−→t NI01 there exists a ring step NI2 if−−−T(t)→ NI02 and a PTI net morphism f0 :NI01→NI02 (depicted in diagram (1) below).

NI1// t //

f

(1)

NI01

f0

NI2//

fT(t) //NI02

Proof. Given f : NI1 → NI2 and NI1 i−→t NI01 via some S as above, we have by the rst part of Theorem 2.1 on page 14 the canonical direct transformation given by the pushouts (1)and (2)with%(t, S) = (L←l K→r R)in Fig. 5.

L

incL

(1)

K

(2)

oo l

r //R

incR

NI1

f (3)

NID1

l0

oo r0 //

(4)

NI01

f0

NI2 oo NID2 //NI02

Figure 5: DPO diagrams for canonical direct transformation ofNI1 andNI2 with%(t, S) Note that f :NI1 → NI2 satises the gluing condition w.r.t this rule andf, because l0P = idP1, lT0 = idT19 and none of the individuals of NI1 is an identication point (IPI=∅) due to injectivity offI. This allows to construct the canonical transformation with extended ruleNI1 l0

←NID1 r

0

→NI01 along pushouts(3)and(4). Hence, also(1 + 3) and (2 + 4) are pushouts of a canonical direct transformation via %(t, S). The second part of Theorem 2.1 on page 14 impliesNI2 if−−−T(t)→NI02.

9This means that all places and transitions ofNI1are gluing points.

(22)

18 3. ALGEBRAIC HIGH-LEVEL NETS WITH INDIVIDUAL TOKENS Remark (Firing-preserving diagrams fortcorrespond to an extension diagram for%(t, S)).

The diagram in Fig. 5 on the previous page corresponds to an extension diagram for rule

%(t, S)and f (as depicted below) because(1)−(4) are pushouts.

NI1

%(t,S),inc +3

f

NI01

f0

NI2

%(t,S),f◦inc +3NI02

3. Algebraic High-Level Nets with Individual Tokens

In this section, we lift the results of the previous section to high-level nets whose tokens represent values of an algebra to a signature [EM85]. The rule-based transformation of collective algebraic high-level nets from [PER95] is the foundation for the approach presented in the following.

3.1. Denition and Firing Behavior

Denition 3.1 (Algebraic High-Level Nets with Individual Tokens).

We dene a marked AHL net with individual tokens, short AHLI net, as ANI = (Σ, P, T, pre, post, cond, type, A, I, m),

where

• AN = (Σ, P, T, pre, post, cond, type, A) is a classical AHL net with

signature Σ = (S,OP, X) of sorts S, operation symbols OP and variables X= (Xs)s∈S,

sets of places P and transitionsT,

pre, post:T →(TOP(X)⊗P)10, dening the transitions' pre- and postdo- mains,

cond:T → Pf in(Eqns(S,OP, X))assigning a nite set ofΣ-equations(L, R, X) as ring conditions to each transition,

type:P →S typing the places of the signature's sorts, aΣ-algebraA,

• I is the (possibly innite) set of individual tokens ofANI, and

• m:I →A⊗P is the marking function, assigning the individual tokens to the data elements on the places. m(I)denes the actual set of data elements on the places ofANI. m does not have to be injective.

Further, we introduce some additional notations:

10TOP(X)P ={(t, p)TOP(X)×P|tTOP,type(p)(X)}, i.e the pairs where termtis of sorttype(p).

(23)

3.1. DEFINITION AND FIRING BEHAVIOR 19

• V ar(t)⊆X is the set of variables occurring in equations and on the environment arcs oft,

• CP = (A⊗P) ={(a, p)∈A×P|a∈Atype(p)} as the set of consistent value/place pairs,

• CT ={(t, asg)∈T ×(V ar(t)→A)|∀(L, R, X)∈cond(t) :asg(L) =asg(R)}

as the set of consistent transition assignments, i.e. all ring conditions oftare valid when evaluated with the variable assignmentasg11,

• ENV(t) =PRE(t)∪POST(t)⊆(TOP(X)⊗P) as the environment of a transition t∈T where

PRE(t) ={(term, p)∈(TOP(X)⊗P)|pre(t)(term, p)6= 0}

POST(t) ={(term, p)∈(TOP(X)⊗P)|post(t)(term, p)6= 0}

• ENVP(t) =πP(ENV(t))⊆P the place environment of t,

• preA, postA:CT →CP, dened by preA(t, asg) = (asg⊗idP)(pre(t)), postA(t, asg) = (asg⊗idP)(post(t)) Similarly, we dene the sets12

PREA(t, asg) ={(a, p)∈(A⊗P)|preA(t, asg)(a, p)6= 0}

POSTA(t, asg) ={(a, p)∈(A⊗P)|postA(t, asg)(a, p)6= 0}

We can express e.g. the concrete required number of a token(a, p)for tto re un- der assignmentasg withpreA(t, asg)(a, p) by interpreting the monoidpreA(t, asg) as a function CP → N. Similarly, we get the produced number of (a, p) with postA(t, asg)(a, p).

Remark (Individual tokens vs. classical algebraic data tokens). Each AHLI net with individual token marking (I, m) can be interpreted as an AHL net with marking

M = X

(a,p)∈A⊗P

|m−1(a, p)|(a, p) =X

i∈I

m(i)

where|m−1(a, p)|denotes the cardinality of individual tokens inI thatmmaps to(a, p). In AHL nets, the tokens are of the form (a, p), s.t. they have already a kind of identity, depending on their data values. The main dierence to AHLI nets is that we can distinguish tokens of the same algebraic value on the same place. Moreover, the individuals equip data tokens with identities. When ring a transition, we now can relate the input and output tokens so that a token's history can be traced along the ring steps.

11whereasg:TOP(X)Ais the evaluation ofΣ-terms over variables inX to values inA. Technically, asg=xeval(asg)A results from a free construction overasg.

12Obviously, these sets are the same as(asgidP)PRE(t)and(asgidP)POST(t), respectively.

(24)

20 3. ALGEBRAIC HIGH-LEVEL NETS WITH INDIVIDUAL TOKENS Example. Figure 6 shows the graphical representation of an AHLI net with

• signatureΣ = ({s1, s2, s3}, {t11:→s1, t12:→s1, t2 :→s2, t3 :→s3}),

• algebra carrier setsAs1 ={a1, b1, c1}, As2 ={a2, b2}, As3 ={a3, b3, c1}

• pre(t) = (t11, p1)⊕(t12, p1)⊕(t2, p2), post(t) = (t3, p3),

• type(p1) =s1, type(p2) =s2, type(p3) =s3,

• cond(t) =∅,

• I ={x1, y1, x2, x3},m(x1) =m(y1) = (a1, p1), m(x2) = (a2, p2), m(x3) = (a3, p3), Note that the algebraic value of an individual token is given next to the dashed arc to its carrying place. In the following, if a transition has an empty set of conditions we just denote the transition name without an explicit∅ below.

t

p1:

s1

p2: s2

p3: s3 t11⊕t12

t2

t3

x1

y1

x2

x3

a1

a2

a1

a3

Figure 6: Example AHLI net

Similar as for low-level PTI nets, we now dene ring steps for a transition and a token selection. In addition, we have to take into account assignments evaluating the variables on the arcs and in the transition conditions to algebra values.

Denition 3.2 (Firing of AHLI nets).

A consistent transition assignment(t, asg)∈CT for an AHLI net ANI = (Σ, P, T, pre, post, cond, type, A, I, m)

is enabled under a token selection (M, m, N, n), where

• M ⊆I ,

• mis the token mapping of ANI,

• N is a set with(I\M)∩N =∅,

• n:N →A⊗P is a function,

(25)

3.1. DEFINITION AND FIRING BEHAVIOR 21 if it meets the following token selection condition:

X

i∈M

m(i) =preA(t, asg)∧X

i∈N

n(i) =postA(t, asg)

If such an asg-enabledtres, the follower marking (I0, m0) is given by

I0= (I\M)∪N, m0 :I0 →A⊗P withm0(x) =

(m(x), x∈I\M n(x), x∈N

leading to ANI0 = (AN, I0, m0) as the new AHLI net in the ring step ANI it,asg−−−→ANI0 via (M, m, N, n).

Remark (Token Selection). The purpose of the token selection is to specify exactly which tokens should be consumed and produced in the ring step. Thus, M ⊆ I selects the individual tokens to be consumed, and N contains the set of individual tokens to be produced. Clearly, (I \M) ∩N = ∅ must hold because it is impossible to add an individual token to a net that already contains this token. mand nrelate the tokens to their place/value pairs. It would be sucient to consider only the restriction m|M here or to infer it from the net but as a compromise on symmetry and readability we denote m in the token selection.

As a preparation for the transformation in the next subsection, we dene a category of AHLI nets.

Denition 3.3 (AHLI Net Morphisms and CategoryAHLINets).

Given two AHLI nets ANIi = (Σi, Pi, Ti, prei, posti, condi, typei, Ai, Ii, mi), i ∈ {1,2}, an AHLI net morphism f :ANI1 →ANI2 is a pentuple

f = (fΣ: Σ1 →Σ2, fP :P1 →P2, fT :T1 →T2, fA:A1 →VfΣ(A2), fI :I1 →I2) such that the following diagrams commute (componentwise forprei andposti)13:

13VfΣ is the forgetful functor induced by signature homomorphismfΣ, such thatfA:A1VfΣ(A2)is a generalizedΣ1-homomorphism. fΣ#is the extension offΣ to terms and equations.

(26)

22 3. ALGEBRAIC HIGH-LEVEL NETS WITH INDIVIDUAL TOKENS

Pf in(Eqns(Σ1))

Pf in(fΣ#)

T1

cond1

oo

fT

pre1 //

post1

//(TOP1(X1)⊗P1)

(fΣ#⊗fP)

Pf in(Eqns(Σ2)) T2

cond2

oo pre2 //

post2

//(TOP2(X2)⊗P2)

P1

type1 //

fP

S1

fΣ

I1

fI

m1 //A1⊗P1

fA⊗fP

P2

type2

//S2 I2 m2 //A2⊗P2

For a transition assignment (t, asg :X1 →A1) we call

asgf =fA◦asg◦fΣ|V ar(t)−1 :V ar(fT(t))→A2

the translation ofasg along f if fΣ is bijective on the variables in V ar(t). Actually, for all transitions t∈T1 all fΣ|V ar(t) :V ar(t) →V ar(fT(t))are already surjective because of the commutativity of the diagrams above. So it is sucient to demand injectivity for fΣ|V ar(t) such thatasgf is well-dened.

The categoryAHLINetsconsists of all AHLI nets as objects and all AHLI net mor- phisms.

Remark (Generalized algebra morphisms). Because VfΣ(A2) just forgets some carrier sets of A2 if we considered them as a family of sets, we may use fA also with A2 as codomain omitting the postponed family of identities (ιs : (VfΣ(A2))s → A2,fΣ(s))s∈S. Moreover, in the following constructions the algebra parts of the pushout cospan (and the pullback span resp.) result from general constructions in the Grothendieck construct with objects(Σ, A∈Alg(Σ))and generalized algebra morphisms. See [EBO92, TBG91]

for amalgamation of algebras and limits/colimits in Grothendieck constructs and also [EM85, EOP06] for details on the usage of free functors.

Fact 3.4 (Construction of Pushouts inAHLINets).

Pushouts in AHLINets are constructed componentwise in AHLNets and Sets. So, (1)is a PO inAHLINetsi(2)is a PO inAHLNetsand(3)is a PO inSetswith the components of theAHLINets morphisms, wherem3 :I3 →A3⊗P3 is induced by PO objectI3 in the commutating cube below (whose front's place components let the front commutate because of the PO in the net structure).

Références

Documents relatifs

We therefore wish to merge algorithm 1 (augmented to handle priority as described earlier) and 3 into a single algorithm sharing Unknown, Disabled, and MaybeReady in a way that makes

A workflow model may be clearly represented using three levels, where the first (highest) level describes the company structure and the possible flows between organizational

The concurrent step reachability graph of a Petri net has all reachable markings m as vertices, a distinguished initial marking m 0 and an arc labelled by U leading from m to m 0 when

Line 36, function synchro is used on the output arc in order to produce a copy of the net taken from the input place (as x) in which the transition "tToknet" has fired..

We define a class of Petri nets suitable for a parallel execution machine which preserves the step sequence semantics of the nets and ensures time consistent executions while

Besides this biological case study, the contribution of the paper is also on a more abstract level. Indeed, our approach overpasses the pure application con- text and allows a

Neco compiler is entirely implemented in Python using snakes to handle the Petri nets and abcd as an input lan- guage [14].. Apart from abcd , the Petri net semantics of various

As the proposed semantics use tuples to describe a marking, there is a clear dif- ference between a place and its tokens. Therefore, a marking will be very clear and the number