Sokhom Pheng March 1 McGill...

24
Petri Net Analysis Sokhom Pheng March 1 st 2004 McGill University

Transcript of Sokhom Pheng March 1 McGill...

Page 1: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Petri Net Analysis

Sokhom Pheng

March 1st 2004McGill University

Page 2: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Overview

Behavioral PropertiesIncidence Matrix & State EquationsAnalysis of Marked Graphs

Page 3: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Behavioral Properties

Properties dependent of initial marking

1. Reachability- Marking M reachable from Mo if ∃

a sequence of firing from Mo to M- Define R(Mo) to be set of marking

reachable from Mo

Page 4: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Behavioral Properties (cont)

2. Boundedness- Net bounded if num tokens in

each place not exceed finite numk for any marking reachable fromMo

Page 5: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Behavioral Properties (cont)3. Liveness

- L0: t can never be fired in anyfiring sequence

- L1: t can be fired at least once insome firing sequence

- L2: t can be fired at least k timesin some firing sequence

- L3: t appears ∞ in some firing seq.- L4: t is L1-live for every marking

Page 6: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Behavioral Properties (cont)

4. Reversibility- For each marking M in R(Mo),

Mo reachable from M

5. Coverability- ∃ marking M’ in R(Mo) such that

M’(p) ≥ M(p) for each place p

Page 7: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Behavioral Properties (cont)

6. Persistence- For any 2 enabled transitions, the

firing of one will not disable theother

Page 8: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Behavioral Properties (cont)

7. Synchronic distance- metric closely related to degree

of mutual dependence between 2events in a condition/event syst.

d12 = max |num t1 – num t2|num t1: num times t1 fires infiring seq starting at any marking

Page 9: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Behavioral Properties (cont)

8. Fairness- Bounded-fairness

2 transition are in bounded-fairrelation if max num time thateither can fire while other notfiring is bounded

Page 10: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Behavioral Properties (cont)

- Unconditionally fairFiring seq is uncond. fair if finite orevery transition in net appears infinitely often

Page 11: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Incidence Matrix

n x m matrix A (n trans. & m places) where aij = aij

+ - aij-

2

2

2

p2

p3

p1

p4

t2t1

t3

-2 1 1 0

1 -1 0 -2

1 0 -1 2

A =

Page 12: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

State Equation

Mk = Mk-1 + ATuk k = 1,2,…

Example:

3

0

0

2

2

0

1

0

-2 1 1

1 -1 0

1 0 -1

0 -2 2

0

0

1

Page 13: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

State Equation (cont)

Md = M0 + AT Σdk=1uk

=> ATx = ∆MLet r be the rank of A, partition A

A = A11 A12

A21 A22

r

n-rm-r r

Circuit matrix: Bf = [ Iµ : - AT11(AT

12)-1]

Page 14: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

State Equation (cont)

Example

rank = 2

-2 1 1 0

1 -1 0 -2

1 0 -1 2

1 0 2 ½

0 1 -1 –½Bf =

A =

Page 15: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Marked Graph

Analyzing matrix equations applicable only to special subclasses of Petri netsLook at marked graphs

Petri net such that each place p has exactly one input transition & exactly one output transition

Page 16: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Marked Graph (cont)

2

2

2 p1

p4

t2t1

t3

p2

p3

2

2

2 p1

p4

t2t1

t3

p2

p3

Not marked graph Marked graph

Page 17: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Analysis of Marked Graph

ReachabilityWeighted sum of tokensToken distance

Page 18: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Reachability

Md is reachable from M0 iffBfM0 = BfMd (Bf: circuit matrix)

& ∃ such firing sequenceIe. ATx = 0 is solvable for x

Page 19: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Weighted Sum of Tokens

Often interested in finding max or min weighted sum of tokens (MTW)

max {MTW | M∈ R(M0)}= min {MT

0I | I ≥ W, AI = 0}vice-versa

where W is mx1 matrix whose ithentry is num token in place i

Page 20: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Token Distance

Token distance matrix T wheretij = min M0(Pij)

or ∞ if no directed path Pij exists

where Pij is path from transition i to transition j

Page 21: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Token Distance (cont)

Example:

5 4 2

T =

30 1 0 0 01 0 0 1 12 1 0 1 22 1 0 0 12 1 0 0 01

Page 22: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Token Distance (cont)

Useful applicationsFirability• Transition j is firable at a marking M iff all

off-diagonal entries of jth column ≥ 0

Synchronic distance• dij = tij + tji

Liveness• Live iff tij + tji = dij ≠ 0 ∀ i ≠ j

Page 23: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Reference

Tadao Murata. Petri Nets: Properties, Analysis and Applications. Proceedings of the IEEE. Vol 77, No 4, April 1989.

Page 24: Sokhom Pheng March 1 McGill Universitymsdl.cs.mcgill.ca/people/hv/teaching/MSBDesign/COMP762B2004/... · marking 1. Reachability - Marking M reachable from M ... Fairness - Bounded-fairness

Questions?