CLASSIFICATION OF PETRI NETS USING ADJOINT ... - CiteSeerX

0 downloads 0 Views 170KB Size Report
Petri nets constitute a well-known formal technique that is used in concur- rency theory and in a large variety of application areas. Various kinds of. Petri net ...
CLASSIFICATION OF PETRI NETS USING ADJOINT FUNCTORS JULIA PADBERG

Technical University of Berlin Institute for Communication and Software Technology email: [email protected]

Keywords: Petri nets, classi cation, category theory 1 Introduction Petri nets constitute a well-known formal technique that is used in concurrency theory and in a large variety of application areas. Various kinds of Petri net classes1 2 3 4 5 with numerous features and analysis methods have been proposed in literature for di erent purposes and application areas. The enormous interest in Petri nets has lead to a vast accumulation of dissimilar approaches. The unstructured variety of Petri net approaches causes the new formulation and examination of similar concepts. Most of the di erent concepts for Petri nets are de ned explicitly for a single net class, although many of these notions are essentially the same for di erent kinds of net classes. Hence a suitable classi cation of Petri nets which is the basis for a uniform theory is highly desirable. One of the main purposes of category theory6 7 is to have a uniform frame for di erent kinds of mathematical structures, mappings between structures, and constructions of structures. Thus category theory constitutes an ideal background for classi cation in general. We already have introduced a formal framework for the classi cation of Petri nets8 9 10. This framework describes the net structure using adjoint functors and { in case of high-level nets { the data type part using institutions and speci cation frames. In this paper we extend this framework. This extension is independent of the description of the data type part. Hence it suces to consider merely low-level Petri nets like di erent kinds of place/transition nets, ordinary nets, elementary nets, and so on. Careful investigations of several Petri types ; ; ; ;

;

; ;

 THIS WORK IS PART OF THE JOINT RESEARCH PROJECT "DFGFORSCHERGRUPPE PETRINETZ-TECHNOLOGIE" BETWEEN H. WEBER (COORDINATOR), H. EHRIG (BOTH FROM THE TECHNICAL UNIVERSITY BERLIN) AND W. REISIG (HUMBOLDT-UNIVERSITA T ZU BERLIN), SUPPORTED BY THE GERMAN RESEARCH COUNCIL (DFG).

ws-main-3dim: submitted to World Scienti c on 19th June 2000

1

as well as fruitful discussion with in the "DFG-Forschergruppe PetrinetzTechnologie" have led to the observation that for quite many Petri net types the structure of the marking di ers from the structure of the ow given by the underlying net structure11 . Thus we introduce here one description for the ow structure and one for the marking structure. These descriptions are given by two di erent adjoint functors, relating the underlying sets of transitions and places to the corresponding ow structure and to the corresponding marking structure. The paper is organized in the following way. In Section 2 we rst introduce several net types and discuss their ow and marking structure. Then we describe ow and marking structure in terms of adjoint functors. Subsequently we give the classi cation of low-level Petri nets according to these adjunctions. In Section 3 we give a summary and discuss description of the data type part using speci cation frames and institutions.

2 Classi cation of Low-Level Petri Nets The classi cation of low-level Petri nets is based on the ow structure and on the marking structure. We rst discuss some Petri net types with respect to marking and ow structure. In order to classify variants of place/transition nets, elementary nets, simple nets, and S-graphs we use the algebraic version8 9 of these net types. The algebraic description of net types is given in the same sense as Meseguer and Montanari4 describe place/transition nets. ;

1. In an algebraic way4 8 a place/transition net2 can be denoted by a set of transitions and places, and pre- and postdomain, that are functions mapping each transition to a linear sum over places. The marking is given as a linear sum as well. Nevertheless there are mainly two variants of place transition nets. They di er with respect to empty pre- and postdomains. Thus there are two variants of the ow structure: Flow (Variant 12: T pre- P  mapping transitions to elements of post the free commutative semigroup P  over P. Thus the pre- and postdomain are nonempty. Flow (Variant 212: T pre- P ~ mapping transitions to elements of post the free commutative monoid P ~ over P. Thus the pre- and postdomian may be empty. Marking: m 2 P ~ , thus the empty marking is allowed. ;

ws-main-3dim: submitted to World Scienti c on 19th June 2000

2

The free monoid construction as well as the free semi-group construction is supplied with an operator for the addition +, so that ring can be formulated in terms of this operation (see De nition 2.4). 2. Elementary Nets13 consist of a set of places, and a set of transitions, but the arc weight always equals one and the marking consists of at most one token on each place. Thus the arc weight as well as the marking of elementary nets can be expressed by a subset of the set of places. Flow: T pre- P (P) mapping each transition to a subset of places post P (P). Marking: m 2 P (P) a subset of places P (P). The ring is computed using the union of sets, where the enabling condition (see De nition 2.4) ensures the correct behavior. 3. Ordinary nets14 13 (also called \gewohnliche Netze"14 ) are nets with places and transitions, where the arc weight is at most one, but on the places there may be more than one token. Flow: T pre- P (P) mapping each transition to a subset of places. post Marking: m 2 P ~ an element of the free commutative monoid P ~ over P. The marking is de ned in the same way as for place/transition nets, and so is the the ring. 4. S-Graphs13 are a special case of common nets. Their ow structure is restricted in the following way j  tj = jt  j = 1. Thus the domains of the transitions and the marking are di erent.The pre- and postdomain is the set of places (due to the fact that in the pre- and postdomain of each transition there is exactly one place), whereas the marking is a multiset of places, and hence an element of the free commutative monoid over P: Flow: T pre- P mapping each transition to a place p 2 P post Marking: m 2 P ~ an element of the free commutative monoid P ~ over P. ;

In order to describe these structures we use a categorical construction, namely free constructions leading to adjoint functors, short adjunctions. An ws-main-3dim: submitted to World Scienti c on 19th June 2000

3

adjunction consists of left and right adjoint functor. If the right adjoint functor is a forgetful functor with respect to the left adjoint, we have a free construction. Low-level Petri nets can be described using two di erent adjunctions. The ow structure is given by functors Flow = G  F , which is the composition of such a left-adjoint functor F and the corresponding rightadjoint functor G . In the same way the marking structure is given by functors Mark = G F , which is the composition of such a leftadjoint functor F and the corresponding right-adjoint functor G . Both functors Flow and Mark are composite functors from Set ! Set, where Set is the category of sets. The second category of the adjunction, denoted by FStruct and MStruct respectively, are almost arbitrary. We only have to require that MStruct is a subcategory of CSGroup, the category of commutative semi-groups. This implies that the objects of MStruct are commutative semi-groups, where the binary operation is used to compute the behavior of nets (see De nition 2.4). F low

F low

F low

F low

M ark

M ark

M ark

M ark

De nition 2.1 (Flow and Marking Structure Functor)

A Petri net type is given by the tuple (Flow; Mark; ), de ned as follows: 1. Given the category FStruct, called the category of ow structure, and functors F aG : FStruct ! Set, where F is left adjoint to G . The composition Flow = G  F : Set ! Set is called ow structure functor. 2. (a) Given the category MStruct, called the category of marking structure, and functors F aG : MStruct ! Set, where F is left adjoint to G . The composition Mark = G F : Set ! Set is called marking structure functor. (b) Furthermore let MStruct be a subcategory of the category of commutative semi-groups CSGroup. 3. : Flow ! Mark is a natural transformation. F low

F low

F low

F low

F low

M ark

F low

M ark

M ark

M ark

M ark

M ark

4

ws-main-3dim: submitted to World Scienti c on 19th June 2000

4

De nition 2.2 (Petri Nets of a Type)

Given the Petri net type (Flow; Mark; ) a Petri net N = (T; P; pre; post) is given by sets T and P, called transitions and places, and functions preFlow(P) T post called pre- and postdomain of T, where Flow = G  F : Set ! Set is the ow structure functor (see De nition 2.1). 4 F low

F low

Lemma 2.3 (Petri Net Types Constitute Petri Net Categories) Given the Petri net type (Flow; Mark; ) then we have a category PN, where

the objects are Petri nets N = (T; P; pre; post) and morphisms f : N1 ! N2 are given by a pair f = (f ; f ) of functions f : T1 ! T2 , f : P1 ! P2 such that we have compatibility of the pre- and postdomain, that is the square (1) commutes separately for pre- and postdomain: T

pre1

T1 fT T2

post1 (1)

?

pre2 post2

P

T

-- F low(P )

P

P1

1

F low(fP )

(2)

-- ?F low(P ) 2

P2

- Mark(P ) 1

Mark(fP )

? - Mark (P ) 2

Due to the properties of natural transformation square (2) commutes: 4 Flow(f )  2 = 1  Mark(f ). The characterization of the operational behavior of Petri nets uses the adjunction, that is given by the marking structure functor. The unique extensions allow the de nition of enabling and the computation of the follower marking using the addition given in the category MStruct. The composition  pre : T ! Mark(P) leads the unique extension pre =  pre : F (T) ! F (P) and similar post : F (T) ! F (P). P

P

P

P

g

P

M ark

M ark

g

M ark

M ark

De nition 2.4 (Behavior for Petri Nets)

g

g

P

Given a Petri net with N = (T; P; pre; post) of a type (Flow; Mark; ) and the unique extensions pre =  pre and post =  post, then we have: 1. The marking of a low-level abstract Petri net is given by m 2 F (P). 2. A transition vector is de ned by v 2 F (ftg). 3. v 2 F (ftg) res from m to m0 , i.e. m[v > m0 if and only if there is m 2 F (P) such that P

P

M ark

M ark

M ark

M ark

ws-main-3dim: submitted to World Scienti c on 19th June 2000

5

  

gg

m = m + pre(v) m0 = m + post(v) (splitting condition) for all r; r0 2 F (P) with r 6= m: m = r + r0 =) [m 6= pre(v) + r ^ m0 6= post(v) + r]

g

M ark

g

4

Remark

In contrast to earlier approaches9 we allow di erent ow and marking structure functors, and we have added the splitting condition in order to obtain a generic ring rule. This condition has been formulated slightly di erent by Kindler and Weber11 . The splitting condition always holds if the +-complement is unique, since we have m = pre(v) + m ^ m = pre(v) + r =) m = r, an contradiction. Moreover, the splitting condition implies correct behavior of elementary nets in case of contact, since m \ post(v) = x 6= ; =) m0 = m + post(v) ^ m0 = (mnx) + post(v), an contradiction. Note that the splitting condition does not implies uniqueness of m.

g

g

g

g

Example 2.5 (Instantiations) Mark

F low

powerset free comm. semigroup free monoid

= incl

elementary nets13 = id

ordinary nets14 (P 0 ) = p2P 0 p

???

P/T-nets12 with nonempty domains NEW = incl = incl

???

P/T-nets2 with empty domains = id

NEW

identity

comm.

free Abelian group

free comm. monoid S-graphs13 = incl

powerset

(i pi ) = fpi ji > 0g (i pi ) = fpi ji > 0g

NEW

= incl

NEW

(P 0) = p2P 0 p

P/T-nets8with negative tokens = incl

denotes a meaningful Petri net type that is de ned by the

NEW corresponding ow structure functor and marking structure

functor but has not yet been introduced { as far as we know. a formally well-de ned Petri net type, but probably not too  ??? isuseful. The extension to ow and marking structure is achieved by using two di erent adjunctions instead of one. This allows the simple adoption of the actual ws-main-3dim: submitted to World Scienti c on 19th June 2000

6

results9 , where the assumptions are the same. Thus we can easily claim { among others { the following results.

Claims 2.6 Given the Petri net type (Flow; Mark; ) and the corresponding category PN we can state the following results. 1. Morphisms preserve ring: Given a morphism f : N1 ! N2 , then the ring of a transition t in N1 implies the ring of f (t) in N2 T

2. Construction of the marking graph: There is a marking graph functor, that maps each net to its marking graph in the corresponding category of marking graphs. 3. Structuring techniques: The category PN is cocomplete, that implies that structuring using union and fusion15 16 is well-de ned and compatible rule-based re nement. 4. Compositional marking graph: The marking graph functor is cocontinuous, that implies that the marking graph construction preserves the structuring techniques union and fusion. ;



3 Conclusion Low-level Petri net classes are nets with unstructured tokens. Typical examples are place/transition nets, ordinary nets, elementary nets, S-graphs, and others. We have given a classi cation of these net types by exploiting category theory. There are two parameters identi ed: the ow structure and the marking structure. Both of them are given in terms of adjunctions.These adjunctions determine the construction over the set of places, that describes the ow and the marking structure. Future work will comprise the transfer from previous results9 , concerning horizontal and vertical structuring. We conclude by discussing the extension of this Petri net classi cation to high-level nets9 . The treatment of the data type is essential for high-level nets. The right abstraction of the data type has to be valid for several kinds of algebraic speci cations, predicate logics, functional programming languages as ML, indexed sets, and others. Already an approach9 10 has been introduced that achieves independence of the net structure. The data type part is treated separately by using the categorical notions of institutions17 and speci cation ;

ws-main-3dim: submitted to World Scienti c on 19th June 2000

7

frames18. The step from algebraic speci cations to institutions or speci cation frames is based on the idea of using category theory to reformulate the classical theory of algebraic speci cations for di erent kinds of speci cation formalisms. Institutions and speci cation frames can be used to cover classical algebraic speci cations, order sorted algebraic speci cations, behavioral speci cations, projection speci cation, predicate logic, and model theory. Thus several di erent high-level net types like algebraic high-level nets, predicate transition nets, and colored nets can be described this way9. The classi cation of Petri nets { low- as well as high-level nets { uses three universal descriptions. In case of low-level nets two adjunctions for the ow and the marking structure are employed. In case of high-level nets additionally the data type part is described in terms of speci cation frames and institutions 9 . These descriptions can be considered as parameters of Petri net types9 10 . This parameterization is the formal foundation of the Petri Net Baukasten19 20, an application-oriented Petri net technology, developed by the "DFG-Forschergruppe Petrinetz-Technologie". ;

;

References 1. C.A. Petri. Kommunikation mit Automaten. PhD thesis, Schriften des Institutes fur Instrumentelle Mathematik, Bonn, 1962. 2. W. Reisig. Petri Nets, volume 4 of EATCS Monographs on Theoretical Computer Science. Springer Verlag, 1985. 3. G. Winskel. Petri nets, algebras, morphisms, and compositionality. Information and Computation, 72:197{238, 1987. 4. J. Meseguer and U. Montanari. Petri Nets are Monoids. Information and Computation, 88(2):105{155, 1990. 5. M. Nielsen, G. Rozenberg, and P.S. Thiagarajan. Elementary transition systems. TCS, 96:3{33, 1992. 6. H. Ehrig, M. Groe-Rhode, and U. Wolter. On the role of category theory in the area of algebraic speci cations. In LNCS , Proc. WADT11, Oslo. Springer Verlag, 1996. 7. J. Adamek, H. Herrlich, and G. Strecker. Abstract and Concrete Categories. Series in Pure and Applied Mathematics. John Wiley and Sons, 1990. 8. H. Ehrig, J. Padberg, and G. Rozenberg. Behaviour and realization construction for Petri nets based on free monoid and power set graphs. In Workshop on Concurrency, Speci cation & Programming. Humboldt University, 1994. Extended version as Technical Report of University of Leiden. ws-main-3dim: submitted to World Scienti c on 19th June 2000

8

9. J. Padberg. Abstract Petri Nets: A Uniform Approach and Rule-Based Re nement. PhD thesis, Technical University Berlin, 1996. Shaker Verlag. 10. H. Ehrig and J. Padberg. A Uniform Approach to Petri Nets. In Ch. Freksa, M. Jantzen, and R. Valk, editors, Foundations of Computer Science: Potential - Theory - Cognition. Springer, LNCS 1337, 1997. 11. Ekkart Kindler and Michael Weber. The dimensions of Petri nets: The Petri net cube. Informatik-Bericht, Humboldt-Universitat zu Berlin, 1998. To appear. 12. Eike Best. Semantik. Vieweg-Verlag, 1995. 13. G. Rozenberg and P.S. Thiagarajan. Petri nets: Basic notions, structure, behaviour. In Current Trends in Concurrency, pages 585{668. Lecture Notes in Computer Science 224, Springer, 1986. 14. P. Starke. Analyse von Petri-Netz-Modellen. B.G. Teubner Stuttgart, 1990. 15. J. Padberg, H. Ehrig, and L. Ribeiro. Algebraic high-level net transformation systems. Mathematical Structures in Computer Science, 5:217{ 256, 1995. 16. Julia Padberg. Categorical Approach to Horizontal Structuring and Re nement of High-Level Replacement Systems. Applied Categorical Structures, 7(4):371{403, December 1999. 17. J.A. Goguen and R.M. Burstall. Introducing institutions. Proc. Logics of Programming Workshop, Carnegie-Mellon, Springer LNCS 164:221{256, 1984. 18. H. Ehrig and M. Groe-Rhode. Functorial theory of parameterized speci cations in a general speci cation framework. Theoretical Computer Science, (135):221{266, 1994. 19. Alexander Borusan, Olaf Fricke, Maike Gajewsky, Ekkart Kindler, Sabine Lembke, Julia Padberg, Tobias Vesper, Herbert Weber, and Michael Weber. Foundation Concepts of the Petri Net Baukasten, 1998. http://www.informatik.hu-berlin.de/PNT/pnt-public.html. 20. Alexander Borusan, Hartmut Ehrig, Juliane Dehnert, Olaf Fricke, Maike Gajewsky, Ekkart Kindler, Sabine Lembke, Axel Martens, Julia Padberg, Wolfgang Reisig, Tobias Vesper, Herbert Weber, and Michael Weber. Initial Realization of the Petri Net Baukasten. Technical report, DFGForschergruppe Petri Net Technology, 1999.

ws-main-3dim: submitted to World Scienti c on 19th June 2000

9