Example - Building the incidence matrix April 5, 2006 Lionel Morel t 2 Introduction Definitions t 1 p 2 Petri Nets Inputs and Outputs Petri Nets vs FSM p 1 p 4 Modeling Templates t 3 p 3 Analysis Methods for Petri Nets Extensions and Restrictions − 1 1 1 0 A = 0 0 0 1 − 1 0 − 1 − 1 Lionel Morel Spring 2006 16
Example - Using the incidence matrix to evaluate Petri Nets (1) April 5, 2006 t 2 t 2 Lionel Morel t 1 p 2 t 1 p 2 Introduction p 1 p 4 p 1 p 4 Definitions Petri Nets t 3 t 3 p 3 p 3 Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis � x 1 = � x 0 + � u 1 A Methods for − 1 1 1 0 Petri Nets Extensions = [2 , 0 , 0 , 1] + [1 , 0 , 0] 0 0 0 1 and Restrictions − 1 0 − 1 − 1 = [2 , 0 , 0 , 1] + [ − 1 + 0 + 0 , 1 + 0 + 0 , 1 + 0 + 0 , 0 + 0 + 0] = [2 , 0 , 0 , 1] + [ − 1 , 1 , 1 , 0] = [1 , 1 , 1 , 1] Lionel Morel Spring 2006 17
Example - Using the incidence matrix to evaluate Petri Nets (2) April 5, 2006 t 2 t 2 Lionel Morel t 1 p 2 t 1 p 2 Introduction p 1 p 4 p 1 p 4 Definitions Petri Nets t 3 t 3 p 3 p 3 Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis � x 2 = � x 1 + � u 2 A Methods for Petri Nets − 1 1 1 0 Extensions 0 0 0 1 = [1 , 1 , 1 , 1] + [0 , 0 , 1] and Restrictions − 1 0 − 1 − 1 = [1 , 1 , 1 , 1] + [ − 1 , 0 , − 1 , − 1] = [0 , 1 , 0 , 0] Lionel Morel Spring 2006 18
I/O in Petri Nets April 5, 2006 Lionel Morel Introduction Definitions Petri Nets So far, we have not considered input/outputs of petri nets Inputs and Outputs Many modeling tasks can be achieved with isolated nets Petri Nets vs FSM without interfaces Modeling It is however sometimes very useful to be able to model Templates explicitely inputs and outputs Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 19
I/O modeled as Places April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 20
I/O modeled as Transitions April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 21
I/O modeling April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Both methods are equivalent (you can always model one Outputs by the other) Petri Nets vs FSM We’ll use the ”places” representation, because it seems Modeling Templates slightly more intuitive Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 22
Example - A server modeled as Petri Nets April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Customers arrive at input p 1 and depart at output p 4 . Lionel Morel Spring 2006 23
Content April 5, 2006 Lionel Morel Introduction 1 Introduction Definitions Definitions 2 Petri Nets Inputs and Outputs Petri Nets vs Petri Nets vs FSM 3 FSM Modeling Templates Modeling Templates 4 Analysis Methods for Petri Nets Analysis Methods for Petri Nets Extensions 5 and Restrictions Extensions and Restrictions 6 Lionel Morel Spring 2006 24
Finite State Machines: Remember? April 5, 2006 Lionel Morel Definition: A deterministic Mealy machine is a six-tuple Introduction Definitions (Σ , ∆ , X , g , f , � x 0 ) Petri Nets Inputs and Outputs where: Petri Nets vs FSM Σ is a finite input alphabet Modeling ∆ is a finite output alphabet Templates X is a finite set of states Analysis Methods for x 0 is the initial state, x 0 ∈ X Petri Nets Extensions g is a a state transition function, g : X × Σ → X and Restrictions f is an output function, f : X × Σ → ∆ Lionel Morel Spring 2006 25
FSM - Example April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 26
Petri Nets vs. FSM? April 5, 2006 Lionel Morel Introduction Definitions Petri Nets FSM are used to model I/O behavior Inputs and Outputs Petri Nets are used to model concurrent behavior Petri Nets vs FSM Compositions of Petri-Nets are much simpler (composition Modeling Templates of FSM actually generates a state explosion) Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 27
Compositions of Petri Nets April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Sequential composition Petri Nets vs FSM Parallel composition Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 28
Sequential composition of PN April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 29
Parallel composition of PN April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 30
Composition of FSM April 5, 2006 x 0 x 0 Lionel Morel 1 Introduction 0 1 0 Definitions x 1 x 1 Petri Nets Inputs and Outputs Petri Nets vs FSM ⇓ Modeling Templates Analysis x 0 , x 0 1 Methods for 0 Petri Nets 0 Extensions 1 and x 1 , x 0 x 0 , x 1 Restrictions 0 1 1 0 x 1 , x 1 Lionel Morel Spring 2006 31
Petri Nets vs. FSM? April 5, 2006 Lionel Morel Introduction Definitions The composition is more complex because the resulting Petri Nets Inputs and FSM’s state space is a product of the two component Outputs state spaces... Petri Nets vs FSM But, are PN and FSM equally powerful? Modeling Templates No (every FSM can be modeled by a PN but not Analysis Methods for vice-versa) Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 32
From FSM to Petri Nets April 5, 2006 Lionel Morel FSM M = (Σ , ∆ , X , g , f , x 0 ) with mutually exclusive sets Σ and ∆. An equivalent Petri net is N = ( P , T , A ,� y 0 ) with: Introduction Definitions Petri Nets Σ are input places; Inputs and P = X ∪ Σ ∪ ∆ Outputs Petri Nets vs ∆ are output places; T = { t x , a | x ∈ X , a ∈ Σ } FSM A = I ( t x , a ) O ( t x , a ) ∀ t x , a ∈ T Modeling X are internal places; Templates I ( t x , a ) = x , a Each ( state , input ) pair in Analysis O ( t x , a ) = { g ( x , a ) , f ( x , a ) } Methods for M becomes a transition in Petri Nets � y 0 = [1 , 0 , ..., 0] N ; Extensions and Restrictions Initial marking represents state x 0 and no input; Lionel Morel Spring 2006 33
Example Computation of the two’s complement of a binary number April 5, 2006 represented with the least significant bit first. Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 34
Content April 5, 2006 Lionel Morel Introduction 1 Introduction Definitions Definitions 2 Petri Nets Inputs and Outputs Petri Nets vs Petri Nets vs FSM 3 FSM Modeling Templates Modeling Templates 4 Analysis Methods for Petri Nets Analysis Methods for Petri Nets Extensions 5 and Restrictions Extensions and Restrictions 6 Lionel Morel Spring 2006 35
Modeling Templates April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Goal: illustrate Petri Nets Petri Nets vs We’ll look at several practical templates for standard FSM Modeling modeling tasks Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 36
Sequence and Concurrency April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 37
Fork and Join April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Fork: doubles the control flow, resulting in two parallel Petri Nets vs threads FSM Modeling Join: merges two control flows into one Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 38
Fork and Join April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 39
Conflict April 5, 2006 Lionel Morel Used to model situations where two processes compete for data Introduction or resources. Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 40
Mutual Exclusion - Problem April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 41
Mutual Exclusion - Petri Net solution April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 42
Producer/Consumer April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 43
Modeling Templates - Conclusion April 5, 2006 Lionel Morel Introduction Definitions We have introduced different modeling templates: Petri Nets Inputs and Outputs Sequence and Concurrency Petri Nets vs Fork and Join FSM Modeling Conflict (e.g. for Mutual Exclusion) Templates Analysis Producer/Consumer Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 44
Content April 5, 2006 Lionel Morel Introduction 1 Introduction Definitions Definitions 2 Petri Nets Inputs and Outputs Petri Nets vs Petri Nets vs FSM 3 FSM Modeling Templates Modeling Templates 4 Analysis Methods for Petri Nets Analysis Methods for Petri Nets Extensions 5 and Restrictions Extensions and Restrictions 6 Lionel Morel Spring 2006 45
Analysis Methods - Intro April 5, 2006 In general, when modeling a system, we want to be able to Lionel Morel formulate particular questions on it: Introduction Will a system ever enter a particular state? Definitions Petri Nets Will it always be able to avoid a particular dangerous Inputs and Outputs state? Petri Nets vs FSM Will it always eventually reach some desired state? Modeling Templates The next part introduces: Analysis Methods for Questions on Petri Nets Petri Nets Extensions How to answer these questions and Restrictions These questions are not typical to PN but are encountered with system models in general. Lionel Morel Spring 2006 46
Analysis Methods - Intro April 5, 2006 Lionel Morel Introduction Boundedness Definitions Conservation Petri Nets Inputs and Outputs Liveness Petri Nets vs FSM Reachability and Coverability Modeling Templates Persistence Analysis Methods for A technique for addressing these questions on PN: Petri Nets Extensions The Coverability Tree and Restrictions Lionel Morel Spring 2006 47
Boundedness April 5, 2006 Lionel Morel Places are often used to represent a buffer, a memory or a Introduction queue Definitions Petri Nets Inputs and Outputs Example Petri Nets vs FSM Tokens can represent arriving and emitted messages. The Modeling number of tokens in a place represents the number of messages Templates arrived but not yet processed. Analysis Methods for We would then like to guarantee taht the number of tokens in Petri Nets that place never exceeds a particular limit. Extensions and Restrictions ⇒ Boundedness Lionel Morel Spring 2006 48
Boudedness - Definition April 5, 2006 Lionel Morel Introduction Definitions A place p ∈ P in a Petri net N = ( P , T , A , w , � x 0 ) is k-bounded Petri Nets Inputs and if: Outputs Petri Nets vs FSM ∀ y ∈ R ( � x 0 ) : y ( p ) ≤ k . Modeling Templates The Petri net is called k-bounded if all places p ∈ P are Analysis Methods for k-bounded . Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 49
Boundedness - Example: an unbounded PN April 5, 2006 Lionel Morel x 0 = [2 , 0 , 0 , 1] t 2 Introduction Definitions t 1 p 2 Petri Nets Inputs and Outputs Petri Nets vs p 1 p 4 FSM Modeling t 3 Templates p 3 Analysis Methods for Petri Nets Extensions and Restrictions This PN is not bounded because p 4 is not bounded ! Lionel Morel Spring 2006 50
Boundedness - Example: a bounded PN April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and That definition is only useful for nets in isolation with no inputs Restrictions because an input place may always be unbounded, depending of course on the environment’s behavior. Lionel Morel Spring 2006 51
Conservation April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Token can also represent other things (data, requests, Outputs customers, services, ressources, etc.) Petri Nets vs FSM It can be interesting to know if the number of tokens for Modeling Templates all reachable states is constant Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 52
Conservation - Example April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Tokens in a place m represent available printers Petri Nets Tokens in place p 1 and p 2 represent incoming printing Extensions and requests Restrictions Initial marking for m represent the total number of printers ( n ) n would be assumed to be constant Lionel Morel Spring 2006 53
Strict Conservation - Definition April 5, 2006 Lionel Morel Introduction A Petri net N = ( P , T , A , w , � x 0 ) is strictly conservative if for all Definitions y ∈ R ( � x 0 ), Petri Nets Inputs and Outputs � � y ( p ) = x 0 ( p ) Petri Nets vs FSM p ∈ P p ∈ P Modeling Templates Analysis N is strictly conservative if the number of tokens is the same in Methods for Petri Nets all possible reachable state configuration Extensions and Restrictions Lionel Morel Spring 2006 54
Strict Conservation - Remark, Example April 5, 2006 Strict conservation is very strong and severely restricts Lionel Morel expressiveness of PN. Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Is not strictly conservative ( t 1 consumes 2 tokens while producing only one) Lionel Morel Spring 2006 55
Conservation April 5, 2006 Lionel Morel A Petri net N = ( P , T , A , w , � x 0 ) with n places is conservative with respect to a weighting vector � γ = [ γ 1 , γ 2 , ..., γ n ] , γ i ∈ N , if Introduction Definitions n Petri Nets Inputs and � γ i � x ( p ) = constant ∀ p ∈ P and � x ∈ R ( � x 0 ) Outputs Petri Nets vs i =1 FSM The Petri net is conservative if it is conservative with respect Modeling Templates to a weighting vector which has a positive non zero weight for Analysis all places. Methods for Petri Nets Extensions N is conservative with respect to some weighting vector if the and Restrictions number of tokens within the specified places is constant ! Lionel Morel Spring 2006 56
Conservation - Example April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for We are interested in the constant number of printers . Petri Nets This PN is conservative with respect to Extensions and Restrictions � y = [0 , 0 , 1 , 1 , 1 , 0 , 0] ( places p 1 , p 2 , p 6 , p 7 and p 8 are actually not relevant for the number of printers, but p 3 , p 4 and p 5 are! ) Lionel Morel Spring 2006 57
Liveness - What’s a deadlock? April 5, 2006 Lionel Morel Concurrent processes that interact with each other can come Introduction into a situation of deadlock : Definitions Petri Nets All processes waiting for some action to be taken by another Inputs and Outputs process. Petri Nets vs FSM Modeling This phenomenon is: Templates widespread Analysis Methods for Petri Nets potentially very harmful Extensions difficult to predict and to avoid (it requires the analysis of and Restrictions all involved processes) Lionel Morel Spring 2006 58
Liveness - What’s a deadlock? April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 59
Liveness April 5, 2006 Lionel Morel Introduction Definitions Let N = ( P , T , A , w , � x 0 ) be a Petri net and � x a state reachable Petri Nets Inputs and from � x 0 . Outputs L0-live : A transition t is live at level 0 in state � x if it cannot Petri Nets vs FSM fire in any state reachable from � x , Modeling Templates A PN is L0-live if it cannot fire any transition. It is deadlocked Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 60
Liveness - Example April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM t 0 is dead (L0-live) Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 61
Liveness April 5, 2006 Lionel Morel Introduction Definitions L1-live : A transition t is live at level 1 in state x if it is Petri Nets Inputs and potentially fire-able, i.e. if there exists a y ∈ R ( x ) such that Outputs t is enabled in y . Petri Nets vs FSM Modeling A transition is L1-live if there exists at least one state Templates configuration in which it can be fired Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 62
Liveness - Example April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM t 1 is L1-live Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 63
Liveness April 5, 2006 Lionel Morel Introduction Definitions L2-live : A transition t is live at level 2 in state x if for every Petri Nets Inputs and integer n there exists a firing sequence in which t occurs at Outputs Petri Nets vs least n times. FSM Modeling A transition is L2-live if it can potentially fire repeatidly for any Templates number of time Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 64
Liveness - Example April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM t 2 is L2-live Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 65
Liveness April 5, 2006 Lionel Morel Introduction Definitions Petri Nets L3-live : A transition t is live at level 3 in state x if there is an Inputs and Outputs infinite firing sequence in which t occurs infinitely often. Petri Nets vs FSM Modeling A transition is L3-live if it can potentially fire infinitely often. Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 66
Liveness - Example April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM t 3 is L3-live Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 67
Liveness April 5, 2006 Lionel Morel Introduction Definitions L4-live : A transition t is live at level 4 in state x if it is L1-live Petri Nets Inputs and Outputs in every y ∈ R ( x ). Petri Nets vs FSM A transition is L4-live if, at any moment, whatever the state Modeling Templates configuration, it can eventually fire Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 68
Liveness - Example April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM t 4 is L4-live Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 69
Liveness April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs A Petri net is live at level i if every transition is live at level i . FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 70
Reachability and Coverability April 5, 2006 Many other problems (including deadlock avoidance) can Lionel Morel be viewed as a special case of the state reachability Introduction problem. Definitions This asks if a particular state can be reached from a given Petri Nets Inputs and state. Outputs Petri Nets vs i.e., given a state � x , is a state � y ∈ R ( � x ). FSM Modeling If one can answer this question for any � x and � y , then one Templates can also answer for all questions about boundedness, Analysis Methods for conservation, deadlock and liveness. Petri Nets Extensions Unfortunattely, we do not have an efficient method to and answer this question for PN with infinite state space. Restrictions Fortunatelly, we can still solve some of these problems by analyzing a weaker property: Coverability! Lionel Morel Spring 2006 71
Coverability April 5, 2006 N = ( P , T , A , w , � x 0 ) is a Petri net; � x and � y are arbitrary states; Lionel Morel State � x covers state � y if all transitions enabled in � y are also enabled in � Introduction x : Definitions Petri Nets x ( p ) ≥ y ( p ) ∀ p ∈ P . Inputs and Outputs Petri Nets vs State � x strictly covers state � y if � x covers � y and, in addition, FSM Modeling Templates ∃ p ∈ P : x ( p ) > y ( p ) . Analysis Methods for Let � x ∈ R ( � x 0 ). A state � y is coverable by � x iff there exists a Petri Nets x ′ ∈ R ( � x ) such that x ′ ( p ) ≥ y ( p ) for all p ∈ P . state � Extensions and Restrictions From a given state � x 0 , can we reach a state that ”covers” a state � y ? Lionel Morel Spring 2006 72
Coverability - Example April 5, 2006 y 0 = [1 , 0 , 1 , 0 , 0] : � Lionel Morel state with minimal number of tokens Introduction required to enable Definitions Petri Nets t 0 Inputs and Outputs y 1 = [0 , 0 , 1 , 1 , 0] : � Petri Nets vs FSM same for t 2 Modeling Templates Analysis y 1 is coverable by � � x 0 (we can reach it from � x 0 Methods for Petri Nets � y 0 is not Extensions and ⇒ t 0 is dead while t 2 is at least L1-live Restrictions The question whether a transition is dead or L1-live can be formulated as a coverability problem! Lionel Morel Spring 2006 73
Coverability vs. Reachability April 5, 2006 Lionel Morel Introduction Coverability is weaker than reachability: Definitions Petri Nets Coverability = can we reach one state of an infinite set Inputs and Outputs that share a common property Petri Nets vs FSM Reachability = can we reach one specific state Modeling Templates But still, coverability can solve a great deal of the most Analysis Methods for common problems ! Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 74
Persistence April 5, 2006 Lionel Morel Introduction Understanding of the impact of one activity on another Definitions Petri Nets activity is of particular interest Inputs and Outputs Eg: can the occurence of an interrupt cause some tasks to Petri Nets vs FSM miss their deadline? Modeling Templates Analysis ⇒ Persistence captures some aspects of the relationship Methods for Petri Nets between transitions. Extensions and Restrictions Lionel Morel Spring 2006 75
Persistence - Definition April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Two transitions are persistent with respect to each other if, Inputs and Outputs when both are enabled the firing of one does not disable the Petri Nets vs other . FSM Modeling A Petri net is persistent if any two transitions are persistent Templates with respect to each other. Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 76
Persistence - Example April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and This is not persistent because, if both t 1 and t 3 are enabled, Restrictions the firing of t 3 will disable t 1 . But t 2 and t 3 are persistent with each other. Lionel Morel Spring 2006 77
Next... April 5, 2006 Lionel Morel Introduction Definitions Coverability tree - formal definition Petri Nets Inputs and Outputs Construction algorithm Petri Nets vs FSM Example Modeling Templates Expressing the previously introduced properties on the Analysis coverability tree Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 78
The coverability tree April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Efficient technique for addressing some of the problems Inputs and Outputs discussed previously Petri Nets vs FSM Intuition: tree with the arcs representing transitions and Modeling nodes denoting sets of states that can be covered by a Templates sequence of transitions Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 79
The coverability tree - Finite state space April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and The tree simply contains all the reachable states. Restrictions Works fine for finite state spaces, not for inifinite state spaces (would lead to infinite coverability trees) Lionel Morel Spring 2006 80
The coverability tree - Infinite state space April 5, 2006 Idea: represents two states (one covering the other) by the same node in the tree Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Leads to a finite representation for infinite coverability Lionel Morel Spring 2006 81
The coverability tree - Remarks April 5, 2006 Lionel Morel Introduction During the construction of the CT, if we find � y that covers Definitions x already contained in the tree, we can set an ω for all � Petri Nets Inputs and places where the marking of � y is greater than that of � x Outputs Petri Nets vs Of course, we loose information (we only know that a FSM place can contain a unbounded number of tokens, not the Modeling Templates exact number) Analysis Methods for Petri Nets But: we gain a finite representation for Infinite PN Extensions and Restrictions Lionel Morel Spring 2006 82
The coverability tree - Definition April 5, 2006 Lionel Morel Let N = ( P , T , A , w , � x 0 ) be a Petri Net. Introduction A coverability tree is a tree where the arcs denote transitions Definitions t ∈ T and the nodes represent w -enhanced states of the Petri Petri Nets Inputs and net. Outputs Petri Nets vs The root node of the tree is � x 0 . FSM A terminal node is an w -enhanced state in which no transition Modeling Templates is enabled. Analysis A duplicate node is an w -enhanced state which already exists Methods for Petri Nets somewhere else in the coverability tree. Extensions An arc t connects two nodes � x and � y in the tree, iff firing of t and Restrictions in state � x leads to state � y . Lionel Morel Spring 2006 83
The coverability tree - Algorithm April 5, 2006 Given is the Petri net N = ( P , T , A , w , � x 0 ). Lionel Morel Algorithm: Introduction Step 1. Set L , the list of open nodes, to L := � x 0 . Definitions Step 2. Take one node from L , named x , and remove it from L ; Petri Nets Inputs and if G ( � x , t ) = � Step 2.1. x ∀ t ∈ T Outputs then x is a terminal node goto Step 3; Petri Nets vs FSM x ′ ∈ G ( � for all � x , t ) , t ∈ T ,� x ¬ = � x ′ Step 2.2. Modeling Step 2.2.1. do if x ( p ) = ω then set x ′ ( p ) := x ; Templates Step 2.2.2. if there is a node � y already in the tree, Analysis x ′ covers � Methods for such that � y Petri Nets and there is a path from � y to � x ′ , Extensions then set x ( p ) := ω for all p for which x ′ ( p ) > y ( p ); and Restrictions x ′ is not a duplicate node then L := L ∪ { � Step 2.2.3. if � x ′ } ; Step 3. if L is not empty then goto Step 2. Lionel Morel Spring 2006 84
The coverability tree - Example April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 85
The coverability tree - Boundedness April 5, 2006 Lionel Morel Introduction Definitions A Petri net can be k -bounded if the symbol ω never Petri Nets Inputs and appears in its coverability tree. Outputs Petri Nets vs If the coverability tree contains an ω , a transition cycle to FSM exceed a given k -bound can be identified. Modeling Templates The coverability tree does not inform about the number of Analysis Methods for cycles required. Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 86
The coverability tree - Conservation April 5, 2006 Recal: � n i =1 γ i x ( p ) = constant for all p ∈ P and Lionel Morel x ∈ R ( � � x 0 ). If there is an ω the corresponding i must be 0. Introduction Definitions Algo: Petri Nets Check if previous condition is fulfilled Inputs and Outputs Check conservation (evaluated the weighted sum for each Petri Nets vs FSM node in the CT Modeling If result = 0 then PN is conservative w.r.t. weighted Templates vectore Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 87
Computing a conservation vector April 5, 2006 Algo: Lionel Morel Set i = 0 for every unbounded place p i . Introduction Definitions For b bounded places and r nodes in the coverability tree Petri Nets we set up r equations with b + 1 unknown variables Inputs and Outputs Petri Nets vs r FSM � γ i x ( p i ) = C . Modeling Templates i =1 Analysis Methods for Check if there exists a solution Petri Nets Extensions If so, calculate the solution to find weighting vector and C and Restrictions (= the exact number of tokens that are needed for that weighting vector) Lionel Morel Spring 2006 88
Computing the conservation vector - Example April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling γ 4 = 0 Templates 2 γ 1 + 0 γ 2 + 0 γ 3 = C Only non-negative solu- Analysis Methods for 1 γ 1 + 1 γ 2 + 1 γ 3 = C tion is γ = [0 , 0 , 0 , 0] and Petri Nets 0 γ 1 + 2 γ 2 + 2 γ 3 = C C = 0. Extensions and 0 γ 1 + 1 γ 2 + 0 γ 3 = C Restrictions PN is not conservative w.r.t. any nontrivial weighting vector Lionel Morel Spring 2006 89
Coverability Tree: Coverability and Reachability April 5, 2006 Lionel Morel Introduction Definitions Petri Nets The coverability problem can be solved by inspection of Inputs and Outputs the coverability tree. Petri Nets vs FSM The shortest transition sequence leading to a covering Modeling state can be found efficiently. Templates The reachability problem cannot be solved in general. Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 90
Limitations Distinct Petri Nets with Identical Coverability Tree - 1 April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Left PN can have any number of token in p 3 Right PN can only have an even number of tokens in p 3 Lionel Morel Spring 2006 91
Limitations Distinct Petri Nets with Identical Coverability Tree - 2 April 5, 2006 Lionel Morel Introduction Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling Templates Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 92
Limitations ? April 5, 2006 Lionel Morel Introduction Definitions Sometimes, it can however help solve deadlock, liveness or Petri Nets Inputs and reachability problems: Outputs Petri Nets vs If a state without an ω symbol is in the coverability tree it FSM is also reachable Modeling Templates Conversely, if a state cannot be covered, then it cannot be Analysis reached ! Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 93
Content April 5, 2006 Lionel Morel Introduction 1 Introduction Definitions Definitions 2 Petri Nets Inputs and Outputs Petri Nets vs Petri Nets vs FSM 3 FSM Modeling Templates Modeling Templates 4 Analysis Methods for Petri Nets Analysis Methods for Petri Nets Extensions 5 and Restrictions Extensions and Restrictions 6 Lionel Morel Spring 2006 94
Extensions and Restrictions April 5, 2006 Lionel Morel PN represent a compromise between expressive power and Introduction decision power Definitions Petri Nets Inputs and ↑ Expressive power means that more situations can be Outputs formulated and expressed Petri Nets vs FSM ↑ Decision power means that more problems can be Modeling Templates decided effectively Analysis It has been shown that PN are not as expressive as Turing Methods for Petri Nets machines (because they cannot model test for the Extensions and emptiness of a place) Restrictions Lionel Morel Spring 2006 95
Example: a shared channel April 5, 2006 P 1 P 2 Lionel Morel Introduction B 1 B 2 Definitions Petri Nets Inputs and Outputs Petri Nets vs FSM Modeling C 2 C 1 Templates Analysis Methods for two pairs of consumer/producer Petri Nets Extensions communicate through a shared channel and Restrictions P 1 / C 1 has a higher priority ⇒ communication from B 2 to C 2 takes place only when B 1 is empty Lionel Morel Spring 2006 96
Possible extensions April 5, 2006 Lionel Morel Introduction Definitions Petri Nets PN can be extended so as to solve the empty place problem: Inputs and Outputs Inhibitor arcs Petri Nets vs FSM timed-PN Modeling Templates colored-PN Analysis Methods for Petri Nets Extensions and Restrictions Lionel Morel Spring 2006 97
Extension: inhibitor arcs April 5, 2006 Lionel Morel Introduction Inhibitor arc: inhibits a transition when there is a token in Definitions Petri Nets its input place Inputs and Outputs Some of the places are considered to be inhibitor places in Petri Nets vs FSM the system Modeling Templates A transition is then enabled when there are tokens in its Analysis normal input places and there are zero tokens in all its Methods for Petri Nets inhibitor input places. Extensions and Restrictions Lionel Morel Spring 2006 98
Recommend
More recommend