1 / 54

Introducing Unfolding Petri nets

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

lukas
Download Presentation

Introducing Unfolding Petri nets

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  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". Pre – active – post • Examples of systems are: ·a university ·a lecture event ·a collection of streets and traffic ·a vending machine

  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) • Analytically • logically Why study flows? • - Flows indicate connection • flow may be related to the system goal • understand

  8. Problems • Describe the importance of a system. In other words, why should we study the structure and operation of systems in this way? • 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는 MPre(t)일 때 enable된다. • M1에서 t의 fire로 인해 M2의 상태에 도착된다면 M1[t>M2로 나타낸다. • M2=M1+Post(t)-Pre(t)=M1+C(t)

  14. unfold fire token produce enabled transition place subnet Enable

  15. 1.2.2 Net systems : marking and token game • N이 pure하다면 다음과 같이 나타낼 수 있다. • M1[t>M2M2=M1+C•et0 • et는 input vector • firing sequence =titj…..에 의해 M0로부터 Mk로 가는 상태 방정식 • M0[>MkMk=M0+C•  0,  0 • 는 firing counter vector

  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분석에서 중요한 문제이다.

  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 A B A B concurrency synchronisation communication A B A B A B conflict/choice multiplicity/resources 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 actions events ENVIRONMENT <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] 1 10 5 10

  27. R1,R2 p1 p2 p3 p4 p2 t1(2) t3(7) p1 p5 t5(1) p6 R1 p3 R2 w3 w1 w2 cycle temps p4 t + 14 t4(2) p5 t6(4) t2(3) p6 1.4.2 Timed net systems

  28. 1.5 Approaching Concurrency Qualitative Problems • concurrent and distributed systems는 보통 관리하고 이해하기가 어렵다. • concurrent system의 분석과도 많은 관련을 가진 qualitative properties • Boundedness : 상태 공간의 유한한 성질(토큰의 수가 일정할 경우) • Safe: 토큰의 수가 1인 경우 • Liveness: 모든 점화 가능한 트랜지션들에 대한 점화 가능성 • Deadlock-free:시스템 모델에서의 점화 가능성 보장 • Mutual:상호 배제성

  29. 예제

  30. p1 t1 t2 t4 t1 t2 t4 p2 p3 p4 t3 dead t2 (1,0,0,0) • <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될 수 없다. (0,1,0,0) (0,0,1,1) (1,0,0,0) (0,0,1,1)

  31. p1 t1 p4 t1 t2 t3 p5 p2 p3 p6 t3 t4 p7 • Liveness : 모든 transition이 fire 가능하다면 그 net system은 live하다. • net system의 initial marking의 증가(자원의 수 증가)와 net system의 live와는 관계가 없다. • If Mo(p5)=1이면, p5에 토큰을 증가 시킴으로써 deadlock 상태를 이끈다. (1,0,0,1,0,1,0) (0,1,0,0,1,1,0) (1,0,0,0,1,0,1) t2 (0,0,1,1,0,0,1) t4 (1,0,0,1,0,1,0)

  32. Reversibility • Reversibility : 항상 initial marking으로 되돌아 갈 수 있다면 그 시스템은 reversible 하다고 한다. • reachable marking에 deadlock이 존재한다면 reversible 할 수 없다. • 그림 처럼 reversible 하지는 않지만 live할 수는 있다. p1 (1,0,0,1,0) (0,1,0,1,0) t2 t1 t4 t3 t1 (0,1,0,1,0) (1,0,0,0,1) t2 p3 p2 t3 p4 p5 t3 (1,0,0,0,1) t1 (0,1,0,0,1) t4 (0,0,1,1,0)

  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 p3 (1,0,1,0,1) p5 t1 t3 t1 t3 (0,1,1,0,0) (1,0,0,1,0) t3 t2 t1 t4 p2 p4 (1,0,1,0,1) (1,0,1,0,1) t2 t4

  34. 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

  35. 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에서도 계산적 복잡도 때문에 종종 적용하기가 어려운 경향이 있다.

  36. 1.6.1 Reachability graph • system <N,M0>에서 만약 M0[>M인 sequence 가 존재한다면 marking은 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는 단순히 상태공간만을 고려할 뿐이다.

  37. 1.6.1 Reachability graph • place p가 만약 MjMi, Mj(p)>Mi(p)인 경우 Mj가 Mi로부터 reachable하지 않다면 <N, M0>가 bounded하다. • MjMi, MjMi인 경우 Mj가 Mi로부터 reachable하다면 <N, M0>는 unbounded하다. • 만약 marking에서 어떤 transition이 enable하지 않는 것이 발견된다면 그 시스템은 deadlock의 가능성이 있다. • reachability/coverability graph는 주어진 initial marking으로부터 만들어진다는 것이 중요하다. 만약, 자원들의 수가 변한다면 새로운 그래프가 만들어질 것이다. 즉, reachability/coverability graph는 parametric analysis가 아니다.

  38. 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들의 존재 때문에 이 방법은 다른 방법에 의해 보완되어야 할 필요성이 있다.

  39. 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 identity transition rules

  40. 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하다.

  41. 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하다.

  42. 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:TZ를 말한다. 이때 X는 다음과 같다. • X0 and CX=0 • non-negative T-flow를 consistent components나 T-semiflows라고 한다 • P-flow는 function vector Y:PZ를 말한다. 이때 Y는 다음과 같다. • Y0 and YTC=0 • non-negative P-flow를 conservative components나 P-semiflows라고 한다 • 일 때, 만약 이면 p는 implicit place이다. • 만약 이면 p는 marking implicit place이다.

  43. 1.6.2 Net system reduction

  44. 1.6.2 Net system reduction • p9에 대해

  45. 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하다.

  46. 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들을 분석하는데 효과적이다.

  47. analysis by simulation • analysis by simulation • net system 모델의 운동성을 진행한다. • deadlock과 같은 에러들을 찾아낼 수 있고 만약 simulation 과정 동안 문제들이 나타나지 않는다면 그 모델은 안전하다고 한다. • net system이 시간과 관련되어 있을 때, 그리고 system의 응답을 알기를 원할 때 유용하다

  48. 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 transition을 가진다. • 구조적으로 decision-free net이다. • synchronization은 모델링 가능하지만 choice는 표현할 수 없다. • fork/join queuing networks • production routing과 machine sequencing이 정의된다.

More Related