Comparing the Modelling Power of Petri Nets and Q-Models

Comparing the Modelling Power of Petri Nets and Q-Models

Copyright © IFAC Artificial Intelligence in Real-Time Control, Bled, Slovenia, 1995 COMPARING THE MODELLING POWER OF PETRI NETS AND Q-MODELS Jaanus T...

1MB Sizes 0 Downloads 86 Views

Copyright © IFAC Artificial Intelligence in Real-Time Control, Bled, Slovenia, 1995

COMPARING THE MODELLING POWER OF PETRI NETS AND Q-MODELS Jaanus Tekko

Chair of Real-Time Systems, Tallinn Technical University, Ehitajate tee 5, EE0026, Tallinn, Estonia j [email protected]

Abstract: The modelling powers of Petri Nets and Q-models - formal models used for the specification of real-time systems - are compared. The main goal of this comparison is the indirect study of the applicability of Q-models. The comparison is based on the languages, generated by the formalisms. Using several modifications of both models, the relations between modelling powers are clarified. Keywords: Models, Formal methods, Software specification, Petri Nets, Real time.

1. INTRODUCTION

Modelling power is an important characteristic of a formal model. It is the ability of a modelling technique to give to different aspects of reality a properly different description. Low modelling power makes a technique unusable for the modelling of certain problems.

Practical applications of intelligent control methods are characterised in (Matus, 1994) as essentially influenced by the heuristic approach. A method based on Q-model (Matus and Rodd, 1994) is suggested as an non-heuristic approach for detecting and eliminating at systems specification and design stages some risk factors introduced by intelligent methods.

In this paper the modelling power of Petri Nets and Q-models are compared. Petri Nets are chosen because the theory and its connections with other formalisms are well studied (Peterson, 1981). Therefore the comparison will probably help to clarify the role of Q-models among other formalisms.

The Q-model introduced by Quirk (1977) and extended by Motus (1994) is a computational model for the description and analysis of parallel, cyclically and sporadically performed activities, with timeselective interprocess communication using timing constraints. However the set of evidences (e.g. number of solutions of real problems where the Qmodel has been used), is still too small to claim, that the Q-model theory works well in practice. This paper is an attempt to investigate this problem from a theoretical point of view, by comparing Petri Nets and Q-models.

The comparison is based on the languages generated by both models. Languages are accepted as appropriate means to compare formal models (Peterson and Bredt, 1974). Often several languages are defined for example 12 types of Petri Net languages in (Peterson, 1981). Usually they are different and therefore give slightly distinctive modelling powers to the model. The language only characterises behavioural characteristics of the model leaving out its structural features. Alternative methods of comparison using both characteristics have some weak points too (Peterson, 1981) and behaviour is the most important feature of a model.

Petri Nets have been used since many years for modelling systems. Various aspects of Petri Nets have been thoroughly investigated, including its modelling and analysis power. 19

A hierarchy of connections between modelling power of modifications of Petri Nets and Q-models is presented as result of this paper. The real meaning of simplifications made to the Q-model is discussed.

process can finish only if it already got at least the input data. The behaviour of a Q-model is precisely characterised with possible time labelled sequences of finished processes. A number of the formalisms do not involve explicit possibilities for the analysis of quantitative timing properties (e.g. the length of time delay between given events). That is why the simplest Q-model language is defined without time labelling of finished processes.

2. THE Q-MODEL Formally a system described as a Q-model (Motus and Rodd, 1994) consists of processes and channels. It is considered to be the pair (p,r), where P=(Pl,P2''''Pn) is the set of processes and r S; PxP is the set of channels.

Definition 1 The language L{ q) of the Q-model q with alphabet P (the set of processes of q) is the set of all words on alphabet P. A sequence of elements of P is a word if and only if the Q-model q can generate it as an ordering of finished processes.

The set. P, is partitioned into common and selector processes. A process is a mapping and is defined as follows: (1) T(p) x dom p - val p, where p represents a process, T(p) the process' timeset and dom p and val p are the sets of all possible input and output values of that process.

In the following comparison just one simplification to Q-models is made. Formally, the simplification is: for each process the execution time [Xmin'X max ], is replaced with [Xmin' 00]

A selector process is a mapping with multiple domains and value ranges from which it can select. The timeset T(p) for process pEP contains all the times at which the process starts afresh. A timeset may be explicitly defined or identical to or generated by another process.

This simplification means from a Q-model language point of view that the finishing time of a process can always be postponed. A process can be finished, if it is activated and has got all its input data. It is proven, that lemma 1 holds: Lemma 1. A sequence of elements of P named w belongs to L{q) (wEL{q)), if and only if for each place z in w, the prefix generates for process on place z the activation and input data (corresponding number of times).

In addition a process has the following parameters: • Equivalence Interval Emax determines a timeinterval during which, activation attempts following a successful activation attempt, will be suppressed.

Semantically the simplification forces pure timing relations to disappear and leaves only causal relations. That is why this (simplified) Q-model is now easily transformable to a Petri Net.

• Data Consumption Time [Cmin' Cmax ] represents the bounds of data consumption time for every input channel. • Execution Time [Xmin' Xmax] represents the bounds of execution time for a process.

3. THE PETRI NET

A channel describes the relation between the timesets of two processes and the transfer of data between those processes. Those are determined by channel type and channel function. In most cases the activation of a process guarantees that input data for a process is available for its execution. Only with synchronous channels (connected processes with identical timesets) can it happen that a process has to wait for input data.

Despite Petri Nets have been used long time, there is still active research going on in the field (Jensen and Rosenberg (Eds), 1991). In this paper only ordinary Petri Nets are used. However timed Petri Nets (Ghezzi, et al., 1991) seem to be in some points closer to Q-models than ordinary Petri Nets are. Definition 2 A Petri Net is a 5-tuple N = where: • P and T are a non empty infinite sets of places and transitions; • F and H are functions F: PxT - Nand H: TxP -N; • MO is an initial marking, MO : P -+ N U {w}, where N = {O, I, ... }.

The moment when a Q-model process finishes, characterises its behaviour much better then the activation time does, because the activation times can be predefined by the activation interval and a process starts regardless of the availability of input data. This is not the case with the termination moment, since a

20

A graphic representation of a Petri Net is a directed graph with two types of nodes: circles and bars. F and H are represented by multiple arcs. The initial marking is represented accordingly with tokens inside circles.

Other possibilities for comparing the modelling powers are: either based on analysis of state space and structure (Lipton et ai., 1974), or based on both, structural and behavioural characteristics (Peterson and Bredt, 1974).

A transition t is enabled at the marking M if and only if: VpEP ( M(p) - F(p,t) ~ 0 ) (2)

A class of models A defines a class of languages L(A). Definition 5 Two classes of models A and Bare defined to be equivalent if L(A)=L(B) The modelling power of class A is defined to be less or equal to the class B, if L(A)kL(B).

When one of enabled transitions (let it be t*) works the marking M of the Petri Net will change as the following formula requires: VpEP ( M'(p) = M(p) - F(p,t*) + H(t *,p)

(3)

Let q be a Q-model. A transformation \I' is constructed, so that Q= \1'( q), where Q is a Petri Net and L(Q)=L(q). If it is so, then according to definition 5, it is clear that the modelling power of Q-models is less or equal to the modelling power of Petri Nets.

A sequence of the worked transitions can be taken as a word in the alphabet T of transitions and the set of all words as a language. Different types of languages appear, if the alphabet of the language and the set of transitions are not exactly the same sets.

A transformation from a Q-model to a Petri Net, where the Q-model is assumed to be without selector processes and with equivalence intervals set at Emax=O, is defined and some proved results discussed. Selector processes and longer equivalence intervals are added to the transformation later on.

The language types used for comparison are: • the language pf - if the transformation from the set of transitions T to alphabet I 0 : T - I is one to one, and an empty word ( denoted by A ) does not belong to the alphabet, and all possible markings are the final markings;

The transformation (given on fig. 1) is the following :

• the language LA - 0: T - I is not one to one, and an empty word A belongs to the alphabet, and the final markings are fixed.

1) a Q-model process Pi is transformed to one place k and one transition Ei

2) a channel which passes data ( with type asynchronous (a), synchronous (s), or semisynchronous (ss» ci=( Pi l' Pi 2) is transformed into a triple of two arcs Eil-Oi and ~'>j-Ei2, and a place Oi ' for semisynchronous channel some more arcs are added: always an arc Ei I-Ok where Ok is the activation place of Pi2'

Definition 3 Petri Net N = is a marked graph if and only if VpEP (I{ t I H(t,p) > O}I = 1 & I{ t I F(p,t) > O}I =1 ) (each place is connected with transition from both sides).

°

exactly one

3) initial marking of places of Petri Nets is following : Definition 4 Petri Net N = is a free choice net, if and only if

• all places that correspond to a semisynchronous or asynchronous channel have w tokens;

VtET & VpE!t, where It ={ pi F(p,t) > O} , holds: • all places that correspond to a synchronous channel with function cf(m,n) have n tokens ; (each transition has exactly one input place or each input pl ace of that transition has exactly one output arc).

• If a Q-model process has an activation interval, then corresponding activation place of Petri Net has w tokens and the same for activation places of processes which have a synchronous link to that process.

4. COMPARING THE MODELLING POWER OF Q-MODELS AND PETRI NETS The following comparison of modelling power of the Q-model and the Petri Nets is based on the languages aenerated bv both formal isms.

'"

,

Now some results are formulated , proofs are given in (Tekko, 1988).

21

An element of the Q-model

According part of Petri net

=>

O;--->1t 1 1

=>

~t 1 1

cf(2.x)

Lemma 1. For Q-models qEQ * following holds : if Q=1jJ( q), then all transitions in Q are reachable if and only if the Petri Net Q is alive . This gives the basis for correspondence between Qmodels Q* and alive Petri Nets .

~

k2 t2 t 1 ~Pl ~~

Theorem 2. If qEQ * and each process of q is potentially active, then the Petri Net Q ( Q=1jJ(Q) ) is alive .

~Pl

::

Till now a transformation 1jJ into Free choice net - a subclass of Petri Nets, and pf -type of Petri Net language were used. For Q-models in addition to unlimited execution time of a process, also equivalence interval was zero and selector processes were missing. In Fig. 2 and Fig. 3 the Petri Net parts are given that correspond to equivalence interval and selector process notion . Now

An arc in to acti va tIOn place of each process. whi ch is connected with p I through synchronous channels

Fi g. I. Transformation 'tjJ from a Q-model into a Petri Net.

the LA-type of Petri Net languages is also used. Theorem 1. For each Q-model q a Petri Net Q='tjJ( q) can be found , so that corresponding languages L( q) and L(Q) are 1jJ-equivalent, i.e. 1jJ(L( q»=L(Q) .

In the corresponding transformation (given on Fig. 2 and Fig. 3) the theorems remain valid but an other Petri Net language LA is used . The only restriction about Q-models that remains unchanged is the unlimited execution time .

The following intermediate result about Q-models Q", where processes are activated either by start interval (set of activation moments is infinite) or by other process, also holds.

In Fig. 4 all unnumbered connections between modelling powers are completely verified . There is a reason to believe connection 1 on the basis of works in (Vain, 1987), where an attempt to compare Petri Nets and Q-model was made . Thi s comparison was based on structural and behavioural characteristics of Petri Nets and Q-model.

p

s

5_ CONCLUSIONS

a selector process

The hierarchy of modelling powers of Petri Nets and Q-models was constructed.

according fragment of the Petri Net Fi g. 2. Transformati on of a selector process Ps with two output ports connected to P2, P3, P4 via asynchronous channels k 1,... ,k4

Fig. 3. Modelling of equivalence interval (to works if an activation appears, t1 works if process was started, t2 works if activation was suppressed).

22

Ordinary Petri Nets

Q-model

Free choice nets

Lipton,R., L. Snyder and Y.A. Zalcstein Comparative Study of Models of Computation. In: Proc. of the 15th Symposium on Switching and Automata New York. IEEE.

Q-model with unlimited execution time and variable equ ivalence interval

(1974) Parallel Annual Theory.

Matus, L. (1994). The Impact of Safety and Reliability Requirements on the Specification of Control Systems. In: IFAC Workshop on Safety. Reliability and Applications of Emerging Intelligent Control Technologies, Hongkong. Matus, L. and M.G. Rodd (1994). Timing Analysis of Real-Time Software. Pergamon.

Q-model with unlimited execution time of processes and with equivalence interval 0

Peterson, J. and T. Bredt (1974) . A Comparison of Models of Parallel Computation. Information Processing 74, In: Proceedings of the 1974 IFIP Congress, Amsterdam: North-Holland.

Q-model with unlimited execution time of processes and with equivalence interval 0 and without selector process

Peterson, J.L. (1981). Petri Net Theory and the Modelling of Systems. Prentice-Hall, Englewood Cliffs. Quirk, WJ. and R. Gilbert (1977) . The Formal Specification of the Requirements of Complex Real-Time Systems.A.E.R.E. , Harwell.

Marked graphs Fig. 4. Connections between Q-models and Petri Nets based on modelling power (arcs show the direction of decreasing modelling power).

Tekko, J. (1988). The Comparative Analysis of Quirk Model and Petri Nets Based on Quirk Model Language. Proc.of Academy of Sc. of Estonia, Physics, Mathematics , Vol 37, N. 1, 18-25 (in Russian).

The important result is, that if the Q-model is simplified a little, allowing the maximum execution time of processes in Q-models to be infinite, than the modelling power of the simplified Q-model is not more, and probably less, than the modelling power of Petri Nets .

Vain, J. (1987). A Comparison of Petri Nets and Quirk Model Using Modelling Power. Proc.of Academy of Sc. of Estonia, Physics, Mathematics, Vo136, N. 2, 324-333 (in Russian).

From this the actual role of time parameters in Qmodels can be deduced: • as soon as time parameters are not considered to be important, the modelling power reduces a lot; • if the Q-model technique is used, then time parameters are not only very important, when the task contains time restrictions, but other properties of the task should be converted to some time properties of the specification.

REFERENCES Ghezzi , C , D. Mandrioli, S. Morasca, and M. Pezze (1991). A Unified High-Level Petri Net Formalism for Time-Critical Systems. IEEE TraIlS. Software Eng.,Vol. 17, N.2. Jensen. K. and G. Rosenberg (Eds.) (1991). Highlevel Petri Nets. Springer-Verlag. 23