P ADERBORN 2003 applications of Petri nets 1 / 43 A BOUT SOME A PPLICATIONS OF P ETRI N ET T HEORY (M Y P ETRI N ET P ICTURE B OOK ) M ONIKA H EINER BTU Cottbus Computer Science Institute monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
PROLOGUE applications of Petri nets 2 / 43 C. A. P ETRI - I NTERPRETATIONS OF N ET T HEORY GMD, I NTERNAL R EPORT 75-07, 2 ND IMPROVED EDITION 1976 places transitions state elements transitional elements conditions events/facts statements dependencies model domains specifications chemical compounds chemical reactions open one-point sets closed one-point sets channels offices languages translators products poduction activities monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
C ONTENTS applications of Petri nets 3 / 43 P ETRI NETS AS VEHICLE FOR REASONING ABOUT administration patterns (work flows, process models) ❑ software structures ❑ hardware structures -> fault trees ❑ control engineering, to be added ❑ process/chemical engineering, to be added ❑ knowledge representation, to be added ❑ games ❑ biochemical networks (systems biology) ❑ music notations ❑ aesthetics more . . . ? ❑ monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
ADMINISTRATION , EXAMPLE 1 applications of Petri nets 4 / 43 TRAVEL next_trip PREPARATION begin_preparations accomodation? transport? luggage? camping hotel train car feet pack h t c ask_for_ phone ask_for_ schedule rooms check accomodation! transport! luggage! end_preparations ready repeat monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
ADMINISTRATION , EXAMPLE 2 applications of Petri nets 5 / 43 SYSTEM VALIDATION , PROCESS AND TOOLS safety controller environment requirements functional requirements modelling modelling library (compiler) control environment model model temporal composition logic set of system temporal model formulae errors / verification methods inconsistencies monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
ADMINISTRATION , EXAMPLE 3 applications of Petri nets 6 / 43 UML MODELLING , m_i MACRO PROCESS design and document designUC relevant use cases [Balzert 2001, 386-391] ❑ uc_i derive (kernel) classes designCDk from use cases cd_ki split 1.designDynModel split cd_i cd_i cd_i 1.designDynModel designStaticModel designSD designSM designOp cd_i dynM_i sd_i op_i sm_i adjust static/dynamic mode adjust -> balance SD - sequence diagram join SM - state machine (state charts) m_(i+1) Op - operations partition into smaller pieces dynM_i cd - class diagram if any package monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
ADMINISTRATION , SUMMARY applications of Petri nets 7 / 43 PLACES ❑ TRANSITIONS HOME ❑ FLOW ARCS WORK ❑ TOKENS ❑ monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
SOFTWARE , EXAMPLE 1 A applications of Petri nets 8 / 43 SEQUENTIAL 1 Boolean 2 no_row_found := true , PROGRAM 3 all_zero; 4 check_row: loop (all i and no_row_found ) first all-zero row ❑ 5 all_zero := true ; in a given matrix 6 check_column: loop (all j and all_zero ) if x[i,j] ≠ 0 7 source code, ❑ 8 then all_zero := false ! abnormal termination of strongly structured 9 endif ! check_column loop 10 endloop check_column; no goto‘s, but ❑ 11 if all_zero ! normal termination of goto walk-arounds 12 then ! check_column loop 13 write(i); 14 no_row_found := false ! abnormal termination of 15 endif ! check_row loop 16 endloop check_row; 17 if no_row_found ! normal termination of 18 then ! check_row loop 19 write(“no”) 20 endif monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
SOFTWARE , EXAMPLE 1 A applications of Petri nets 9 / 43 SEQUENTIAL check_row (NAP = 14) PROGRAM T1 control structure ❑ loop_4 model T2 abstraction of T11 ❑ data-dependent loop_6 branching T3 T7 Number of Acyclic ❑ if_7 if_11 if_17 Paths (NAP): 14 T4 T6 T8 T10 T12 T14 T5 T9 T13 monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
SOFTWARE , EXAMPLE 1 B applications of Petri nets 10 / 43 SEQUENTIAL 1 check_row: loop all i 2 check_column: loop all j PROGRAM if x[i,j] ≠ 0 3 4 then next check_row ! abnormal termination of source code, ❑ 5 endif ! check_column loop well-structured 6 endloop check_column; 7 write(i); ! normal termination of structured ❑ 8 ! check_column loop goto‘s only 9 break ; ! abnormal termination of 10 ! check_row loop 11 endloop check_row; 12 write(“no”) ! normal termination of ! check_row loop monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
SOFTWARE , EXAMPLE 1 B applications of Petri nets 11 / 43 SEQUENTIAL (NAP = 4) check_row PROGRAM T1 control structure ❑ loop_1 model T2 NAP: 4 T5 ❑ loop_2 T3 T4 start if_3 i = 1(1)n j= 1(1)m else then write(i)_7 0 x[i,j] ≠ ≠ 0 1 next_4 break_9 write("no")_12 write (i) write(“no”) endloop_6 stop monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
SOFTWARE , EXAMPLE 2 applications of Petri nets 12 / 43 CONCURRENT PROGRAM thinking dining philosophers ❑ begin_take waiting_right scalable -> benchmark waiting_left ❑ for analysis algorithms take_left take_right having_left having_right phil3 end_take fork3 fork1 left_fork eating right_fork phils3 begin_put phil1 phil2 releasing_left releasing_right fork2 put_left put_right released_left released_right phil end_put left_fork right_fork monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
SOFTWARE , EXAMPLE 3 A applications of Petri nets 13 / 43 N VERSION start PROGRAMMING parallel execution fork ❑ of n program versions v1_start v2_start v3_start followed by ❑ v2 majority test v1 v3 higher abstraction level, ❑ v1_end v3_end v2_end transitions: -> program versions voter voting -> voting algorithm voting result all equal two equal all unequal ok warning ko success fail monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
SOFTWARE , EXAMPLE 3 B applications of Petri nets 14 / 43 RECOVERY BLOCK start SCHEME set checkpoint i := 1 checkpoint alternative execution ❑ i > 3 i = 1 i = 2 i= 3 of n program versions last v1 v2 v3 will each followed by ❑ acceptance test vi_end acceptance test high-level Petri net ❑ test result ko ok reset to checkpoint; i++ success fail monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
SOFTWARE , SUMMARY applications of Petri nets 15 / 43 PLACES control flow point ❑ TRANSITIONS statement, statement sequence, black-box algorithm ❑ FLOW ARCS control flow, usually without branching conditions ❑ data flow = control flow + control variables ❑ TOKENS execution counter ❑ synchronization/communication objects ❑ monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
HARDWARE , EXAMPLE applications of Petri nets 16 / 43 FAULT TREES network notation of ❑ top event system failure Boolean functions (output signal) two gates: ❑ ≤ 1 OR, AND multiple use of basic ❑ events allowed ≤ 1 -> no real trees 2-of-3 system ❑ & & & a b basic events b c (input signal) a b c a c monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
HARDWARE , EXAMPLE applications of Petri nets 17 / 43 FAULT TREES sf_T sf_F m(x_T) = 1 -> defect m(x_F) = 1 -> intact states of a signal x: ❑ sf - system failure -> two places x_T, x_F OR -> 1-P-invariant r_T r_F input changes of ❑ basic events propagate to the top OR no dead states ❑ in ’stable state’, ❑ r_F r_T r_F r_T r_T r_F the top event (system failure: T/F) AND AND AND is reproduced forever a_T a_F b_F b_T b_T b_F c_T c_F c_T c_F a_T a_F monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
HARDWARE , EXAMPLE applications of Petri nets 18 / 43 FAULT TREES OR gate ❑ persistent ❑ c_T c_F c_F c_T TTF FTF OR TTT TFF FTT FFT FFF TFT a_T a_F b_T b_F a_T a_F b_T b_F monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
HARDWARE , SUMMARY applications of Petri nets 19 / 43 PLACES current signal, two places each for the two possible states - on/off ❑ TRANSITIONS logical gates ❑ FLOW ARCS ’wires’ ❑ TOKENS on/off (high/low) signal ❑ monika.heiner(at)informatik.tu-cottbus.de December 2003 data structures and software dependability
Recommend
More recommend