Techniques and Tools for the Analysis of Timed Workflows Jiri Srba - - PowerPoint PPT Presentation

techniques and tools for the analysis of timed workflows
SMART_READER_LITE
LIVE PREVIEW

Techniques and Tools for the Analysis of Timed Workflows Jiri Srba - - PowerPoint PPT Presentation

Techniques and Tools for the Analysis of Timed Workflows Jiri Srba Department of Computer Science, Aalborg University, Selma Lagerl ofs Vej 300, 9220 Aalborg East, Denmark NWPT15, Iceland, October 22nd, 2015 Joint work with Peter G.


slide-1
SLIDE 1

Techniques and Tools for the Analysis of Timed Workflows

Jiri Srba

Department of Computer Science, Aalborg University, Selma Lagerl¨

  • fs Vej 300, 9220 Aalborg East, Denmark

NWPT’15, Iceland, October 22nd, 2015

Joint work with Peter G. Jensen, Jos´ e A. Mateo and Mathias G. Sørensen.

slide-2
SLIDE 2

Workflow Definition

Workflows [Wikipedia] A workflow consists of an orchestrated and repeatable pattern of business activity enabled by the systematic organization of resources into processes that transform materials, provide services, or process information. Examples: Car assembly line. Insurance claim. Blood transfusion.

2 / 26

slide-3
SLIDE 3

Workflow Definition

Workflows [Wikipedia] A workflow consists of an orchestrated and repeatable pattern of business activity enabled by the systematic organization of resources into processes that transform materials, provide services, or process information. Examples: Car assembly line. Insurance claim. Blood transfusion. All these are examples of time-critical workflows. There is a need for methods and tools for timed workflow analysis.

2 / 26

slide-4
SLIDE 4

Introduction — Workflow Nets

Workflow nets by Wil van der Aalst [ICATPN’97] are widely used for workflow modelling. Based on Petri nets. Abstraction from data, focus on execution flow. Early detection of design errors like deadlocks, livelocks and

  • ther abnormal behaviour.

Classical soundness for workflow nets:

  • ption to complete,

proper termination, and absence of redundant tasks.

3 / 26

slide-5
SLIDE 5

Focus of the Talk

Theory of workflow nets based on timed-arc Petri nets. Definition of soundness and strong soundness. Results about decidability/undecidability of soundness. Minimum and maximum execution time of workflow nets. Integration within the tool TAPAAL and case studies. Discrete vs. continuous time.

4 / 26

slide-6
SLIDE 6

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

start book pay success [2, 5]

5 / 26

slide-7
SLIDE 7

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

start book pay success [2, 5]

5 / 26

slide-8
SLIDE 8

Timed-Arc Petri Net: Booking/Payment Example

in 1 inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

start book pay success [2, 5]

5 / 26

slide-9
SLIDE 9

Timed-Arc Petri Net: Booking/Payment Example

in 2 inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

start book pay success [2, 5]

5 / 26

slide-10
SLIDE 10

Timed-Arc Petri Net: Booking/Payment Example

in 5 inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

start book pay success [2, 5]

5 / 26

slide-11
SLIDE 11

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking 5 inv: ≤ 10 payment successful

  • ut

start book pay success [2, 5]

5 / 26

slide-12
SLIDE 12

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking 8 inv: ≤ 10 payment successful

  • ut

start book pay success [2, 5]

5 / 26

slide-13
SLIDE 13

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

start book pay success [2, 5]

5 / 26

slide-14
SLIDE 14

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

start book pay success [2, 5]

5 / 26

slide-15
SLIDE 15

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

start book pay restart restart success fail [5,5] fail [10,10] [2, 5]

5 / 26

slide-16
SLIDE 16

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

attempts start 3× book pay restart restart empty success fail [5,5] fail [10,10] [2, 5]

5 / 26

slide-17
SLIDE 17

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

attempts start 3× book pay restart restart empty success fail [5,5] fail [10,10] [2, 5]

5 / 26

slide-18
SLIDE 18

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

0 0 0 attempts start 3× book pay restart restart empty success fail [5,5] fail [10,10] [2, 5]

5 / 26

slide-19
SLIDE 19

Timed-Arc Petri Net: Booking/Payment Example

in 2 inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

2 2 2 attempts start 3× book pay restart restart empty success fail [5,5] fail [10,10] [2, 5]

5 / 26

slide-20
SLIDE 20

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

2 2 attempts start 3× book pay restart restart empty success fail [5,5] fail [10,10] [2, 5]

5 / 26

slide-21
SLIDE 21

Timed-Arc Petri Net: Booking/Payment Example

in 3 inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

5 5 attempts start 3× book pay restart restart empty success fail [5,5] fail [10,10] [2, 5]

5 / 26

slide-22
SLIDE 22

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking 3 inv: ≤ 10 payment successful

  • ut

7 7 attempts start 3× book pay restart restart empty success fail [5,5] fail [10,10] [2, 5]

5 / 26

slide-23
SLIDE 23

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking 5 inv: ≤ 10 payment successful

  • ut

9 9 attempts start 3× book pay restart restart empty success fail [5,5] fail [10,10] [2, 5]

5 / 26

slide-24
SLIDE 24

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

9 9 attempts start 3× book pay restart restart empty success fail [5,5] fail [10,10] [2, 5]

5 / 26

slide-25
SLIDE 25

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

9 attempts start 3× book pay restart restart empty success fail [5,5] fail [10,10] [2, 5]

5 / 26

slide-26
SLIDE 26

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

attempts start 3× book pay restart restart empty success fail [5,5] fail [10,10] [2, 5]

5 / 26

slide-27
SLIDE 27

Timed-Arc Petri Net: Booking/Payment Example

in inv: ≤ 5 booking inv: ≤ 10 payment successful

  • ut

attempts start 3× book pay restart restart empty success fail [5,5] fail [10,10] [2, 5]

5 / 26

slide-28
SLIDE 28

Monotonic Timed-Arc Petri Nets

Timed-Arc Petri Nets (TAPN) Modelling Features: Timed tokens, intervals (guards) on arcs. Weighted arcs. Transport arcs. Inhibitor arcs. Age invariants. Urgent transitions.

6 / 26

slide-29
SLIDE 29

Monotonic Timed-Arc Petri Nets

Timed-Arc Petri Nets (TAPN) Modelling Features: Timed tokens, intervals (guards) on arcs. Weighted arcs. Transport arcs. Inhibitor arcs. Age invariants. Urgent transitions. Monotonic Timed-Arc Petri Nets (MTAPN) No inhibitor arcs, no age invariants, no urgent transitions. We consider the integer-delay (discrete-time) semantics (for now).

6 / 26

slide-30
SLIDE 30

Marking Extrapolation

Marking in TAPN M : P → B(N0) Problem Infinitely many markings even for bounded nets. We define cut(M) extrapolation for a marking M: compute for each place maximum relevant token ages Cmax : P → (N0 ∪ {−1}) change the age of each token in place p exceeding the bound Cmax(p) into Cmax(p) + 1.

7 / 26

slide-31
SLIDE 31

Monotonicity Lemma for MTAPN

Monotonicity Lemma (t is transition, d is delay) Let M and M′ be markings in an MTAPN s.t. cut(M) ⊑ cut(M′). If M

t

− → M1 then M′

t

− → M′

1 and cut(M1) ⊑ cut(M′ 1).

If M

d

− → M1 then M′

d

− → M′

1 and cut(M1) ⊑ cut(M′ 1).

Fact: inhibitor arcs, age invariants and urgency break monotonicity.

8 / 26

slide-32
SLIDE 32

Timed-Arc Workflow Net

Definition A TAPN is called a timed-arc workflow net if it has a unique place in ∈ P s.t. •in = ∅ and in• = ∅, it has a unique place out ∈ P s.t. out• = ∅ and •out = ∅,

  • p = ∅ and p• = ∅ for all p ∈ P \ {in, out}, and
  • t = ∅ for all t ∈ T.

in

  • ut

start working inv: ≤ 10 finish [5, 10]

9 / 26

slide-33
SLIDE 33

Timed-Arc Workflow Net

Definition A TAPN is called a timed-arc workflow net if it has a unique place in ∈ P s.t. •in = ∅ and in• = ∅, it has a unique place out ∈ P s.t. out• = ∅ and •out = ∅,

  • p = ∅ and p• = ∅ for all p ∈ P \ {in, out}, and
  • t = ∅ for all t ∈ T.

in

  • ut

start working inv: ≤ 10 finish [5, 10]

An initial marking has just one token of age 0 in the place in. A final marking has exactly one token in place out and all

  • ther places are empty.

9 / 26

slide-34
SLIDE 34

Timed-Arc Workflow Net

Definition A TAPN is called a timed-arc workflow net if it has a unique place in ∈ P s.t. •in = ∅ and in• = ∅, it has a unique place out ∈ P s.t. out• = ∅ and •out = ∅,

  • p = ∅ and p• = ∅ for all p ∈ P \ {in, out}, and
  • t = ∅ for all t ∈ T.

in

  • ut

start working inv: ≤ 10 finish [5, 10]

An initial marking has just one token of age 0 in the place in. A final marking has exactly one token in place out and all

  • ther places are empty.

9 / 26

slide-35
SLIDE 35

Timed-Arc Workflow Net

Definition A TAPN is called a timed-arc workflow net if it has a unique place in ∈ P s.t. •in = ∅ and in• = ∅, it has a unique place out ∈ P s.t. out• = ∅ and •out = ∅,

  • p = ∅ and p• = ∅ for all p ∈ P \ {in, out}, and
  • t = ∅ for all t ∈ T.

in

  • ut

start working inv: ≤ 10 finish [5, 10]

An initial marking has just one token of age 0 in the place in. A final marking has exactly one token in place out and all

  • ther places are empty.

9 / 26

slide-36
SLIDE 36

Timed-Arc Workflow Net

Definition A TAPN is called a timed-arc workflow net if it has a unique place in ∈ P s.t. •in = ∅ and in• = ∅, it has a unique place out ∈ P s.t. out• = ∅ and •out = ∅,

  • p = ∅ and p• = ∅ for all p ∈ P \ {in, out}, and
  • t = ∅ for all t ∈ T.

in

  • ut

start 7 working inv: ≤ 10 finish [5, 10]

An initial marking has just one token of age 0 in the place in. A final marking has exactly one token in place out and all

  • ther places are empty.

9 / 26

slide-37
SLIDE 37

Timed-Arc Workflow Net

Definition A TAPN is called a timed-arc workflow net if it has a unique place in ∈ P s.t. •in = ∅ and in• = ∅, it has a unique place out ∈ P s.t. out• = ∅ and •out = ∅,

  • p = ∅ and p• = ∅ for all p ∈ P \ {in, out}, and
  • t = ∅ for all t ∈ T.

in

  • ut

start working inv: ≤ 10 finish [5, 10]

An initial marking has just one token of age 0 in the place in. A final marking has exactly one token in place out and all

  • ther places are empty.

9 / 26

slide-38
SLIDE 38

Soundness of Timed-Arc Workflow Nets

Definition A timed-arc workflow net is sound if for any marking M reachable from the initial marking holds:

1 from M it is possible to reach some final marking, and 2 if M(out) contains a token then M is a final marking. 10 / 26

slide-39
SLIDE 39

Soundness of Timed-Arc Workflow Nets

Definition A timed-arc workflow net is sound if for any marking M reachable from the initial marking holds:

1 from M it is possible to reach some final marking, and 2 if M(out) contains a token then M is a final marking.

Soundness Implies Boundedness If N is a sound and monotonic timed-arc workflow net then N is bounded.

10 / 26

slide-40
SLIDE 40

Sound and Unbounded Net with Age Invariants

in p1 inv: ≤ 0 p2

  • ut

t1 [0, 0] [1, ∞] t2

11 / 26

slide-41
SLIDE 41

Sound and Unbounded Net with Age Invariants

in p1 inv: ≤ 0 p2

  • ut

t1 [0, 0] [1, ∞] t2

11 / 26

slide-42
SLIDE 42

Sound and Unbounded Net with Age Invariants

in p1 inv: ≤ 0 p2

  • ut

t1 [0, 0] [1, ∞] t2

11 / 26

slide-43
SLIDE 43

Sound and Unbounded Net with Age Invariants

in p1 inv: ≤ 0 p2

  • ut

t1 [0, 0] [1, ∞] t2

11 / 26

slide-44
SLIDE 44

Sound and Unbounded Net with Age Invariants

in p1 0 0 inv: ≤ 0 p2

  • ut

t1 [0, 0] [1, ∞] t2

11 / 26

slide-45
SLIDE 45

Sound and Unbounded Net with Age Invariants

in p1 inv: ≤ 0 p2

  • ut

t1 [0, 0] [1, ∞] t2

11 / 26

slide-46
SLIDE 46

Sound and Unbounded Net with Age Invariants

in p1 inv: ≤ 0 p2

  • ut

t1 [0, 0] [1, ∞] t2

11 / 26

slide-47
SLIDE 47

Sound and Unbounded Net with Age Invariants

in 1 p1 inv: ≤ 0 p2

  • ut

t1 [0, 0] [1, ∞] t2

11 / 26

slide-48
SLIDE 48

Sound and Unbounded Net with Age Invariants

in p1 inv: ≤ 0 p2

  • ut

t1 [0, 0] [1, ∞] t2

11 / 26

slide-49
SLIDE 49

Sound and Unbounded Net with Age Invariants

in p1 / / / / inv: / / / / / / ≤ 0 p2

  • ut

t1 [0, 0] [1, ∞] t2

Sound and Unbounded Net with Urgent Transitions Remove age invariant ≤ 0 at place p2 and make t2 urgent.

11 / 26

slide-50
SLIDE 50

Decidability of Soundness

Theorem Soundness is undecidable for timed-arc workflow nets. Undecidable even for monotonic nets with only inhibitor arcs, or

  • nly age invariants, or only urgent transitions.

12 / 26

slide-51
SLIDE 51

Decidability of Soundness

Theorem Soundness is undecidable for timed-arc workflow nets. Undecidable even for monotonic nets with only inhibitor arcs, or

  • nly age invariants, or only urgent transitions.

Theorem Soundness is decidable for bounded timed-arc workflow nets, and for monotonic timed-arc workflow nets. Proof: Forward and backward search through the extrapolated state-space (using the function cut). Termination for MTAPN due to the monotonicity lemma.

12 / 26

slide-52
SLIDE 52

Compare Decidability of Soundness with Reachability

Notice that for the subclass of monotonic timed-arc Petri nets reachability is undecidable [Ruiz, Gomez, Escrig’99], but soundness is decidable.

13 / 26

slide-53
SLIDE 53

Compare Decidability of Soundness with Reachability

Notice that for the subclass of monotonic timed-arc Petri nets reachability is undecidable [Ruiz, Gomez, Escrig’99], but soundness is decidable. Question Is soundness always sufficient for timed workflows?

13 / 26

slide-54
SLIDE 54

Customer Complaint Workflow

in

  • ut

start req info provide info decision

Sound workflow, no timing information, no progress.

14 / 26

slide-55
SLIDE 55

Customer Complaint Workflow

in inv ≤ 14

  • ut

inv ≤ 14 start req info provide info decision

Progress is ensured, infinite time-divergent behaviour.

14 / 26

slide-56
SLIDE 56

Customer Complaint Workflow

in inv ≤ 14

  • ut

inv ≤ 14 start req info provide info decision

Strongly sound workflow with time-bounded execution.

14 / 26

slide-57
SLIDE 57

Strong Soundness

Definition A timed-arc workflow net is strongly sound if it is sound, has no time-divergent markings (except for the final ones), and every infinite computation is time-bounded. We can define maximum execution time for strongly sound nets.

15 / 26

slide-58
SLIDE 58

Strong Soundness

Definition A timed-arc workflow net is strongly sound if it is sound, has no time-divergent markings (except for the final ones), and every infinite computation is time-bounded. We can define maximum execution time for strongly sound nets. Theorem Strong soundness of timed-arc workflow nets is undecidable. Theorem Strong soundness of bounded timed-arc workflow nets is decidable. Proof: By reduction to reachability on timed-arc Petri nets.

15 / 26

slide-59
SLIDE 59

Decidability of Strong Soundness (Proof Sketch)

Perform normal soundness check and remember the size S of its state-space (in the extrapolated semantics). Let B be the maximum possible delay in any marking. Check if the given workflow net can delay more than U = S · B + 1 time units before reaching a final marking.

If yes, it is not strongly sound. If no, it is strongly sound.

in

  • ut

timer inv: ≤ U late nok workflow net N tick [U,U]

  • k

ups

16 / 26

slide-60
SLIDE 60

Implementation and Experiments

All algorithms implemented within TAPAAL (www.tapaal.net). Publicly available and open-source. Graphical editor with components, visual simulator. Efficient engine implementation (including further

  • ptimizations).

Case studies: Break System Control Unit, a part of the SAE standard ARP4761 (certification of civil aircrafts). MPEG-2 encoding algorithm on multi-core processors. Blood transfusion workflow, a larger benchmarking case-study described in little-JIL workflow language. Home automation system for light control in a family house with 16 lights/25 buttons, motion sensors and alarm.

17 / 26

slide-61
SLIDE 61

TAPAAL Verification of Break System Control Unit

18 / 26

slide-62
SLIDE 62

TAPAAL Verification of Break System Control Unit

18 / 26

slide-63
SLIDE 63

Recent TAPAAL Development

TAPAAL is being continuously improved and extended (MPEG-2 workflow analysis with two B-frames took 10s last year, now it takes only 1.4s). Memory preserving data structure PTrie.

MPEG-2 with three B-frames

soundness strong soundness no PTrie 33s / 1071MB 30s / 970MB PTrie 42s / 276MB 45s / 191MB Approximate analysis (smaller constants, less precision). Compositional, resource-aware analysis.

19 / 26

slide-64
SLIDE 64

Future TAPAAL Development

Resources with quantitative aspects (cost, energy). Two player timed workflow games (also with stochastic

  • pponent).

Integration with UPPAAL Stratego. Workflow analysis in the continuous time semantics.

20 / 26

slide-65
SLIDE 65

Continuous Semantics vs. Discrete Semantics

Theorem (For Closed TAPNs) Let M0 be a marking with integer ages only. If M0

d0,t0

− → M1

d1,t1

− → M2

d2,t2

− → . . .

dn−1,tn−1

− → Mn where di ∈ R≥0 then also M0

d′

0,t0

− → M′

1 d′

1,t1

− → M′

2 d′

2,t2

− → . . .

d′

n−1,tn−1

− → M′

n

where d′

i ∈ N0.

We construct a set of linear inequalities that describe all possible delays allowed in the real-time execution. We only need difference constraints, hence the corresponding matrix in LP is totally unimodular. As the instance of LP has a real solution, it has also an

  • ptimal integral solution.

21 / 26

slide-66
SLIDE 66

Continuous Semantics Implies Discrete Semantics

Theorem If a timed-arc workflow net is sound in the continuous semantics then it is also sound in the discrete semantics. Proof: Let N be sound in the continuous semantics. Let M be a marking reachable from the initial marking Min in the discrete semantics. Hence some final marking Mout is reachable from M in the continuous semantics. We can conclude using the theorem that a marking M′

  • ut with

the same distribution of tokens as Mout is reachable from M also in the discrete semantics.

22 / 26

slide-67
SLIDE 67

Discrete Semantics Implies Continuous Semantics

Theorem If a timed-arc workflow net with no age invariants and no urgent transitions is sound in the discrete semantics then it is sound also in the continuous semantics. Proof: We can arbitrarily delay in any marking. Hence the token ages exceed the maximum constants. Now there is no difference between discrete and continuous semantics.

23 / 26

slide-68
SLIDE 68

Discrete Semantics Implies Continuous Semantics

Theorem If a timed-arc workflow net with no age invariants and no urgent transitions is sound in the discrete semantics then it is sound also in the continuous semantics. Proof: We can arbitrarily delay in any marking. Hence the token ages exceed the maximum constants. Now there is no difference between discrete and continuous semantics. The theorem does not hold for general timed-arc workflow nets.

23 / 26

slide-69
SLIDE 69

Continuous Semantics Challenge

in

  • ut

waiting deadline inv: ≤ 1 finished init service late early [0, 0] [1, 1]

Sound in discrete semantics but unsound in continuous semantics.

24 / 26

slide-70
SLIDE 70

Continuous Semantics Challenge

in

  • ut

waiting deadline inv: ≤ 1 finished init service late early [0, 0] [1, 1]

Sound in discrete semantics but unsound in continuous semantics.

24 / 26

slide-71
SLIDE 71

Continuous Semantics Challenge

in

  • ut

0.5 waiting 0.5 deadline inv: ≤ 1 finished init service late early [0, 0] [1, 1]

Sound in discrete semantics but unsound in continuous semantics.

24 / 26

slide-72
SLIDE 72

Continuous Semantics Challenge

in

  • ut

waiting 0.5 deadline inv: ≤ 1 finished init service late early [0, 0] [1, 1]

Sound in discrete semantics but unsound in continuous semantics.

24 / 26

slide-73
SLIDE 73

Continuous Semantics Challenge

in

  • ut

waiting 1 deadline inv: ≤ 1 0.5 finished init service late early [0, 0] [1, 1]

Sound in discrete semantics but unsound in continuous semantics.

24 / 26

slide-74
SLIDE 74

Continuous Semantics Summary

Continuous soundness implies discrete soundness. Opposite implication holds only for nets without urgency. Strong soundness is not an issue.

25 / 26

slide-75
SLIDE 75

Continuous Semantics Summary

Continuous soundness implies discrete soundness. Opposite implication holds only for nets without urgency. Strong soundness is not an issue. Theorem Let N be a workflow net is sound in the continuous-time semantics. The net N is strongly sound in the discrete-time semantics iff it is strongly sound in the continuous-time semantics.

25 / 26

slide-76
SLIDE 76

Conclusion

Framework for the study of timed-arc workflow nets. Undecidability of soundness and strong soundness. Efficient algorithms for the decidable subclasses. Relationship to continuous soundness. Integration into the tool TAPAAL.

26 / 26

slide-77
SLIDE 77

Conclusion

Framework for the study of timed-arc workflow nets. Undecidability of soundness and strong soundness. Efficient algorithms for the decidable subclasses. Relationship to continuous soundness. Integration into the tool TAPAAL.

www.tapaal.net

Trophies for the “Surprise” Models

Silver medal at Model Checking Contest 2014 and 2015. (reachability category)

26 / 26