Keywords

1 Introduction

Petri nets [14] is one of mathematical modeling languages for the description of all kind of parallel systems and they represent a popular formalism connecting advantages of the graphic representation of a modeled system with the possibilities of its simulation and the formal analyzability. Property-preserving Petri net process algebras (PPPA) [6] were originally designed for the specification and verification of manufacturing systems. PPPA also follows many ideas that can be originally seen in the class of workflow nets [5]. The elements of PPPA are the Petri net processes, an ordinary connected Petri nets with a unique entry place, a unique exit place and a set of places for handling resource sharing with their initial marking allowed. Among other features, PPPA does not need to verify composite components because all of their operators preserve many properties. PPPA have five types of operators: extensions, compositions, refinements, reductions and place-merging. All the operators can preserve about twenty properties (some under additional conditions), such as liveness, boundedness, reversibility, traps, siphons, proper termination, etc. Hence, if the primitive modules satisfy the desirable properties, each of the composite components, including the system itself, also satisfies these properties.

In this article we will generalize PPPA for the special class of the P/T Petri process nets (PTPN), define the only one PTPN transformation called PLACE_SUBST and present its base characteristic of the well-formedness and purely-formedness properties preservation. This class of PTPN with the support of the PLACE_SUBST transformation can be then successfully used in the area of design, simulation and verification of programming systems executed in distributed or parallel environment. This fact is then demonstrated on the simple example of the distributed programming system based on the client-server architecture.

2 P/T Petri Process Nets and Their Properties

Let N denotes the set of all natural numbers, N: = {1, 2, …}, N0 the set of all non-negative integer numbers, N0: = {0, 1, 2, …}, ∅ the empty set, ⌐ the logical negation operator, |A| the cardinality of the given set A, where |N| = ℵ0.

Let A be a non-empty set. By the (non-empty finite) sequence σ over the set A a function σ can be understood, σ: {1, 2, …, n} → A, where nN. The function ε: ∅ → A is called the empty sequence over the set A. The sequence σ: {1, 2, …, n} → A is usually represented by the notation σ = a1 a2an of the elements of the set A, where ai = σ(i) for 1 ≤ i ≤ n.

Let A = {a1, a2, …, an}, where nN, is a finite non-empty set. Vector V is a function V: AN0. We will denote a vector V by the statement V = (V(1), V(2), …, V(n)).

Let V = {(V(1), V(2), …, V(n)) | V(i) ∈ N0 for 1 ≤ i ≤ n} and W = {(W(1), W(2), …, W(m)) | W(j) ∈ N0 for 1 ≤ j ≤ m}. Then

$$ \begin{aligned} {\mathbf{V}} \otimes {\mathbf{W}} & = \{ \left( {V\left( 1\right), \ldots ,V\left( n \right),W\left( 1\right), \ldots ,W\left( m \right)} \right)|V\left( i \right) \in N_{{\mathbf{0}}} \,{\text{for}}\, 1 \le i \le n,\,W\left( j \right) \in N_{{\mathbf{0}}} \,{\text{for}}\, 1 \le \\ & \quad \;\;\;j \le m\} ,\,{\text{if}}({\mathbf{V}} \ne \varnothing ) \wedge ({\mathbf{W}} \ne \varnothing ), \\ & \; = {\mathbf{V}},\,{\text{if}}\,({\mathbf{V}} \ne \varnothing ) \wedge ({\mathbf{W}} = \varnothing ), \\ & \; = {\mathbf{W}},\,{\text{if}}\,({\mathbf{V}} = \varnothing ) \wedge ({\mathbf{W}} \ne \varnothing ), \\ & \; = \varnothing ,\,{\text{if}}\,({\mathbf{V}} = \varnothing ) \wedge ({\mathbf{W}} = \varnothing ). \\ \end{aligned} $$

It is clear that the ⊗ is an associative operation (i.e., (VW) ⊗ U = V ⊗ (WU)).

Process net (PN) is an ordered 9-tuple PN: = (P, T, A, AF, TP, RP, IP, OP, RMs), where

  • P is a finite non-empty set of places,

  • T is a finite set of transitions, PT = ∅,

  • A is a finite set of arcs, A ⊆ (P × T) ∪ (T × P),

  • AF is the arc function, AF: (P × T) ∪ (T × P) → N0, AF(x, y) ∈ N iff (x, y) ∈ A, AF(x, y) = 0 iff (x, y) ∉ A,

  • TP is a transition priority function, TP: TN,

  • RP is a finite set of resource places, RPP,

  • IP is the input place, IP ∈ (P \ RP), it is the only one place such that •IP = ∅,

  • OP is the output place, OP ∈ (P \ RP), it is the only one place such that OP• = ∅,

  • RMs is the set of all allowed resource places static markings, RMsMs, where Ms is the set of all the static markings Ms of the PN (see below),

  • (P, T, A) is a connected net.

We will denote the class of all the PNs by the symbol PNET. The given PN is then described with a bipartite graph containing a finite non-empty set P of places used for expressing of the conditions of a modeled process (we usually use circles for their representation), a finite set T of transitions describing the changes in the process (we usually draw them in the form of rectangles), a finite set A of arcs being principally oriented while connecting the place with the transition or the transition with the place and we usually draw them as lines with arrows, the arc function AF assigning each arc with a natural number (such number has the default value of 1, if not explicitly indicated in the PN diagram) expressing the number of removed or added tokens from or to the place associated with that arc when executing a particular transition. Transition priority function TP assigns with each transition the natural number value expressing its priority (with the default value of 1). The finite set RP of resource places is used for expressing conditions of a modeled process containing some initial resources and we use circles with the double line for their representation. The input place IP is the only one non-resource place of PN PN with no input arc(s) and the output place OP is the only one non-resource place of PN PN with no output arc(s). RMs is the set of all the allowed resource places static markings that is subset of the set Ms of all the static markings Ms of the PN PN (the term static marking Ms of PN PN will be explained below). The net (P, T, A) must be connected.

Some commonly used notations for PNs are •y = {x | (x, y) ∈ A} for the preset and y• = {x | (y, x) ∈ A} for the postset of a PN element y (i.e., place or transition).

Marking M of the PN PN is a mapping M: PN0. Marking M then expresses the current status of a modeled process. Marking M can be written as a |P|-vector M: = (M(IP), M(P1), M(P2), …, M(Pk), M(R1), M(R2), …, M(Rm), M(OP)), where P: = (IP, P1, P2, …, Pn, R1, R2, …, Rm, OP), RP: = {R1, R2, …, Rm}, nN0, mN0.

The transition tT is enabled in the marking M of the PN PN if at each input place of the transition t are in the marking M at least as many tokens as required by the value of the arc function AF of the particular input arc of the transition t, i.e., if ∀p ∈ •t: M(p) ≥ AF(p, t). If the transition t is enabled in the marking M of the PN PN, we denote that fact in the form of t en M. Firing of the transition tT itself consists in the removal of as many tokens from each preset place of the transition t as required by the value of the arc function AF of the particular input arc of the transition t, and adding of as many tokens into each of the postset places of the transition t as required by the value of the arc function AF of the particular output arc of the transition t, i.e., it results in changing the marking M into the marking M′, where ∀pP: M′(p) = M(p) − AF(p, t) + AF(t, p), that is denoted by \( M[t\rangle M^{{\prime }} \).

We say that the marking M″ is reachable from the marking M iff there exists a finite sequence σ: = t1 t2 tn, nN, of the transitions t1, t2, , tn, such that \( M[t_{ 1} t_{ 2} \ldots \, t_{n} \rangle M^{{\prime \prime }} \). The set of all the PN’s markings reachable from its given marking M will be denoted by the symbol \( [M\rangle \), the set of all the transition sequences σ: = t1 t2 tn, nN, of the transitions that are fireable from the marking M will be denoted by the symbol \( [M\rangle \rangle \), i.e., \( [M\rangle \rangle : = \{ t_{ 1} t_{ 2} \ldots \, t_{n} |\exists M^{{\prime \prime }} \in [M\rangle :\,M[t_{ 1} t_{ 2} \ldots \, t_{n} \rangle M^{{\prime \prime }} ,n \in {\mathbf{N}}\} \).

Let kN. The following special markings of the PN PN: = (P, T, A, AF, TP, RP, IP, OP, RMs) are defined:

  • static marking Ms: ∀pRP: Ms(p) ≥ 0; ∀pRP: Ms(p) = 0; ∀tT: ⌐(t en Ms),

  • entry marking Me: Me(IP) = k; ∀p ∈ (P \ {IP}): Me(p) = Ms(p),

  • exit marking Mx: Mx(IP) = 0; Mx(OP) = Me(IP) = k; ∀p ∉ (RP ∪ {OP}): Mx(p) = 0; ∀tT: ⌐(t en Mx).

For the given PN PN we will denote the set of all its static markings Ms by the symbol Ms, the set of all its entry markings Me by the symbol Me and the set of all its exit markings Mx by the symbol Mx.

Figure 1, illustrates the PN PROC: = (P, T, A, AF, TP, RP, IP, OP, RMs), where P = {IP, P1, R1, OP}, T = {T1, T2, T3}, A = {(IP, T1), (IP, T2), (T1, P1), (T2, P1), (R1, T1), (P1, T3), (T3, R1), (T3, OP)}, AF = {((IP, T1), 1), ((IP, T2), 1), ((T1, P1), 1), ((T2, P1), 1), ((R1, T1), 1), ((P1, T3), 1), ((T3, R1), 2), ((T3, OP), 1)}, TP = {(T1, 1), (T2, 1), (T3, 1)}, IP = IP, OP = OP, RMs = {(RMs(R1))} = {(n) | nN}, in its static Ms, entry Me and exit Mx markings where k = 3 (note the resource place R1 with the initial token in the static marking Ms and the fact that no transition must be enabled in (any) static Ms or exit Mx markings) where the notation RMs = {(RMs(R1))} = {(n) | nN} means that in any allowed resource static marking Ms the resource place R1 must contain at least one token.

Fig. 1.
figure 1

Static, input and output markings of the PN PROC

A P/T Petri process net (PTPN) is an ordered couple PTPN = (PN, Me), where PN is a PN and Me is an entry marking of the PN PN. We will then denote a PTPNs by an ordered 10-tuple PTPN: = (P, T, A, AF, TP, RP, IP, OP, RMs, Me) and the class of all the PTPNs by the symbol PTPNET.

When enabling individual transitions of a given PTPN so called conflicts can originate in its certain markings (or conflict transitions). At the enabling of the transitions t1 and t2 of the given PTPN in its marking M the conflict occurs, if both transitions t1 and t2 have at least one input place, each of the transitions t1 and t2 is individually enabled in the marking M, but the transitions t1 and t2 are not in the marking M enabled in parallel and enabling of one of them will prevent enabling the other (i.e., (•t1 ∩ •t2 ≠ ∅) ∧ (t1 en M) ∧ (t2 en M) ∧ ⌐({t1, t2} en M)). The term of conflict transitions can be obviously easily generalized for the case of a finite set t1, t2, …, tn (nN) of the transitions of a given PTPN.

A typical example of the conflict transitions in the particular marking of the PTPN is shown in Fig. 2, where transitions T1 and T2 have a common input place IP, both are enabled, but they are not enabled in parallel. When solving such transitions conflict we will therefore follow the rule which determines, informally said, that from the set of conflict transitions the one will be enabled, whose value of the transition priority function TP is the highest. If such transition from the set of conflict transitions does not exist, the given conflict would have to be solved by other means. The transition T2 is then enabled on the basis of that rule in our studied example (because TP(T1) = 1 and TP(T2) = 2).

Fig. 2.
figure 2

Conflict transitions in P/T Petri process net

Definition 1.

Let PN: = (P, T, A, AF, TP, RP, IP, OP, RMs) be a PN, Me be its entry marking. Then:

  • PN is said to be safe iff \( \forall p \in P\,\forall M \in [M_{e} \rangle :M\left( p \right) \le 1 \),

  • PN is said to be k-bounded iff \( \exists k \in \varvec{N}\,\forall p \in P\,\forall M \in [M_{e} \rangle :M\left( p \right) \le k \),

  • PN is said to terminate properly iff

    \( (\forall M \in [M_{e} \rangle \,\exists M_{x} \in {\mathbf{M}}_{x} :M_{x} \in [M\rangle ) \wedge (|[M_{e} \rangle \rangle | \ne \aleph_{0} ), \)

  • PN is said to be well-formed PN iff ∀MeMe: PN terminates properly,

  • well-formed PN is said to be purely-formed PN iff

    \( \forall M_{e} \in {\mathbf{M}}_{e} \forall M_{x} \in {\mathbf{M}}_{x} :(\left( {M_{e} \left( {IP} \right) = M_{x} \left( {OP} \right)} \right) \Rightarrow (\forall r \in RP:M_{e} \left( r \right) = M_{x} \left( r \right)). \)

Example 1.

Figure 3, shows the PNs NET1, NET2 and NET3 in their entry markings Me, where:

  • PN NET1 does not terminate properly, because there exists the infinite sequence of reachable markings \( M_{e} [{\text{T1}}\rangle M_{ 1} [{\text{T1}}\rangle M_{ 2} [{\text{T1}}\rangle \ldots \), and so the PN NET1 is not a well-formed PN,

  • PN NET2 terminates properly for every of its entry markings Me (and so it is a well-formed PN), but it is not purely-formed PN, because \( \exists M_{e} \in {\mathbf{M}}_{e} \exists M_{x} \in {\mathbf{M}}_{x} :\left( {M_{e} \left( {\text{IP}} \right) = M_{x} \left( {\text{OP}} \right) \wedge (\exists {\text{R1}} \in RP:M_{e} \left( {\text{R1}} \right) \ne M_{x} \left( {\text{R1}} \right)} \right) \), where Me = (1, 0, 1, 0) and Mx = (0, 0, 2, 1),

  • PN NET3 is a purely-formed PN.

Fig. 3.
figure 3

PNs NET1, NET2 and NET3 in their entry markings Me

Lemma 1.

Let PN: = (P, T, A, AF, TP, RP, IP, OP, RMs) be a PN. Then (PN is well-formed PN) ⇒ (∀MeMekN: PN is k-bounded).

Proof.

Clear. (PN is well-formed PN) ⇒ (∀MeMe: PN terminates properly) ⇒ \( (\forall M_{e} \in {\mathbf{M}}_{e} :((\forall M \in [M_{e} \rangle \exists M_{x} \in {\mathbf{M}}_{x} :M_{x} \in [M\rangle ) \wedge (|[M_{e} \rangle \rangle | \ne \aleph_{0} ))) \)\( (\forall M_{e} \in {\mathbf{M}}_{e} :((|[M_{e} \rangle \rangle |{\text{is}}{\mkern 1mu} {\text{finite}}) \wedge (\forall M \in [M_{e} \rangle :M{\mkern 1mu}\,{\text{is}}{\mkern 1mu}\,{\text{finite}}{\mkern 1mu}\,{\text{marking}}{\mkern 1mu}\,{\text{of}}{\mkern 1mu}\,PN))) \)\( (\forall M_{e} \in {\mathbf{M}}_{e} \exists k \in \varvec{N}:PN\,{\text{is}}\,k{\text{-bounded}}) \). □

3 Base P/T Petri Process Nets and Their Properties

As it was mentioned in the introduction of this article we want to generalize the PPPA for the class of the PNs. From many properties of PNs we are especially interesting in their well-formedness, resp. purely-formedness, property (in the terminology of programming systems well-formedness property informally means that the programming system modeled by a given PN will not cause deadlock and memory or device overflow and purely-formedness property informally means that given well-formed programming system will not have any side effects). It is of course possible to inspect the properties of traps, siphons, P- and T-invariants etc., of a given PN but it is outside the scope of this article. We will then represent given multithreading programming system by the PN, i.e., programming systems that will be executed in parallel environment by k programming threads, where kN. These programming threads will be represented by k tokens in the input place IP of given PN in its entry marking Me.

We start our generalization of PPPA for the class of PNs by introduction of so called base PNs (BPN). BPNs represent the subclass of PNs that are elementary purely-formed, (i.e., purely-formedness of these PNs can be trivially proved).

Figure 4, shows six simple BPNs in their static markings Ms (i.e., the letter m in every of their resource places denotes m tokens, mN). The BPN BASE1 is the simplest purely-formed BPN at all and it contains only one place IOP that is simultaneously its input and output place (definition of PN allows this case). Purely-formed BPN BASE3 can be used for the modeling of the programming statement IF … THEN … ELSE … (note that the value of the transition priority function TP(T2) = 2 and it helps to solve potential conflict in the firing of the transitions T1 and T2), purely-formed BPN BASE4 represents the model of the programming critical section, where typically m = 1 in the resource place R1. Purely-formed BPN BASE5 then represents the synchronous programming method calling mechanism, where the called method is represented by the place P2. Purely-formed BPN BASE6 can be then used for the modeling of the programming barrier.

Fig. 4.
figure 4

Examples of BPNs

Figure 5, shows purely-formed BPN BASE7 that represents the programming statement PARALLEL FOR i: = 1 TO m DO …, where mN. Very interesting purely-formed BPN BASE8 will be used in the next paragraph for the purpose of the multiple-readers/single-writer lock modeling in the multithreading programming environment. Its purely-formed property can be easily proved for instance with using of the PN marking graph construction (see [1, 3, 7]).

Fig. 5.
figure 5

Examples of BPNs

4 PLACE_SUBST Transformation and Its Properties

The only one transformation PLACE_SUBST (i.e., place substitution transformation) is defined for the class of all PNs and it is shown to be preserving the well-formedness and purely-formedness properties. The well-formed, resp. purely-formed, PNs form a closed set (i.e., informally said, the result of an application of the PLACE_SUBST transformation onto any two well-formed, resp. purely-formed, PNs will result into another well-formed, resp. purely-formed, PN). The design of a given programming system will typically starts with the BPN BASE1 and it then follows with the several PLACE_SUBST transformations (i.e., substitutions of the selected BPN over the non-resource place of the actual PN) that result into the complex well-formed, resp. purely-formed, PN that models the whole programming system.

We will denote the set of all ordered pairs (PN, p) where PNPNET, PN: = (P, T, A, AF, TP, RP, IP, OP, RMs), p ∈ (P \ RP), by the symbol PNETPL. We will then denote the members of the set PNETPL (i.e., ordered pairs (PN, p)) by the shortened notation PN.p.

Definition 2.

Let PN1: = (P1, T1, A1, AF1, TP1, RP1, IP1, OP1, RMs1) and PN2: = (P2, T2, A2, AF2, TP2, RP2, IP2, OP2, RMs2) are the PNs, let p ∈ (P1 \ RP1) is a non-resource place of the PN PN1. The transformation PLACE_SUBST: PNETPL × PNETPNET of the PN PN2 substitution over the place p of the PN PN1 resulting into the new PN PN: = (P, T, A, AF, TP, RP, IP, OP, RMs) will be denoted by the statement

$$ PN: = PN1.p < ]PN2,\;{\text{where:}} $$
  • P: = (P1 \ {p}) ∪ P2,

  • T: = T1T2,

  • A: = A2 ∪ {(x, y) ∈ A1 | (x ≠ p) ∨ (y ≠ p)} ∪ {(x, IP2) | (x, p) ∈ A1} ∪ {(OP2, y) | (p, y) ∈ A1},

  • AF: = AF2 ∪ {((x, y), v) ∈ AF1 | (x ≠ p) ∨ (y ≠ p)} ∪ {((x, IP2), v) | ((x, p), v) ∈ AF1} ∪ {((OP2, y), v) | ((p, y), v) ∈ AF1},

  • TP: = TP1TP2,

  • RP: = RP1RP2,

  • IP: = IP1, if p ≠ IP1; IP = IP2, if p = IP1,

  • OP: = OP1, if p ≠ OP1; OP = OP2, if p = OP1,

  • RMs: = RMs1RMs2.

Example 2.

The result of the PLACE_SUBST transformation BASE5.P2 <] BASE2 where the place P2 of the BPN BASE5 (see Fig. 4) was substituted by the BPN BASE2 can be shown in Fig. 6.

Fig. 6.
figure 6

Result of PLACE_SUBST transformation BASE5.P2 <] BASE2

Lemma 2.

Let PN1: = (P1, T1, A1, AF1, TP1, RP1, IP1, OP1, RMs1), PN2: = (P2, T2, A2, AF2, TP2, RP2, IP2, OP2, RMs2) and PN3: = (P3, T3, A3, AF3, TP3, RP3, IP3, OP3, RMs3) are the PNs. Let p1 ∈ (P1 \ RP1) is a non-resource place of the PN PN1 and p2 ∈ (P2 \ RP2) is a non-resource place of the PN PN2. Then:

$$ PN1.p1 < ]\,(PN2.p2 < ]\,PN3) = (PN1.p1 < ]\,PN2).p2 < ]PN3. $$

Proof.

Follows directly from the Definition 2. □

Lemma 3.

Let PN1: = (P1, T1, A1, AF1, TP1, RP1, IP1, OP1, RMs1) is a well-formed, resp. purely-formed, PN and PN2: = (P2, T2, A2, AF2, TP2, RP2, IP2, OP2, RMs2) is a well-formed, resp. purely-formed, PN. Let p ∈ (P1 \ RP1) is a non-resource place of the PN PN1. Let (∀tp•: (p, t) ∈ A1 ⇒ •t × p• ⊆ A1) ∧ (∀tp•: AF1(p, t) = 1)).

Then PN1.p <] PN2 is a well-formed, resp. purely-formed, PN.

Proof.

Clear. Because both PN PN1 and PN2 are well-formed, i.e., (∀MeMe: PN1 terminates properly) ∧ (∀MeMe: PN2 terminates properly), then for the PN PN1 holds true that \( \forall M \in [M_{e} \rangle ,M\left( p \right) > 0,\exists M_{x} :M_{x} \in [M\rangle \), and for the PN PN2 holds true that \( \forall M \in [M_{e} \rangle ,M\left( {IP_{ 2} } \right) > 0,\exists M_{x} :M_{x} \in [M\rangle ) \), then the whole PN PN1.p <] PN2 must also terminate properly for any of its input markings Me. The property of purely-formedness of the resulting PN PN1.p <] PN2 can be proved similarly.

The necessity of the condition (∀tp•: (p, t) ∈ A1 ⇒ •t × p• ⊆ A1) fulfilment is presented in Fig. 7, where both PN1 and PN2 are purely-formed PN but the resulting PN PN1.P2 <] PN2 is not any more purely-formed PN. This fact can be seen for instance from the transition sequence \( \left( { 1,{\mkern 1mu} 0,{\mkern 1mu} 0,{\mkern 1mu} 0,{\mkern 1mu} 0} \right){\mkern 1mu} [{\text{T1}}\rangle {\mkern 1mu} \left( {0,{\mkern 1mu} 1,{\mkern 1mu} 1,{\mkern 1mu} 0,{\mkern 1mu} 0} \right){\mkern 1mu} [{\text{T2}}\rangle {\mkern 1mu} \left( {0,{\mkern 1mu} 0,{\mkern 1mu} 0,{\mkern 1mu} 1,{\mkern 1mu} 1} \right) \) that causes deadlock. This problem follows from the fact that for the PN PN1 is not satisfied the condition (P2, T3) ∈ A1 ⇒ (P2, T2) ∈ A1. Satisfaction of this condition that is well-known from the class of free choice Petri nets (see [8]) implies of the purely-formedness of the resulting PN PN1.P2 <] PN2.

Fig. 7.
figure 7

Place substitution operation PN1.P2 <] PN2

The necessity of the condition (∀tp•: AF1(p, t) = 1) fulfilment is presented in Fig. 8, where both PN3 and PN4 are purely-formed PN but the resulting PN PN3.P1 <] PN4 is not any more purely-formed PN. This fact can be seen for instance from the transition sequence \( \left( { 1,{\mkern 1mu} 0,{\mkern 1mu} 0,{\mkern 1mu} 0,{\mkern 1mu} 1,{\mkern 1mu} 0} \right){\mkern 1mu} [{\text{T1}}\rangle {\mkern 1mu} \left( {0,{\mkern 1mu} 3,{\mkern 1mu} 0,{\mkern 1mu} 0,{\mkern 1mu} 1,{\mkern 1mu} 0} \right){\mkern 1mu} [{\text{T4}}\rangle {\mkern 1mu} \left( {0,{\mkern 1mu} 2,{\mkern 1mu} 1,{\mkern 1mu} 0,{\mkern 1mu} 0,{\mkern 1mu} 0} \right){\mkern 1mu} [{\text{T5}}\rangle {\mkern 1mu} \left( {0,{\mkern 1mu} 2,{\mkern 1mu} 0,{\mkern 1mu} 1,{\mkern 1mu} 1,{\mkern 1mu} 0} \right){\mkern 1mu} [{\text{T3}}\rangle {\mkern 1mu} \left( {0,{\mkern 1mu} 2,{\mkern 1mu} 0,{\mkern 1mu} 1,{\mkern 1mu} 1,{\mkern 1mu} 0} \right) \) that causes impossibility of reaching of the exit marking Mx of the PN. This problem follows from the fact that for the PN PN1 is not satisfied the condition AF(P1, T2) = 1. Satisfaction of this condition implies of the purely-formedness of the resulting PN PN3.P1 <] PN4. □

Fig. 8.
figure 8

Place substitution operation PN3.P1 <] PN4

5 An Example of PLACE_SUBST Transformation Application at the Modeling of Distributed Programming System

In the following simple example we will develop a design of a PN modeling the distributed programming system operating on the client and application server side and realizing reading and writing procedures from the given database system on the basis of a client requests. Individual client requests are executed via a finite set of programming threads on the server side (in our model of that programming system we assume availability of totally three server side programming threads) stored in the created pool of threads. At the moment of accepting the user request is for the needs of its responding a free thread randomly selected in pool which realizes such request, i.e., it will ensure execution of reading or writing data into the database system. In so doing it is required that in the case of realization of the request for the writing of the database no other thread can access the database environment and in the case of request for the reading any finite number of threads realizing reading of data can access the database.

Figure 9a, shows the PN BASE7.P3 <] BASE5 in its entry marking Me (where Me(R1) = 4) that represents the client side of the whole distributed programming system. Client side will perform PARALLEL FOR cycles with two programming threads (the tokens in the input place IP) requesting the read and write server side database operations (firing of the transition T6). Server side database service is represented by the place P4 and will be requested by synchronous manner.

Fig. 9.
figure 9

a, b. PNs modeling client and server side of distributed programming system

Figure 9b, shows the PN BASE4.P1 <] BASE8 determined for the execution of user requirements on reading or writing into the database while using three common accessible programming threads located in the common programming pool (see the resource place R10). The respective threads realize either reading (firing of the transition T20, resp. T21) or writing (firing of the transition T22) of the data from or to the database via the mechanisms of BPN BASE8 (see Fig. 5) that models the access into the database environment with the support of multiple-readers/single-writer lock. The token in the resource place R20 represents single lock determined for obtaining the multiple-readers/single-writer access of the database environment. Following realization of the relevant event the programming thread will be returned back into the common pool of threads represented by the resource place R10 and it will be ready for the execution of the next user request.

We will obtain the resulting PN that represents the whole distributed programming systems as shown in Fig. 10, by applying the following PLACE_SUBST transformation: (BASE7.P3 <] BASE5).P2 <] (BASE4.P1 <] BASE8). This resulting PN is according to Lemma 3 (because the BPNs BASE4, BASE5, BASE7 and BASE8 are purely-formed PNs) purely-formed PN.

Fig. 10.
figure 10

Resulting PN modeling distributed programming system

6 Conclusions

There is an opportunity to define additional transformations and operators for the class of PNs and to generalize it (for instance transformations for connecting two or more PNs). Selected PN then represents typically a method in the model of the programming system realized with the support of the Petri nets formalism. PNs can be thus successfully applied also in the area of the bi-relational P/T Petri nets [9] that represent an interesting modification of conventional P/T Petri nets.

The principles introduced in the class of PNs can be further generalized and implemented in the definition of the class of high-level Petri nets called the sequential object Petri nets [10, 11] which differ from PNs mainly by mutually differentiable tokens. The tokens alone are formed by non-empty sequences over the set of all integer numbers (this is also where the name of this Petri nets class came from). Sequential object Petri nets are then specially determined for the design, modeling and verification of distributed multithreading programming systems based on the object oriented and functional paradigms.

This paper has been elaborated in the framework of the project CZ.1.07/2.3.00/20.0296 supported by the European Social Fund.