26hong,shin @ pswlab on the semantics of matching trace monitoring patterns p avgustinov, j tibble,...
TRANSCRIPT
/ 26Hong,Shin @ PSWLAB
On the Semantics of Matching Trace Monitoring Patterns
P Avgustinov, J Tibble, O Moor(Programming Tool Group, Oxford, UK)
June 29th, 2007Presented by Shin Hong at PSWLAB, KAIST
23年 4月 21日
1On the Semantics of Matching Trace Monitoring Patterns Hong,Shin@PSWLAB
/ 26Hong,Shin @ PSWLAB
Contents
• Introduction
• Exact-matching Semantics
• Skipping Semantics
• The equivalence of two semantics
• Conclusion
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 2
/ 26Hong,Shin @ PSWLAB
Introduction (1/2)• A trace monitor observes a base
program’s execution and check whether it is valid or not.
• A trace specification specifies a valid trace pattern.
• There is wide variety of the specification languages for describing trace specificationsRegular expression, context-free language, temporal
logic, query language, etc.
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 3
/ 26Hong,Shin @ PSWLAB
Introduction (2/2)• The styles of the specification
languages’ semantics are different– Exact-matching semantics– Skipping semantics
for example, AB meansin exact-matching, A and next B.
in skipping, A and eventually B.
• Define a small skipping language with the skipping semantics explore its expressiveness.
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 4
/ 26Hong,Shin @ PSWLAB
Contents• Introduction• Exact-matching Semantics
- Regular expression in tracematches, Lem
• Skipping Semantics- A small skipping language, Lskip
• The equivalence of two semantics- L(Lskip ) ⊂ L(Lem)
- L(Lem) ⊇L (Lskip with modified Kleene star)
• Conclusion
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 5
/ 26Hong,Shin @ PSWLAB
Exact-matching Semantics (1/3)• Many systems with an AOP background
employ exact-matching semantics.
• Every symbol in an input word must be accounted for by the pattern.
• Tracematches employs this semantics.
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 6
/ 26Hong,Shin @ PSWLAB
Exact-matching Semantics (2/3)tracematch(Observer o, Subject s) { sym createObserver after: pcCreateObserver(o,s) ; sym updateSubejct after: pcUpdateSubject(s) ; sym removeObserver after: pcRemoveObserver(o,s); createObserver updateSubject+ {o.subjectUpdate();}}---------------------------------------------------------------Observer {… void addSubject(Subject s) { … <pcCreateObserver>} void eraseSubject(Subject s) { … <pcRemoveObserver>} void subjectUpdate(Subject s) {… }…}Subject {… void changeValue() { … <pcUpdateSubject>} …}----------------------------------------------------------------------
createObserver updateSubject updateSubject removeObserver
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 7
/ 26Hong,Shin @ PSWLAB
Exact-matching Semantics (3/3)• Syntax of Tracematches Exact-matching Language
Lem
pattern := term | seqPattern ‘|’ pattern
term := simplePattern | simplePattern term
|
simplePattern ‘*’
simplePattern := symbol | ‘(‘ pattern ’)’
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 8
/ 26Hong,Shin @ PSWLAB
Skipping Semantics (1/6)• Many systems with an RV background
employ skipping semantics.
• The languages with skipping semantics specify events that happen one after the other, with any events allowed in between.
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 9
/ 26Hong,Shin @ PSWLAB
Skipping Semantics (2/6)ReqSpec Sample
import event a, w, x, y, z ;
import condition night ;
var happenA, count ;
alarm 3a = a when happenA==3 ;
a -> { happenA’ = happenA + 1 ; }
b -> { happenA’ = 0 ; }
property 10wxyz = count < 10 ;
event wxyz = (y||z when [w,x)) ||
(z when [w, end([x,y)))) when night
wxyz -> {count’ = count+1;}
End
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 10
/ 26Hong,Shin @ PSWLAB
Skipping Semantics (3/6)
A simple skipping language Lskip
– Similar with Lem
– Explicit negation
~A : any numbers of symbols that are not
A.
– Does not have Kleene star operator
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 11
/ 26Hong,Shin @ PSWLAB
Skipping Semantics (4/6)• For example
AB ∈ L(AB + BC)ABB ∈ L(A B ~C B)ACABB ∈ L(A B ~C B)ACABCB ∉ L(A B ~C B)
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 12
/ 26Hong,Shin @ PSWLAB
Skipping Semantics (5/6)
• Syntax of patterns in Lskip
pattern := fencedTerm | fancedTerm ‘|’ pattern
fencedTerm := simplePattern|
simplePattern fencedTerm |
simplePattern ‘~’ symbolSet fencedTerm
simplePattern := symbol | ‘(‘ pattern ‘)’
symbolSet := symbol | ‘(‘symbol‘|’symbolSet‘)’
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 13
/ 26Hong,Shin @ PSWLAB
Skipping Semantics (6/6)
L(Lskip) ∋ A (B | C) A
L(Lskip) ∋ A ~(B | C) A
L(Lskip) ∌ A ~B ~C A
L(Lskip) ∌ A ~(B C) A
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 14
/ 26Hong,Shin @ PSWLAB
Contents• Introduction• Exact-matching Semantics
- Regular expression in tracematches, Lem
• Skipping Semantics- A small skipping language, Lskip
• The equivalence of two semantics- L(Lskip ) ⊂ L(Lem)
- L(Lem) ⊇L (Lskip with modified Kleene star)
• Conclusion
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 15
/ 26Hong,Shin @ PSWLAB
The equivalence of two semantics(1/5)• Syntax-directed translation from Lskip to Lem
Let α ⊆ Σ
[fencedTerm | pattern] [fencedTerm]|[pattern]
[simplePattern fencedTerm]
[simplePattern] Σ* [fencedTerm]
[simplePattern ~α fencedTerm]
[simplePattern] (Σ\α)* [fencedTerm]
[symbol] symbol
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 16
/ 26Hong,Shin @ PSWLAB
The equivalence of two semantics(2/5)Σ = {A, B, C}
ABskip A(A|B|C)*Bem
A~BAskip A(A|C)*Aem
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 17
/ 26Hong,Shin @ PSWLAB
The equivalence of two semantics(3/5)• Translation from a fragment of Lem to
Lskip
Let α⊆ Σ
[term | pattern] [term] | [pattern]
[simplePattern term][simplePattern] ~Σ [term]
[simplePattern α* term]
[simplePattern] ~(Σ\α)
[term]
[symbol] symbol23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 18
/ 26Hong,Shin @ PSWLAB
The equivalence of two semantics(4/5)• Skipping Language with modified Kleene closure
t@α ≡ t | t ~α t@α
prohibiting all events in α between repetitions of t
<Lskip Lem >
[term@α] ([term] (Σ\α)*)* [term]<Lem Lskip >
[term+] [term]@Σ
[term term*] [term]|[term]@Σ
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 19
/ 26Hong,Shin @ PSWLAB
The equivalence of two semantics(5/5)A(BC)*em
( A | A(B ~Σ C)@Σ )skip
( A| A((B {}* C){}*)*)em
(A | A(B C)*)em
A | A(BC)* em A(BC)*em
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 20
/ 26Hong,Shin @ PSWLAB
Conclusion-A skipping language with modified Kleene
closure and exact-matching language have the same expressive power.
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 21
/ 26Hong,Shin @ PSWLAB
Conclusion
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 22
/ 26Hong,Shin @ PSWLAB
References[1] On the Semantics of Matching Trace
Monitoring Patterns, Oege de Moor et al[2] Liveness Checking as Safety Checking to
Find Shortest Counterexamples to Linear Time Properties, Viktor Schuppan
[3] Adding Trace Matching with Free Variables to AspectJ, Chris Allan et al
23年 4月 21日
On the Semantics of Matching Trace Monitoring Patterns 23