An algebraic characterization of the behaviour of non-sequential systems

An algebraic characterization of the behaviour of non-sequential systems

INi~ORMAT~~N PROCESSING LETTERS System, August 1977 prc)cctss, Petri net, partial sequence, sequential composition, parallel compos! tion. Such a ...

767KB Sizes 3 Downloads 46 Views

INi~ORMAT~~N PROCESSING LETTERS

System,

August 1977

prc)cctss, Petri net, partial sequence, sequential composition, parallel compos! tion.

Such a net, together *.Gth a set Cof subsets of& represents a (non-%quential) system S in the followThe aim of this paper it to show how sets of pro-

cesses generated by non-sequential systems can be c~racterized algebrai~~y. As mathematical models of non-sequential systems we choose Petri nets, assuming their basic interpr~~tion (see ref. [3f). Our main idea is to convert the basic interpretation which is informal into an algebraic ch~acteri~a~o~ of sets of processes. We avoid considering Petri nets as in automata capable to generate only linear sequences of states (this aould lead to rather large sets of states and also to a loss of information on the real concurrency). instead of linear sequences we introduce new structures, called partial sequences, which better represent non,~quential processes. Then we define sequential and parallel compositions of partial ~quen~es. This gives us a po~ibi~ty to characterize algebraically the classes of processes generated by non-sequential systems without any loss of information on occurrency. 2, ~epr~~nt~~ non~~~ent~~ ~yst~~~ &3yPetri nets A Petri net is a triple N = (B,E,1;3such that: (Nl) (N2)

BnE=(B, BuE#Q),

(N3)

F!iiBXEUEXB,

w9

domain(F)

U

range(fl = 63U E.

* Thispaperwas supported by the Polish Academy of

Sciences.

ing way: Tk eleme Its of B, called ct~~~~~r~~~~s, represent ziomic sentences about the system S which may hold or not ‘- de~n~ng on the ~~u~es~e~: which occur in S. The elements of E, called events, represent ele~~entary processes which may occur ir;lrthe syslem S.

Each occurrence of an event e E E ends a holding of its preconditions QE (x E fz: (x, t) E I”) and begins a holding of its pstconditions b E (x E B: (e, x) E F}.

A holding of a monition b E B be~~zswith an occurrence of exactly one event d E ~JJE. E: (y, b) E F). A holding of a condition li E B ends with an occurrence of exactly one event e Eb E E: Ib, y) E F). The elements of C, called CGS~S, represent mammal subsets of conditions which may hold concurrently in the system S. E~~~~e 1. Let S be a system co~~~s~ngof two sequential parts 1 and 2 which contain critical sections, and of a binary seashore which prevents one part from entering its critkal section whenever the other part is in its critical section. This system can be described by the net shown in fig. I (conditions are

V~Iurn~6,

INFORMATION PROCESSING LETTERS

number4

represented by circles, events by boxes, and ordered jg;airs(x,y) by directed arcs from x :u y). Part 1 enters (event e) the critic:~lsection if it is ready to do so (condition p) and the semaphore is open (condition 4). Htremains there [condition s) during a certain period, and then leaves the critical section (event i). As result, it releases the semaphore (condition u) and is ready to work (condition u), After a certain work (Event !z)the part is again ready to enter the critical section (condition p), etc. Similarly, part 2 enters (event fl its critical section (condition t) if ready ((condition r) and if the semaphore is open (condition 4). After a certain period it leaves (event k) the critical section, thus releasing the ~maph~re ~~onc~tionu) and beco~ng ready to work (condition w). Next, it works (event i) and is ready to enter the critical section (condition r). The semaphore changes (event g) its state to open (condition q) if reieased (conCition u). Cas:?sare those sets of conditions which contain exactly one of the conditions p,s,u, exactly one of the conditions r,l,w, and at most one of q,u. Reprc::entingever:/ holding of a monition by a presence of a marker in the corresponding circle we give an illustration of the processes in the system in fig. 2.

August 1977

3. Processes as partial sequences Any process generated by a system S represented by a Petri net N and a set C;of oases can be considered as consisting of holdings of conditions. These holdings are partially ordered by a causal relation (the holdings which end with an occurrence of an event are immediate causes of the holdings which begin with that occurrence). The set of holdings of conditions in the process, the causal relation, and the function assigning conditions to their holdings, represent a structure which may be identified with the process itself. Structures of this type, called partial sequences, can be defined as follows. By a ~~~elle~~~~~~~1~ ordered set (I.p.0. set) we mean a triple s = (X, 6, I) which consists of a partially ordered set (X, Q and of a mapping 1: X + L such that:

(Ql)

I(x) = l(y) implies x G y or y G x

(see example 4). The mapping I is called a ~~t?ZZ~~g of X. The value Z(x)is called the label of x. Ifs represents a process then the elements of X are interpreted as holdings of certain conditions, the ordering < as a causal relation, and the labelling I as an assignment that assigns the correspon~ng condition to its holdings. Property (al) means that all holdings of the same condition are always in the causal relation one with the others. Two 1.p.o. sets s = (X, \<, I) and s’ = (X’, G’, 1’)are said to be ~so~or~~~ciff there is a bijection f : X + X’ such that: x Gy iffflx) G’m) , l(x) = r’Cf(x)) .

h

Fig. 2.

If two processes are represented by isomorphic 1.p.o. sets then we consider them to be identical. The class of the 1.p.o. sets which are isornorp~c with an 1.p.o. set s is denoted by [sf. By a yartial sequence we mean a class of isomorphic 1.p.o. sets. In the sequel processes are considered to be partial sequences. The role of a Petri net Nin the description of a system S is that it determines a set flIV’,lof alementary processes which can occur in S. These elementary processes are given by the conditions and events of AL Every condition It may be considered as a trivial process wi& no changes which can be ident~~ed with the

Volume 6, number 4

INFCRT\lATlOI’? PROCESSING LETTERS

9

P

I---------

-- ‘1 9 ’ I

_- ____ ___^__I e

__________-_-, i

Qgf

I I I L____--

f

i -__.!

[s:; ig-1 __

-_.’

s

J’

t.

:_._

h

k

rig. 3.

one-element partial sequence with the label b. Every event e may be considered as a process consisting of minimal and maximal elements only, where the labels of the minimal elements are exactly the preconditions of e, the labels of the maximai elements are exactly the pjstconditions of e, and every minimal element preceu ba every maximal element (or is an immediate cause of it). Elementary processes are the s,:r?plest components of the system behaviour. Some of them can be executed one after another or some others in parallel which leads to certain compound processes. This gives a set of all processes which can occur in the system, and thus a characterization of the system behaviour. 111what follows we shall make this characterization precic,e using a!sebraic operations on partial sequences which correspond to sequential and parallel compositions of processes. Example 2. The net in fig. 1 determines the set p(N)

of the elementary processes depicted in fig. 3 (compound processes will be shown in examples 3 and 4).

4.

Algebraicoperationson partialsequences

Our understanding of the sequential composition of two processes a 1 and a2 is such that a2 is executed after al, starting from data which are the results of al. On the other hand, the parallel composition of two processes al and a2 is understood to be an independent execution of al and a2. We reflect this in the definitions below of the sequential and paral!el compositions of partial sequences.

August 1977

In order to define the sequential and parallel corn-positions of partial sequznc;cs we first introduce two auxiliary partial unary operations a, and 3, assi&ing a “source” and a “target” respectively to a partial sequence. For J process the source may be considcrzd as the data or the initial situation of the process, whereas the target may be considered as the result or the final situation of the process, The source a,(a) is defined for such partial sequences a = [(X, G, l)] where for every x E X there is a minimal element x0 of (X, q satisfying x0 G x. Then we define a,(a) as the partial sequence [(X0,
X=(l)

xx1

u(2)

X(X, \Xo),

iff there are x’, $I’such that x=(l,x’)andy=(l,y’)andx’G1y’or x = (2, x’) andy = (2,~‘) and x’ G2 y’ or x = (1, x’) and y = (2, y’) and x’ $ 2 $ .Y for some z E X0,

x
4 (x1)

for x = (1, x’)

Z2(x’)

for x = (2, x’) -

Z(x) = i

The parallel composition a 1@ a2 is defined for partial sequences a 1 and a2 such that the sets of la of the elements

of al and

82

are disjoint. The result 107

August 1977

INFORMATION PRDCESSliNG LETTERS

Volume 6, number 4

is decked 3s a partialsequence~o~sist~n~of two independent parts ~orres~nd~ng to a 1 and ~22.Formally, ifar = [(X,, Gr, Zr)] anda = [(X2, %, &)I with tr(.&) r) I&%?Z)= Q then we define a1 @ a2 as [(X, G, 01, where:

x $y iff there are x’, y’ sc-chthat ~=(~,~‘)andy=(l,~‘)and_~‘~~ y’ Of x = (2, x’) and y = (2, u’) and x’ $ y’ , ll (x’)

5. Sets of processesgeneratedby ~~~~~~~e~t~i systems

for x = (1, x’)

l(xJ = 1 I#)

for x =:(2, x’) .

There is also the empty sequence 0 = [(Q,~,Q)~. ft is easy to check that all these operations are defined correctly and have nearly the same properties as the o~rat~ons in strict monoidal categories 121. For instance, the sequential and parallel compositions are associative, the parallel composition is commutative.,(a ci~b) (a’s b’) is defined whenever a a’, b * tt’, a * &ZJ b * 6’ are defined, and then l

(a@ b)

l

l

(a’@ b’) =(I a’@ b l

l

b’.

~‘~a~~~~3. For the processes in fig. 3 we have

Z),(e)=p@ (I,

We)

=s y

i&&f,=fpW,

wo

=t,

a,(j

j

&_

j

Beh(S) s=Proc(N) f~ Q(c) .

, a,(j)=U@zl,

Exarnpk 4. Acoordinq to our definition the process,

'

f isundefined [Z+(e) # Z.Ie(#‘)] , e@j?s undefined (4 is a common label of e andn, and e 1, faj are given in fig. 4 (we omit archs which result from the transitivi ty of ordering relations). cr;'

The behaviour of a non-sequential system S can be described by characterizing the set of processes generated by S. For this purpose we reprevnt S by a Petri net N with a set C of cases and define the set Beh(s) of processes generated by S as the intersection of the following two classes Proc@) and Q(C). The class Proc(N’)is defined as the least set such that: (Pl) the set P(N) of elementary processes determined by the net Nis contained in Proc(N), (PZ) every process which is a sequential or parallel cornpo~,~on of processes from ~oc(~ belongs to Proc(N). The class Q(:C,is defined as the class of processes a = [(X, G, Z)] sllch that for every subset Y of incompar able elements of (X, q the set I(Y) of labels of elements elf Y is a subset of a case belonging to C. Finally, we have:

*

l

(

.-----_-

_^____

1

i

I

f

I I

l

6. Describingthe bebuiour of a systemby equations The algebraic operations on partial sequences give a possibility to introduce the following operations on sets of partial sequences: se(c) = {a: a = a,(c) for some c E C) ,

I

I I

t I

L

given in fig. 5 ble~ongs60 Beh(s) for the system S described in ex‘ample1

---s-m.

--......s._...s

f%i

f 1 J

0

+(a:a-c*c’

rsomecEC, &EC},

C@d={a:a=ce9c’forsomecEC,c’EC), Fig. 4.

O=(O).

Volume 6, number 4

INEORMATION PROCESSING LETTERS

has been done by Blikle [I ] for sets of linear sequences. This gives continuous operations in the lattice K of sets of partial sequences, i.e., the following conditions are satisfied:

Similarly,

as

( 1=u

a*

U Cj

iEX

iEI

aO(c,)

9

( )= al(G)

al iF:uIci

i&

for every chain {C’i}i,l of elements of K, and

August 1977

a set C of cases. Then every process from Proc(,‘tl is a process from P(X), 01 b parallel composition of processes from A(N), or has an initial part which is a parallel composition of processes from 19(N), and this initial part Is composed sequentially with the rest of the procers. Thus, the set Proc(N) is the least solution of the equation: X=Y*XUY, where Y is the closure of&N) with respect to the parallel composition, i.e., the least si;!uiion of the equation: Y=qN)C3YUp(N). Finally, we obtain the following set of’equations:

for every chain {(Ci, C;)}iel of elements of the proattice K X K. Thus, every mapping f :An + Kn defined as a combination of these operations is continuous and, due to the well known Tarski’s theorem, has fixed points. Moreover, the least fixed point C of f alwirysexists and is given by the formula:

X=Y*XUY,

and the least solution of this set gives Beh(S’) = Z.

C=fi:Q”) ufcf(Q”)) u ._. , where 9” = (9, . . . . 9) E K”. This allows one to solve sets of equatiolrs of the form: Xl =fi(xl,

I wish to thank A. Blikle, P. Dembiriski, W. Kwasowiec, J. Leszczyiowski, J. Maluszyriski, and A. Mazurkiewicz for many stimulating discussions.

-*,Xn),

l

. . .... . .... xn =fn(Xl, --*3Xn) 9 where fi, m.,fn are defined l

Acknowledgments

using the introduced oper-

ations. For instance, the closure of a set C of partial sequences with respect to the parallel composition is the least solution of the equation:

References 111A. Blikle, An Algebraic Approach to Programs and their

x=c@xuc. The above facts allow one to characterize aigebraically sets of processes generated by non-sequential systems. The idea is as follows. Let a system S be represented by a Petri net N and

VI VI

Computations, Proc. of MFCS’73 Symp., High Tatras, 1973. S. MacLane, Categories for the Working Mathematician, (Springer-Verlag, 197 1). C.A. Petri, Interpretations of Net Theory, GMD, Bonn, 1975, paper presented at MFCS’75 Symp., Marianske Lazne, 1975.

c

109