Upload
lukas
View
53
Download
1
Embed Size (px)
DESCRIPTION
Introducing Unfolding Petri nets. LIS 창원대학교 이종근. 1. Introduction Petri nets. Introduction Nets and Net Systems On Modeling Features On Net Systems Interpretations Approaching Concurrency Qualitative Problems Qualitative Analysis of Net System Models - PowerPoint PPT Presentation
Citation preview
1
Introducing Unfolding Petri nets
LIS
창원대학교이종근
2
1. Introduction Petri nets
Introduction
Nets and Net Systems
On Modeling Features
On Net Systems Interpretations
Approaching Concurrency Qualitative Problems
Qualitative Analysis of Net System Models
Some Net Subclasses and Their Analysis
3
1.1 Introduction
Qualitative analysis : prove the correctness of the modeled system deadlock, overflow, mutual exclusion
Quantitative analysis : evaluation of the efficiency of the modeled system performance, responsiveness, utilization
Petri nets 정확성과 효율성 모두 잘 나타낼 수 있는 모델링 방법이다 . Discrete event dynamic system(DEDS) 을 분석하고 모델링 하는데 알맞은
그래픽적인 이론 도구이다 . communication network, computer system, discrete part manufacturing systems
autonomous : 모델링된 PN 자체적으로 해석 가능한 모델 non-autonomous : 모델링된 PN 이 외부의 영향을 함께 고려해야만 하는
모델
4
What is a system?
According to Webster a system is "a complex unity formed of many often diverse
parts subject to a common plan or serving a common purpose".
Examples of systems are: a university a lecture event a collection of streets and traffic a vending machine
Pre – active – postPre – active – post
5
What do these have in common?
- Associated with a specific goal or activity- Comprised of components(sub-systems) which interact- Have a definite locus or area,or logical- Properties of systems => share common structure
6
Why model these as a system?
System behavior is more important than components(why?)
Optimizing individual components ignores interactions(sub-optimization)
Modeling externally visible aspects ignores internal controls(infeasibility)
7
How to model a system?
Graphically (for description and communication)Graphically (for description and communication) AnalyticallyAnalytically logicallylogically
Why study flows?Why study flows?
- Flows indicate connection- flow may be related to the system goal- understand
- Flows indicate connection- flow may be related to the system goal- understand
8
Problems
1. Describe the importance of a system. In other words, why should we study the structure and operation of systems in this way?
2. Think of five examples of systems that might be important or interesting to study.
9
1.2 Nets and Net system
Petri net model net structure : structural
시스템의 정적인 부분을 나타낸다 . Marking : behavioral
구조에서 분산된 전체적인 상태를 나타낸다 .
10
1.2.1 Net structure
N = <P, T, F, W> P : places T : transitions F : flow relation W : weight
N=<P, T, Pre, Post> Pre : pre-incidence or input function Post : post-incidence or output function
Incidence matrices C = Post - Pre
self-loop 가 없는 Petri nets 를 “ pure” 라고 한다 . 만약 net 가 pure 하지 않다면 incidence matrix 에는 self-loop 를
나타내지 않는다 .
11
1.2.1 Net structure
12
Two self-loops
Pre: P x T -> N : pre-incidence or Input function
Post: T x P -> N : post-incidence or output function
13
1.2.2 Net systems : marking and token game
각 place 의 token 의 개수는 0 이상의 정수이다 . net system 은 <N, M0> 의 쌍으로 이루어진다 .
N 은 Petri nets M0 는 initial marking 이다 .
token game : net system 에서의 전개과정은 marking 에 의한 firing(occurrence) rule 에 의해 이루어진다 .
enable 된 transition 이 반드시 fire 하는 것은 아니다 . M 에서 transition t 는 MPre(t) 일 때 enable 된다 . M1 에서 t 의 fire 로 인해 M2 의 상태에 도착된다면 M1[t>M2 로
나타낸다 . M2=M1+Post(t)-Pre(t)=M1+C(t)
14
Enable
transition place subnet
fire
enabled
unfold
produce
token
15
1.2.2 Net systems : marking and token game
N 이 pure 하다면 다음과 같이 나타낼 수 있다 . M1[t>M2M2=M1+C•et0
et 는 input vector
firing sequence =titj….. 에 의해 M0 로부터 Mk 로 가는 상태 방정식 M0[>MkMk=M0+C• 0, 0
는 firing counter vector
21
0
0
1
0
2
0
0
0
0
0
0
1
110000
001100
110101
002010
000012
001001
0
0
0
0
0
1
MeCM t
16
1.2.2 Net systems : marking and token game
<fig 1.1>(a) 에서 =(1,2,1,1,0,0)T 인 경우 Mk=M0 를 만족한다 .
이 때 Mk=M0, =(1,2,1,1,0,0)T 을 상태 방정식의 spurious solution이라고 한다 .
spurious solution 의 존재는 linear algebra techniques 를 사용하는 net system 분석에서 중요한 문제이다 .
00
0
0
0
0
0
0
0
0
1
1
2
1
110000
001100
110101
002010
000012
001001
0
0
0
0
0
0
MCM
17
1.3 On Modeling Features 세 가지 기본적인 모델링 표기법
casual dependence (sequence) conflict (decision, choice) concurrency
<fig 1.1>(b) 에서 c 와 e transition 은 conflict 관계이다 . transition c 와 e 는 동시에 enable 되지만 동시에 fire 될 수 없다 .
두 개의 transition 이 동시에 fire 될 수 있다면 concurrent 하다 . <fig 1.1>(b) 에서 M=(0,2,0,1,0,0,0)T 인 상태에서 transition b 와 c 는
동시에 fire 된다 . transition b 는 스스로 병행적으로 fire 될 수 있다 . : self-concurrency
18
A B
concurrency
A B
synchronisation
A B
communication
A B
conflict/choice
A B
multiplicity/resources
A B
individuality/data
19
1.3 On Modeling Features
Synchronization 은 distributed 와 concurrent system 의 모델링에서 매우 중요하다 . <fig 1.4>(f) 의 pi 와 pj 는 동시에 mark 될 수 없다 . : mutual exclusion
<fig 1.4>(g) 의 R 자원은 p2 와 p4 의 동시사용을 불가능하게 한다 . : mutual exclusion
20
1.3 On Modeling features
locality principle top-down 접근법 : 초기모델을 가지고 출발하여 단계적인 재정의를 통해
마지막 모델을 이끌어 내는 과정이다 . bottom-up 접근법 : 모듈들을 생산해 내는 것으로 각각 설계한 것을
나중에 합성하는 것이 가능하다 .
21
1.4 On Net Systems Interpretations
autonomous net system : net system 의 행위가 환경에 영향을 받지 않는 net system 을 말한다 .
non-autonomous : autonomous net system 에 비해 많은 외부 환경의 영향을 받는다 .
SYSTEM
ENVIRONMENT
actionsevents
<fig 1.7> Modeled system and its environment mutually interact
22
1.4.1 Marking flow charts and marking diagrams
Marking flow charts concurrent software system 들의 제어부분을 모델링 한다 . control part(CP) 와 operative part(OP) 에 기반을 둔 표현이다 . instruction 의 실행은 transition 의 점화에 의해 나타낸다 .
23
1.4.1 Marking flow charts and marking diagrams marking diagrams
discrete-event-controller 를 모델링 하는데 사용된다 . events 와 외부 변수들의 boolean function 들은 transition 들의 firing
으로 나타낸다 . action 들은 transition 들이나 place 들의 marking 과 연관되어 있다 . <fig1.9> 에서 R 은 mutual exclusion semaphore 이다 .
24
1.4.2 Timed net systems 시간표시가 없는 petri net 은 단지 사건들 사이에 존재하는 일반적인
관계들을 묘사함에 의해 시스템의 논리적인 행위들을 모델링 한다 . performance, scheduling, real-time control 문제들을 고려하는 모델링을
위해서는 시간의 표현이 필수적이다 . transition 의 “ timed firing”
enable 된 transition 이 즉시 input place 로부터 토큰들을 제거하는 단계
transition 들이 작업을 하는 “ timed 단계” output place 에 토큰들을 넣어 두는 단계
시간 표현은 choice 의 conflict 해결점을 가지고 있다 . t-TPN : transition-timed Petri net
<N,Z> N=<P, T, Pre, Post> R : P R+, zi=Z(ti) 는 transition ti 의 firing time 이다 .
p-TPN : place-timed Petri net <N,Z>
N=<P, T, Pre, Post> R : P R+, ri=R(pi) 는 pi 에 있는 token 의 최소 residence time 이다 .
25
1.4.2 Timed net systems
p-TPN 에 있는 token 은 ready 와 not ready 의 두 가지 상태를 가질 수 있다 .
not ready token 들은 transition 들을 enable 하지 않는다 .
token 들이 place 에 도착했을 때 그것은 not ready 상태이다 .
그리고 ri=R(pi) 시간 단위의 간격 후에 ready 가 된다 .
기본적인 timed PN 모델에서 conflict 해결 전략은 나타나지 않는다 . 이는 비결정적이다 .
GSPN(Generalized Stochastic Petri Net)
timed transition 과 immediate transition 을 가지고 있다 .
immediate transition 은 0 time 에 fire 된다 .
immediate transition 들 사이의 conflict 는 routing probability 방법을 사용하여 해결된다 .
따라서 queuing network 의 동기화 표현의 부족을 GSPN 으로 표현할 수 있다 .
26
[1,10]
[5]
101
105
27
1.4.2 Timed net systems
tempst + 14
p3
p4
p5
p6
cycle
p2
p1
R1,
R2
t1(2)
t2(3)
t3(7)
t4(2)
t5(1)
R1 R2
p1
p3
p5
p2
p4
p6
w2 w3w1
t6(4)
28
1.5 Approaching Concurrency Qualitative Problems
concurrent and distributed systems 는 보통 관리하고 이해하기가 어렵다 . concurrent system 의 분석과도 많은 관련을 가진 qualitative properties
Boundedness : 상태 공간의 유한한 성질 ( 토큰의 수가 일정할 경우 ) Safe: 토큰의 수가 1 인 경우 Liveness: 모든 점화 가능한 트랜지션들에 대한 점화 가능성 Deadlock-free: 시스템 모델에서의 점화 가능성 보장 Mutual: 상호 배제성
29
예제
30
<fig 1.12>(a) Unbounded
t2 의 firing M=(0,0,1,1)T
t4 의 firing M1=(1,0,1,0)T
계속적인 t2, t4 의 firing M=(1,0,,0)T
p3 는 unbounded 이며 , 따라서 overflow 가 나타날 수 있다 . deadlock
만약 t1 이 fire 된다면 다른 어떤 transition 도 fire 될 수 없다 .
p1
t1
p2
t4t2
p3 p4
t3
(1,0,0,0)
t1
(0,1,0,0) (0,0,1,1)
t2
t4
(1,0,0,0)t2
(0,0,1,1)
dead
31
Liveness : 모든 transition 이 fire 가능하다면 그 net system 은 live하다 .
net system 의 initial marking 의 증가 ( 자원의 수 증가 ) 와 net system 의 live 와는 관계가 없다 .
If Mo(p5)=1 이면 , p5 에 토큰을 증가 시킴으로써 deadlock 상태를 이끈다 .
p1
t1
p2
t4
t2
p3
p4
p5
t3
p6
p7
(1,0,0,1,0,1,0)
t1
(0,1,0,0,1,1,0)
(0,0,1,1,0,0,1)
t2
t3
(1,0,0,0,1,0,1)
t4
(1,0,0,1,0,1,0)
32
Reversibility
Reversibility : 항상 initial marking 으로 되돌아 갈 수 있다면 그 시스템은 reversible 하다고 한다 .
reachable marking 에 deadlock 이 존재한다면 reversible 할 수 없다 .
그림 처럼 reversible 하지는 않지만 live 할 수는 있다 .
p1
t1
p2
t4
t2 p3
p4t3
p5
(1,0,0,1,0)
t1
(0,1,0,1,0)
t3
(1,0,0,0,1)
t1
(0,1,0,0,1)
t4
(0,0,1,1,0)
t2(0,1,0,1,0)
t3
(1,0,0,0,1)
33
Mutual exclusion
Mutual exclusion : 하나의 store 에 두 개의 robot 들이 동시에 접근하는 것을 제어하는 데 쓰는 속성이다 .
그림에서 M(p2)+M(p4)+M(p5)=1
M(p2)=1 M(p4)=M(p5)=0, M’(p4)=1 M’(p2)=M’(p5)=0
즉 , p2 와 p4 는 mutual exclusion 상태에 있다 .
p1
t1
p2
t4
t3
p3
p5
p4
t2
(1,0,1,0,1)
t1
(0,1,1,0,0) (1,0,0,1,0)
t3
t2
(1,0,1,0,1)
t4
(1,0,1,0,1)
t3t1
34
35
1.6 Qualitative Analysis of Net System Models
net system 의 분석 기술 analysis by enumeration : static method
analysis by transformation : static method
structural analysis : static method
analysis by simulation : dynamic method
36
analysis by enumeration
analysis by enumeration
net marking 과 transition firing 을 나타내는 reachability graph 의 생성에 기반을 둔다 .
net system 이 bounded 하다면 reachability graph 는 유한하고 다른 qualitative 속성들도 쉽게 증명될 수 있다 .
유한한 그래프는 다른 말로 coverability graph 라고 한다 .
net system 이 unbounded 하다면 그래프들은 무한하고 그러므로 생성하기가 불가능하다 .
place 들이 거의 없는 net 에서도 계산적 복잡도 때문에 종종 적용하기가 어려운 경향이 있다 .
37
1.6.1 Reachability graph system <N,M0> 에서 만약 M0[>M 인 sequence 가 존재한다면 markin
g 은 reachable 하다고 한다 . 이 접근법의 제한점은 state explosion problem 이다 .
state explosion problem 은 marking 의 숫자가 지수적으로 증가하는 것을 말한다 .
<fig 1.14> 에서 transition b 와 c 사이에 firing concurrency 가 나타난다 . P6 은 reachability graph 를 변화 시키지 않는다 .
그러나 transition b 와 c 는 firing mutual explosion 관계에 있다 . 즉 , P6 이 있으나 없으나 reachability graph 로는 mutual explosion
현상을 나타낼 수가 없다 . 따라서 reachability graph 는 단순히 상태공간만을 고려할 뿐이다 .
38
1.6.1 Reachability graph
place p 가 만약 MjMi, Mj(p)>Mi(p) 인 경우 Mj 가 Mi 로부터 reachable
하지 않다면 <N, M0> 가 bounded 하다 .
MjMi, MjMi 인 경우 Mj 가 Mi 로부터 reachable 하다면 <N, M0> 는 un
bounded 하다 .
만약 marking 에서 어떤 transition 이 enable 하지 않는 것이 발견된다면
그 시스템은 deadlock 의 가능성이 있다 .
reachability/coverability graph 는 주어진 initial marking 으로부터
만들어진다는 것이 중요하다 . 만약 , 자원들의 수가 변한다면 새로운
그래프가 만들어질 것이다 . 즉 , reachability/coverability graph 는 paramet
ric analysis 가 아니다 .
39
analysis by transformation
analysis by transformation
주어진 net system <N, M0> 에서 속성들의 집합 를 증명하고자 할 때 다음과 같은 net system <N’,M0’> 으로 변형시켜 생각한다 .
<N’,M0’>
<N, M0> 의 속성들 가 변형된 <N’,M0’> 에서 만족된다면 ,
<N, M0> 보다 <N’,M0’> 에서 속성들 를 증명하는 것이 더 쉽다 .
reduction method
transformation 방법의 특별한 분야이다 .
reduction method 의 적용은 irreducible net system 의 존재에 의해 제한을 받는다 .
irreducible net system 들의 존재 때문에 이 방법은 다른 방법에 의해 보완되어야 할 필요성이 있다 .
40
1.6.2 Net system reduction
reduction method liveness, boundedness, reversibility 등과 같은 속성들의 집합을
보존하며 분석된다 . 변형과정은 반복적이다 . 속성들이 보존되는 한 irreducible 될 때까지 reduce 한다 .
A basic kit reduction rules
RA1 : macroplace rule
RA2 : transition fusion rules
RB1, RC1 : implicit place rule
RB2, RC2 : identical and ident
ity transition rules
41
1.6.2 Net system reduction <fig 1.17> : <fig 1.9> 의 net system 을 reduce 한다 .
op1-t3-wait dep p3, op2-t6-wait free p6 : RA1 t1-load-t2 t12, t4-deposit-t5 t45 : RA2 t7-unload-t8 t78, t9-withdraw-t10 t910 : RA2 <fig 1.17>(a) 의 place R 이 reduce 된다 . : RC1 <fig 1.17>(a) 의 net 가 <fig 1.17>(b) 로 reduce 된다 . : RC1, RA2 <fig 1.17>(b) 의 net 가 <fig 1.17>(c) 로 reduce 된다 . : RC1 <fig 1.17>(c) 의 net 가 <fig 1.17>(d) 로 reduce 된다 . : RA2 따라서 original net system 은 live 하고 , 7-bounded 하며 , reversible 하다 .
42
1.6.2 Net system reduction Implicit places
(firing)implicit places : 만약 place 가 initial marking 에 대해 어떤 firing 순서와 상관없이 수행된다면 , 그 place 는 net system 의 행동들에 대한 순서 변화 없이 제거할 수 있다 .
<fig 1.18> net system 은 p4 가 unbounded place 이므로 unbounded 하고 non-
reversible 하다 . p4 는 implicit place 이다 . p4 를 제거함으로써 net system 은 bounded 하고 reversible 하다 .
43
1.6.2 Net system reduction implicit place 의 제거
보존되는 것 : deadlock-freeness, liveness, marking mutual exclusions 보존되지 않는 것 : boundedness, reversibility, firing mutual exclusion
implicit place 를 찾는 방법 T-flow 는 function vector X:TZ 를 말한다 . 이때 X 는 다음과 같다 .
X0 and CX=0 non-negative T-flow 를 consistent components 나 T-semiflows 라고 한다
P-flow 는 function vector Y:PZ 를 말한다 . 이때 Y 는 다음과 같다 . Y0 and YTC=0 non-negative P-flow 를 conservative components 나 P-semiflows 라고 한다
0)(,0
),(Pr)(Pr
)(
min 0
pYY
pttpeteY
pCCYtosubject
MYz
T
T
T
일 때 , 만약 이면 p 는 implicit place 이다 .
만약 이면 p 는 marking implicit place 이다 .
0)(0 pM zpM )(0
)( pCCY T
44
1.6.2 Net system reduction
010001
101000
011000
011000
011100
000111
010010
010001
100001
)0,0,1,0,1,1,1,0,0(
9
8
7
6
5
4
3
2
1
p
p
p
p
pC
p
p
p
p
fedcba
Y T
)]()()()()([)]0,0,1,0,1,1,1,0,0([ 75439 pCpCpCpCpCY T
45
1.6.2 Net system reduction p9 에 대해
1
0
0
0
0
1
0
1
1
)(Pr transitionate0
1
0
1
1
1
0
1
1
0
),(Pr
1)(Pr
transitionetpe
teY T
0
1
0)(Pr
0
z
MYz
teY
T
T
따라서
1
0
0
0
1
0
0
1
1
0
)001011100(
placeimplicitp
zpM
0)(
9
0
는
46
1.6.2 Net system reduction
<fig 1.19>(a) 는 <fig 1.19>(b) 와 같이 reduce 가능하다 . p3-b-p4 p34 : RA1
p8-f-p1-a-p34 4 : RA1
p6-d-p7-e-p6 p6-tde-p6 : cycle
<fig 1.19> 는 live 하며 bounded 하다 .
47
48
structural analysis
structural analysis net 구조를 고려한다 . initial marking 을 기본적인 parameter 로서 간주하여 분석한다 . net system 의 행동과 net 구조 사이의 관계를 조사한다 . 두 가지의 분석 기술이 있다 .
Linear algebra/Linear programming-based techniques : net system에서 state equation 에 기반을 두고 있으며 이것은 enumeration 의 필요 없이 빠른 분석이 가능하다 .
Graph-based techniques : bipartite directed graph 로서 나타내며 , 특히 ordinary net 의 제한된 subclass 들을 분석하는데 효과적이다 .
49
analysis by simulation
analysis by simulation net system 모델의 운동성을 진행한다 . deadlock 과 같은 에러들을 찾아낼 수 있고 만약 simulation 과정 동안
문제들이 나타나지 않는다면 그 모델은 안전하다고 한다 . net system 이 시간과 관련되어 있을 때 , 그리고 system 의 응답을 알기를
원할 때 유용하다
50
1.7 Some Net Subclasses and Their Analysis1.7.1 Definition of four net subclasses
state machine(SM) : transition 은 하나의 input place 와 하나의 output place
를 갖는다 .
‘conflicts’ 형태의 모델링을 할 수 있다 .
choice 는 모델링 가능하지만 synchronization 은 표현할 수 없다 .
state machine 에서는 어떤 경우에도 토큰들이 창조되지 않는다 .
그러므로 ‘ finite state systems’ 를 모델링할 수 있다 .
marked graph(MG) : place 는 하나의 input transition 과 하나의 output tran
sition 을 가진다 .
구조적으로 decision-free net 이다 .
synchronization 은 모델링 가능하지만 choice 는 표현할 수 없다 .
fork/join queuing networks
production routing 과 machine sequencing 이 정의된다 .
11 tandtTt
11 pandpPp
51
1.7.1 Definition of four net subclasses
free-choice net(FCN) : transition ti 와 tj 가 동일한 input place p 를 가진다
면 , 그 place p 는 오로지 transition ti 와 tj 의 input place 이다 .
free-choice synchronized queuing networks
simple net(SN) : 각 transition 이 적어도 하나의 input place 를 다른 trans
ition 과 공유한다 .
1,1, kk tptpPp
1|}1{| pthatsuchtpTt
52
1.7.1 Definition of four net subclasses
53
1.7.1 Definition of four net subclasses <fig 1.25>
(a) 는 세 개의 machine 과 두 개의 buffer 를 가지는 flow line 이다 . (b) 는 blocking-after service mechanism 이라는 가정 하에 reliable
machine 을 가지고 모델링 하였다 . (c) 는 unreliable machine 일 경우의 모델이다 . (FCN 이용 )
54
1.7.2 On the analysis of the net systems subclasses
siphon : input transition 의 집합이 output transition 의 집합에 포함되는 place 들의 subset 을 말한다 .
P is a siphon (a) : 은 siphon 이다 .
왜냐하면 trap : output transition 의 집합이 input transition 들의 집합에 포함되는 pl
ace 들의 subset 을 말한다 .
P is a trap siphon 과 trap 은 reverse 관계이다 .
},,,,{ 65421 ppppp
}{,},,,,{ 653217 tttttt