dependability engineering & Petri nets May 2020 dependability engineering & Petri nets May 2020 QUALITATIVE ANALYSIS METHODS , OVERVIEW NET REDUCTION STRUCTURAL PROPERTIES LINEAR PROGRAMMING static THE analysis place / transition invariants state equation MUTEX PATTERN trap equation - DIFFERENT REACHABILITY ANALYSIS ANALYSIS (complete) reachability graph APPROACHES compressed state spaces BDDs, NDDs, ..., xDDs dynamic Kronecker products analysis reduced state spaces (model coverability graph checking) symmetry stubborn sets branching process monika.heiner@b-tu.de 7 - 1 / 27 monika.heiner@b-tu.de 7 - 2 / 27
dependability engineering & Petri nets May 2020 dependability engineering & Petri nets May 2020 PATTERN OF SEMAPHORE AS ADT BEHAVIOUR class MutexLoop extends Thread { public class Semaphore { private Semaphore mutex; private int value; private char ch; public Semaphore (int initial) { MutexLoop (Semaphore sema, char toPrint) { if (initial<0) { mutex=sema; System.exit(1); // out of range error ch = toPrint; } else { } // MutexLoop value = initial; } // if public void run() { } // Semaphore for (int i=0;i<MutexDemo.LENGTH;i++) { Simulate.doSomething();// pre action synchronized public void up() { ++value; mutex.down(); // get mutual exclusion notify(); System.out.println(); } // up for (int j=0;j<MutexDemo.MAX;j++) { System.out.print(ch); synchronized public void down() { } // for try { mutex.up(); //release mutual exclusion while (value==0) wait(); --value; Simulate.doSomething();// post action } catch(InterruptedException e){} } // for } // down } // run } // class Semaphore } // class MutexLoop monika.heiner@b-tu.de 7 - 3 / 27 monika.heiner@b-tu.de 7 - 4 / 27
dependability engineering & Petri nets May 2020 dependability engineering & Petri nets May 2020 PETRI NET MODEL , APPLICATION PATTERN OF BEHAVIOUR MUTEXDEMO (1) (2) beginMutexLoop beginMutexLoop public class MutexDemo { forI forI static final int MAX = 30;// line width to weave static final int LENGTH = 50;// number of lines doSomething endForI doSomething endForI public static void main (String[] argv) { endMutexLoop endMutexLoo Semaphore mutex = new Semaphore(1); mutex mutex down down Thread a = new MutexLoop(mutex,'a'); Thread b = new MutexLoop(mutex,'b'); 2. inMutex // Thread c = new MutexLoop(mutex,'c'); println() up mutex System.out.println(" -- begin of MutexDemo -- "); (3) forJ a.start(); forI b.start(); endForJ print(ch) // c.start(); mutex down } // main 2. inMutex } // class MutexDemo up mutex up mutex (4) (5) begin down mutex 3. run mutex inMutex up monika.heiner@b-tu.de 7 - 5 / 27 monika.heiner@b-tu.de 7 - 6 / 27
dependability engineering & Petri nets May 2020 dependability engineering & Petri nets May 2020 PETRI NET MODEL , MUTEXDEMO , MUTEXDEMO ANALYSIS S YNCHRONIZATION S KELETON A_begin B_begin _P3_ _P2_ A_begin B_begin A_down B_down _T3_ _T1_ mutex mutex _P0_ A_inMutex B_inMutex _P4_ _P1_ 2. B_run 1. A_run A_up B_up _T2_ _T0_ FLATTEN A_begin REQUIRED SAFETY PROPERTY B_begin forever, there is at most one process in the mutex section (critical section) A_down B_down HOW TO ANALYZE IT ? mutex B_inMutex A_inMutex (1) reachability graph (2) state equation (3) p-invariants, non-reachability check A_up B_up (4) p-invariants, reasoning ORD HOM NBM PUR CSV SCF CON SC Ft0 tF0 Fp0 pF0 MG SM FC EFC ES (5) model checking of temporal formulae Y Y Y Y N N Y Y N N N N N N N N Y DTP SMC SMD SMA CPI CTI B SB REV DSt BSt DTr DCF L LV L&S Y Y Y Y Y Y Y Y Y N ? N N Y Y Y monika.heiner@b-tu.de 7 - 7 / 27 monika.heiner@b-tu.de 7 - 8 / 27
dependability engineering & Petri nets May 2020 dependability engineering & Petri nets May 2020 ANALYSIS OF MUTEXDEMO (1), INCIDENCE MATRIX C - REACHABILITY GRAPH A REPRESENTATION OF THE NET STRUCTURE P+T card(T) p1 card(P) t1 P+T p1 A_begin, φ B_begin, - PRE mutex A_up B_up card(P) t1 B_down A_down φ + POST A_begin, A_in, B_in B_begin card(T) POST - PRE P T t1 . . . . . . tj tm -> RG is finite p1 -> BND . . . pi cij -> 1 SC component, containg all transitions . . . -> LIVE & REV pn -> no state with (A_in = 1 and B_in = 1) reachable cij = (pi, tj) = F(tj,pi) - F(pi, tj) = ∆ tj(pi) -> safety property is valid -> token change in temporal logics: in place pi by firing of transition tj not EF (A_in and B_in) AG ( not(A_in and B_in) ) monika.heiner@b-tu.de 7 - 9 / 27 monika.heiner@b-tu.de 7 - 10 / 27
dependability engineering & Petri nets May 2020 dependability engineering & Petri nets May 2020 MUTEXDEMO , STATE EQUATION 1 INCIDENCE MATRIX . PARIKH VECTOR . A_begin B_begin parikh(tj) _P3_ 0 _P2_ . incidence matrix C . 1 tj P T tj t1 tm . . A_down B_down _T3_ p1 0 _T1_ . mutex . _P0_ A_inMutex B_inMutex _P4_ _P1_ ∆ tj pi ∆ tj C A_up B_up _T2_ _T0_ pn ∆ tj - vector describing the change of the whole marking by firing of tj T B_up B_down A_up A_down P Let the word w = t1-t0-t1-. . . PARIKH VECTOR 1 t0 2 t1 be a sequence of firing transitions; parikh(w) +1 -1 +1 -1 mutex . . . -1 +1 0 0 The change of the B_inMutex 0 marking ∆ w . . +1 -1 0 0 B_begin by firing that sequence . can be computed 0 0 +1 -1 by multiplying A_begin the incidence matrix C ∆ w C with the A_inMutex 0 0 -1 +1 Parikh vector parikh(w) of that transition sequence. monika.heiner@b-tu.de 7 - 11 / 27 monika.heiner@b-tu.de 7 - 12 / 27
dependability engineering & Petri nets May 2020 dependability engineering & Petri nets May 2020 STATE EQUATION 2 ANALYSIS OF MUTEXDEMO (2), STATE EQUATION x0 The new marking reached by 1 t0 x1 t1 2 firing the given transition sequence . can then be computed by . x2 . adding ∆ w to the current marking. C * x m m 0 0 . x3 . . -1 +1 -1 0 1 +1 0 -1 +1 0 0 1 ∆ w m m o C = + = + 1 +1 -1 0 0 0 0 +1 -1 0 1 0 m 0 - initial marking m - new marking reached by firing of w 0 0 0 -1 +1 1 STATE EQUATION -> linear programming problem -1 = + x0 - x1 + x2 - x3 1 = - x0 + x1 m = m 0 + C x, x - T-vector -1 = + x0 - x1 x >= 0 -1 = + x2 - x3 1 = - x2 + x3 There exists an integer solution for every reachable marking m (the Parikh vector of the transition sequence going to m). -> the integer solvability is a necessary condition for the reachability of a marking; NON - REACHABILITY CHECK -> if there is no integer solution, then the marking is not reachable. monika.heiner@b-tu.de 7 - 13 / 27 monika.heiner@b-tu.de 7 - 14 / 27
dependability engineering & Petri nets May 2020 dependability engineering & Petri nets May 2020 T - INVARIANTS T - INVARIANTS , INTERPRETATION ❑ Lautenbach, 1973 ❑ T-invariants = (multi-) sets of transitions x ❑ T-invariants -> zero effect on marking -> integer solutions x of -> reproducing a marking / system state = 0 x , ≠ 0 x , ≥ 0 Cx -> steady state substance flows 0 C -> Parikh vector -> elementary modes, Schuster 1993 -> exponential complexity ❑ the T-invariant corresponds to cycles in the RG, minimal T-invariants ❑ if the T-invariant is realizable -> there is no T-invariant with a smaller support ❑ in the RG, concurrency of transitions is described by -> greatest common divisor (gcd) of all entries is 1 all transitions’ interleaving sequences ❑ support ❑ if there are concurrent transitions -> set of transitions belonging to the T-invariant in a realizable T-invariant, then there is a RG cycle for each interleaving sequence ❑ any T-invariant is a non-negative linear combination -> T-inv3, T-inv4 of minimal ones -> multiplication with a positive integer ❑ pre-sets of supports = post-sets of supports -> addition = kx ∑ aixi -> division by gcd i ❑ a T-invariant defines a (connected) subnet -> the T-invariant’s transitions (the support), ❑ Covered by T-Invariants (CTI) + all their pre- and post-places -> each transition belongs to a T-invariant + the arcs in between monika.heiner@b-tu.de 7 - 15 / 27 monika.heiner@b-tu.de 7 - 16 / 27
dependability engineering & Petri nets May 2020 dependability engineering & Petri nets May 2020 T - INVARIANTS , T - INVARIANTS , MUTEX D EMO THEOREMS If a bounded net is live, then it is CTI. ❑ -> NECESSARY CONDITION FOR well-formedness ❑ INA, session protocol A net with home states is CTI [Balbo 2001]. ❑ 1 | 0.B_up : 1, | 1.B_down : 1 -> NECESSARY CONDITION FOR reversibility 2 | 2.A_up : 1, | 3.A_down : 1 ❑ interpretation: T-invariant1 reproduces m 0 by a cyclic run of process B T-invariant2 reproduces m 0 by a cyclic run of process A -> both T-invariants are cycles in the reachability graph -> both T-invariants are realizable ❑ CTI monika.heiner@b-tu.de 7 - 17 / 27 monika.heiner@b-tu.de 7 - 18 / 27
Recommend
More recommend