Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Ā
Property Specifications for Workflow Modelling
1. 01
Property Speciļ¬cations for
Workļ¬ow Modelling
Peter Wong, University of Oxford, UK
(Joint work with Jeremy Gibbons)
February 2009
2. 02
Overview
ā¢ Process Semantics for BPMN in CSP (ICFEM08, QSIC08)
ā¢ Augmented with relative timing information (FOCLASA08)
ā¢ BPMN is not a speciļ¬cation language
ā¢ Consider a generalisation of Dwyer et al.ās Property
Speciļ¬cation Patterns (PSP)
ā¢ Deļ¬ne a language PL to capture generalised PSP
ā¢ Translate into Loweās Bounded, Positive fragment of LTL (BTL)
ā¢ Translate BTL into CSP for reļ¬nement checks (FDR)
see: Example
3. 03
Problems
BPMN...
ā¢ describes the performance of behaviour
ā¢ diļ¬cult to describe refusal of behaviour in a context while
allowing its availability outside that context
Example requirement should also permit behaviour such as
Request Cancel before Book Seat!
see: Example
4. 04
Content
ā¢ Property Speciļ¬cation Patterns (PSP)
ā¢ Generalised PSP
ā¢ Our Approach
ā¢ Bounded Positive fragment of LTL (BTL)
ā¢ Refusal Traces Model and Semantics of BTL
ā¢ A Property Speciļ¬cation Language PL
ā Patterns of Behaviour
ā Property Speciļ¬cation
ā¢ Revisiting the Example
5. 05
Property Speciļ¬cation Patterns
PSPs describe the structure of commonly occurring requirements on
the permissible patterns of behaviour in ļ¬nite states systems
Here we only consider occurrence patterns.
6. 06
Occurrence Patterns
ā¢ Absence ā A given event does not occur within a scope
ā¢ Universality ā A given event occurs at all times within a scope
ā¢ Existence ā A given event occurs at least once within a scope
ā¢ Bounded Existence ā A given event occurs a bounded number of
times within a scope
7. 07
Scopes
ā¢ Always ā throughout all possible executions
ā¢ Before p ā before the occurrence of the event p
ā¢ After q ā after the occurrence of the event q
ā¢ Between p and q ā between the occurrence of the events p and q
ā¢ After p until q ā after the occurrence of the event p until q, but
q need not happen
8. 08
Issue
ā¢ Patterns have been expressed in a range of formalisms
(LTL,CTL...) but not for reļ¬nement setting (CSP).
ā¢ We provide a generalisation of the patterns in process-algebraic
settings
For example: The parallel execution of task A and either task D or
task E cannot happen after task B and before task C
9. 09
Occurrence Patterns (generalised)
ā¢ Absence ā A given pattern of behaviour does not occur within a
scope
ā¢ Universality ā A given pattern of behaviour occurs at all times
within a scope
ā¢ Existence ā A given pattern of behaviour occurs at least once
within a scope
ā¢ Bounded Existence ā A given pattern of behaviour occurs a
bounded number of times within a scope
10. 10
Scopes (generalised)
ā¢ Always ā throughout all possible executions
ā¢ Before p ā before the occurrence of the pattern of behaviour p
ā¢ After q ā after the occurrence of the pattern of behaviour q
ā¢ Between p and q ā between the occurrence of the patterns of
behaviour p and q
ā¢ After p until q ā after the occurrence of the pattern of behaviour
p until q, but q need not happen
11. 11
Our Approach
ā¢ Deļ¬ne a small property speciļ¬cation language PL to capture
generalised PSP
ā¢ Translate from PL to bounded, positive fragment of LTL (BTL)
ā¢ BTL can be automatically translated into CSP for simple
reļ¬nement checks
12. 12
Content
ā
ā¢ Property Speciļ¬cation Patterns (PSP)
ā
ā¢ Generalised PSP
ā
ā¢ Our Approach
ā ā¢ Bounded Positive fragment of LTL (BTL)
ā¢ Refusal Traces Model and Semantics of BTL
ā¢ A Property Speciļ¬cation Language PL
ā¢ Patterns of Behaviour
ā¢ Property Speciļ¬cation
ā¢ Revisiting the Example
13. 13
Bounded, Positive Fragment of LTL (BTL)
The grammar of BTL (for all a ā Ī£)
e, f ā BTL ::= e ā§ f | e āØ f | e | Pe | e R f | a | Ā¬a |
available a | true | false | live | deadlocked
ā¢ a ā the event a is available to be performed initially, and no
other events may be performed;
ā¢ available a ā the event a must not be refused initially, and
other events may be performed;
ā¢ live and deadlock ā the system is live (equivalent to a)
aāĪ£
or deadlocked (equivalent to aāĪ£ Ā¬a), respectively;
ā¢ true and false ā logical formulae with their normal meanings.
N.B. Does not capture eventually ( ) and until (U) and negation (Ā¬).
14. 14
Semantics of BTL for Reļ¬nement Checks
ā¢ Stable Failures is not suitable
ā¢ Requires a ļ¬ner model ā Refusal Traces RT [Mukarram 93]
ā¢ P |= e where e is a BTL expression, if and only if
Spec(e) RT P where Spec(e) is the CSP speciļ¬cation for e.
A refusal trace is an alternating sequence of refusal information and
events, of the form
X 1, a1, X 2, a2, . ., Xn, an, Ī£
where each Xi is a refusal set, and each ai is an event: this represents
that the process can refuse X 1, perform a1, refuse X 2, perform a2,
etc.
see: Failures and Eventually
15. 15
Content
ā
ā¢ Property Speciļ¬cation Patterns (PSP)
ā
ā¢ Generalised PSP
ā
ā¢ Our Approach
ā
ā¢ Bounded Positive fragment of LTL (BTL)
ā
ā¢ Refusal Traces Model and Semantics of BTL
ā ā¢ A Property Speciļ¬cation Language PL
ā¢ Patterns of Behaviour
ā¢ Property Speciļ¬cation
ā¢ Revisiting the Example
16. 16
Patterns of Behaviour
SPL ā A Sublanguage of PL
P ā SPL ::= P P |P P | a ā P | End where a ā AF
::= e | available e | live where e ā Ī£
AF
ā¢ speciļ¬es nondeterministic systems
ā¢ introduces the nondeterministic interleaving ( ) operator
ā¢ End has empty semantics ā RT SPL [[End ]] = ā
17. 17
Nondeterministic Interleaving
In CSP for any events a and b:
a ā Skip b ā Skip a ā Skip
RT
but not
a ā Skip ||| b ā Skip a ā b ā Skip
RT
Since
a ā Skip ||| b ā Skip ā” a ā b ā Skip P b ā a ā Skip
ā¢ Need an operator to specify concurrent behaviour without
determining their orders
ā¢ Especially useful when applying in our relative timed model of
BPMN.
18. 18
Nondeterministic Interleaving
The process P Q communicates events from both P and Q
nondeterministically.
If P = p ā P and Q = q ā Q then
Q = (p ā (P (q ā (P
P Q)) Q )) [ -step]
also:
End Q =Q [ -End]
Note is both commutative and associative and is deļ¬ned in terms
of and ā.
19. 19
From SPL to BTL
ā¢ translate SPL to BTLā inductively
pattern : SPL ā BTLā
ā¢ BTLā is BTL augmented with the atomic formula ā
(RT SPL [[End ]] = RT BTLā [[ ā ]] = ā )
ā¢ convert BTLā back to BTL, we simply remove ā according to the
following equivalences:
ĻāØāā”Ļ
āā§Ļā”Ļ
Ļā§ āā”Ļ
see: Formalising SPL in Temporal Logic
20. 20
Example
Given a pattern of behaviour (a ā End ) (b ā End ) we get the
following BTL expression Ļ = (a ā§ b) āØ (b ā§ a), which can be
automatically translated into CSP:
Spec = let
Spec0 = b ā Spec2
Spec1 = a ā Spec3
Spec2 = a ā Spec4
Spec3 = b ā Spec4
Spec4 = Stop ( x : Ī£ ā¢ x ā Spec4)
in Spec0 Spec1
Moreover,
a ā b ā Stop
Spec RT
a ā Stop ||| b ā Stop
Spec RT
21. 21
Content
ā
ā¢ Property Speciļ¬cation Patterns (PSP)
ā
ā¢ Generalised PSP
ā
ā¢ Our Approach
ā
ā¢ Bounded Positive fragment of LTL (BTL)
ā
ā¢ Refusal Traces Model and Semantics of BTL
ā ā¢ A Property Speciļ¬cation Language PL
ā
ā¢ Patterns of Behaviour
ā ā¢ Property Speciļ¬cation
ā¢ Revisiting the Example
22. 22
Property Speciļ¬cation Language ā PL
for all p ā SPL, n ā N1 , b ā Bound and s ā Scope
ā¢ Abs(p, s) ā absence of behaviour p in scope s
ā¢ Un(p, s) ā universality of behaviour p in scope s
ā¢ Ex(p, n, s) ā existence of behaviour p within subsequent n states
from the start of scope s
ā¢ BEx(p, b, s) ā existence of behaviour p with bound b in scope s
N.B. state is in the sense of a transition system of a CSP process
describing a BPMN diagram: a graph showing the states it can go
through and actions, each denoted by a single CSP event, that it
takes to get from one to another.
23. 23
Scopes
ā¢ always ā throughout all possible execution
ā¢ before(p, n) ā before behaviour p if p happens in nth state from
the start.
ā¢ after p ā after of behaviour p
ā¢ between p and (q, n) ā between behaviour p and q if q happens
in nth state after p
ā¢ from p until (q, n) ā after behaviour p and before q if q happens
(not necessary) in nth state after p
see: Bounded Existence
24. 24
Content
ā
ā¢ Property Speciļ¬cation Patterns (PSP)
ā
ā¢ Generalised PSP
ā
ā¢ Our Approach
ā
ā¢ Bounded Positive fragment of LTL (BTL)
ā
ā¢ Refusal Traces Model and Semantics of BTL
ā
ā¢ A Property Speciļ¬cation Language PL
ā
ā¢ Patterns of Behaviour
ā
ā¢ Property Speciļ¬cation
ā ā¢ Revisiting the Example
25. 25
Revisiting the Example
Use the absence pattern āthe absence of p between some behaviour q
and r ā
Abs(Cancel , between bookseat ā End and(sendinvoice ā End , 2))
where the pattern of behaviour Cancel is deļ¬ned as follows:
Cancel = requestcancel ā End reservetimeout ā End
See if the diagram satisļ¬es this property by checking the following
refusal traces reļ¬nement assertion using the FDR tool.
Agent N
Spec RT
where N = Ī£ { bookseat, requestcancel , reservetimeout, sendinvoice }
see: Travel Agent, Requirement and Spec
26. 26
Summary
ā¢ Generalised PSP to specify patterns of behaviour
ā¢ Deļ¬ned PL to capture the generalised PSP
ā¢ Translated PL into BTL
ā¢ Implemented a prototype in Haskell
27. 27
Thank You
Web site: http://www.comlab.ox.ac.uk/peter.wong/
Email: peter.wong@comlab.ox.ac.uk
33. 33
14 Semantics of BTL for Reļ¬nement Checks
15 Content
16 Patterns of Behaviour
17 Nondeterministic Interleaving
18 Nondeterministic Interleaving
19 From SPL to BTL
20 Example
21 Content
22 Property Speciļ¬cation Language ā PL
23 Scopes
24 Content
25 Revisiting the Example
26 Summary
34. 34
28 Summary
29 Index
30 CSP
31 CSP
32 CSP
33 CSP
34 Travel Agent
35 Requirement
36 Requirement
37 Unsuitability of the stable failures
Impossibility of eventually , U and negation
38
39 Formalising SPL in Temporal logic
40 Formalising SPL in Temporal logic
35. 35
41 Bounded Existence ā Preliminaries
42 Bounded Existence
43 Bounded Existence
44 Example ā āThe bounded existence of p after qā
45 Corresponding CSP speciļ¬cation...
36. 36
CSP
The grammar of CSP.
P , Q ::= P ||| Q | P |[ A ]| Q | P Q | P A | P Q|
P Q | P P Q | P o Q | e ā P | Skip | Stop
9
ā¢ Skip, Stop - termination, deadlock;.
ā¢ e ā P - preļ¬xing;
ā¢ P o Q - sequential composition.
9
37. 37
CSP
The grammar of CSP.
P , Q ::= P ||| Q | P |[ A ]| Q | P Q | P A | P Q|
P Q | P P Q | P o Q | e ā P | Skip | Stop
9
ā¢ P ||| Q - interleaving;
ā¢ P |[ A ]| Q - partial interleaving;
ā¢P Q - parallel composition.
38. 38
CSP
The grammar of CSP.
P , Q ::= P ||| Q | P |[ A ]| Q | P Q | P A | P Q|
P Q | P P Q | P o Q | e ā P | Skip | Stop
9
ā¢ P A - hiding;
ā¢P Q - interrupt;
ā¢ P P Q - external choice.
ā¢P Q - internal choice.
39. 39
CSP
The grammar of CSP.
P , Q ::= P ||| Q | P |[ A ]| Q | P Q | P A | P Q|
P Q | P P Q | P o Q | e ā P | Skip | Stop
9
ā¢ We write P i : { 1 . . n } ā¢ P (i ) to denote P (1) P . . P P (n),
similarly for operators , ||| and ;
ā¢ Our semantic deļ¬nition uses Stable Failures F;
ā¢ Formal veriļ¬cation via reļ¬nement checks;
ā¢ FDR - automated CSP model checker.
41. 41
Requirement
Property : Agent must not allow cancellation after booking if invoice
is to be sent.
see: Introduction, Problems and Revisit
42. 42
Requirement
Property : Agent must not allow cancellation after booking if invoice
is to be sent.
Try checking this: Agent N Requirement ?
F
see: Introduction and Problems
43. 43
Unsuitability of the stable failures
F[[available a]] = { ( , X ) | a ā X } āŖ { (tr , X ) | tr = ā§ X ā PĪ£}
/
F[[ available a]] =
{ ( b , X ) | b ā Ī£ ā§ a ā X } āŖ { (tr , X ) | #tr = 1 ā§ X ā P Ī£ }
/
F[[available a āØ available a]] =
F[[available a]] āŖ F[[ available a]] =
{ (tr , X ) | tr ā Ī£ā ā§ X ā P }
i.e. available a āØ available a is satisļ¬ed by every process!
see: Semantics of BTL
44. 44
Impossibility of eventually , U and negation
Suppose P |= a if and only if Spec RT P where Spec is the CSP
speciļ¬cation for a. Spec would have the refusal trace
Ī£ {b}, b n ā¢, a for all n. However RT is preļ¬xed-closed
therefore it would also have the refusal trace Ī£ {b}, b n for all n
and this is satisļ¬ed by the process P = b ā P !
Also since Ļ = true U Ļ and Ļ = Ā¬(PĀ¬Ļ)
see: Semantics of BTL
45. 45
Formalising SPL in Temporal logic
ā¢ translate SPL to BTLā
ā¢ convert BTLā back to BTL
SPL to BTLā
pattern(End ) = ā
pattern(a ā P ) = atom(a) ā§ (pattern P )
pattern(P Q) = pattern(P ) āØ pattern(Q)
pattern(P Q) = pattern(npar (P , Q))
where
atom(available t) = available (event(t))
atom(live) = live
atom(t) = event(t)
see: SPL
46. 46
Formalising SPL in Temporal logic
npar (End , End ) = End
npar (End , Q) = Q
npar (P , End ) = P
npar (P , Q) = ( (a, X ) : initials(P ) ā¢ a ā npar (X , Q))
( (a, X ) : initials(Q) ā¢ a ā npar (X , P ))
where i : I ā¢ P (i ) denotes the nondeterministic choice of a set of
indexed terms P (i ) where i ranges over I .
initials(P Q) = initials(P ) āŖ initials(Q)
initials(P Q) = initials(npar (P , Q))
initials(a ā P ) = { (a, P ) }
initials(End ) = ā
see: SPL
47. 47
Bounded Existence ā Preliminaries
We extend BTL to BTLĪ“ to include two new operators Ā” and U
Ā£
such that:
Ļ Un Ļ = ( nextsiāstates(Ļ) (Ļ āØ Ļ)) ā§ nexts(nā1)āstates(Ļ) Ļ
iā{ 0..nā2 }
where
ā¢ states(Ļ) returns one minus the furthest state the expression Ļ
i
ā¢ nextsi Ļ = Ļ for i ā N
n
ā¢ nextĻ Ļ = Ļ where n = states(Ļ)
Note : Ā” n Ļ = true U n Ļ
Ā£
48. 48
Bounded Existence
ā¢ The global existence p with bound b ā bound (p, false, b);
ā¢ The existence of p with bound b before some behaviour q ā
Ā” n q ā Ā¬q U nāgetbound(b)āstates(p) bound (p, q, b)
Ā£
ā¢ The existence of p with bound b after some behaviour q ā
P(q ā nextq (bound (p, q, b)))
ā¢ The existence of p with bound b between behaviour q and r ā
P(q ā
(nextq Ā” n r ā (bound (p, r , b) ā§ bound (p, r , b) R Ā¬r ā§ r R Ā¬q)))
Ā£
where n > getbound (b) ā states(p)
ā¢ The existence of p after behaviour q until r ā
P(q ā (nextq Ā¬r U 1 bound (p, r āØ q, b)))
49. 49
Bounded Existence
bound (p, q, b) is deļ¬ned as follows :
ā¢ (= n) ā p) ā§ nextsnāstates(p) (q R Ā¬p)
iā{ 0..nā1 } (nextsiāstates(p)
ā¢ (ā„ n) ā iā{ 0..nā1 } (nextsiāstates(p) p)
ā¢ (ā¤ n) ā nextsnāstates(p) (q R Ā¬p)
and getbound (b) for some bound b denotes the number part of the
value.
50. 50
Example ā āThe bounded existence of p after qā
Property ā Either task A or C has to occur followed by either one of
them again after Task B has occurred.
Spec = let
Spec0 = Proceed ({ b }, Spec0 Spec1)
Spec1 = b ā (Spec2 Spec3)
Spec2 = c ā (Spec4 Spec5)
Spec3 = a ā (Spec4 Spec5)
Spec4 = c ā (Spec6 Spec7)
Spec5 = a ā (Spec6 Spec7)
Spec6 = Proceed ({ a, b, c }, Spec6 Spec7)
Spec7 = b ā (Spec2 Spec3)
in Spec0 Spec1
( x : Ī£ X ā¢ x ā P)
where Proceed (X , P ) = Stop Skip