230 likes | 355 Views
On the Semantics of Matching Trace Monitoring Patterns. P Avgustinov, J Tibble, O Moor (Programming Tool Group, Oxford, UK) June 29 th, 2007 Presented by Shin Hong at PSWLAB, KAIST. Contents. Introduction Exact-matching Semantics Skipping Semantics
E N D
On the Semantics of Matching Trace Monitoring Patterns P Avgustinov, J Tibble, O Moor (Programming Tool Group, Oxford, UK) June 29th, 2007 Presented by Shin Hong at PSWLAB, KAIST On the Semantics of Matching Trace Monitoring Patterns Hong,Shin@PSWLAB
Contents • Introduction • Exact-matching Semantics • Skipping Semantics • The equivalence of two semantics • Conclusion On the Semantics of Matching Trace Monitoring Patterns
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 specifications Regular expression, context-free language, temporal logic, query language, etc. On the Semantics of Matching Trace Monitoring Patterns
Introduction (2/2) • The styles of the specification languages’ semantics are different • Exact-matching semantics • Skipping semantics for example, AB means in exact-matching, A and next B. in skipping, A and eventually B. • Define a small skipping language with the skipping semantics explore its expressiveness. On the Semantics of Matching Trace Monitoring Patterns
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 (Lskipwith modified Kleene star) • Conclusion On the Semantics of Matching Trace Monitoring Patterns
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. On the Semantics of Matching Trace Monitoring Patterns
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 On the Semantics of Matching Trace Monitoring Patterns
Exact-matching Semantics (3/3) • Syntax of Tracematches Exact-matching Language Lem pattern := term | seqPattern ‘|’ pattern term := simplePattern | simplePattern term | simplePattern ‘*’ simplePattern := symbol | ‘(‘ pattern ’)’ On the Semantics of Matching Trace Monitoring Patterns
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. On the Semantics of Matching Trace Monitoring Patterns
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 On the Semantics of Matching Trace Monitoring Patterns
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 On the Semantics of Matching Trace Monitoring Patterns
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) On the Semantics of Matching Trace Monitoring Patterns
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‘)’ On the Semantics of Matching Trace Monitoring Patterns
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 On the Semantics of Matching Trace Monitoring Patterns
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 (Lskipwith modified Kleene star) • Conclusion On the Semantics of Matching Trace Monitoring Patterns
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 On the Semantics of Matching Trace Monitoring Patterns
The equivalence of two semantics(2/5) Σ = {A, B, C} ABskip A(A|B|C)*Bem A~BAskip A(A|C)*Aem On the Semantics of Matching Trace Monitoring Patterns
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] symbol On the Semantics of Matching Trace Monitoring Patterns
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]@Σ On the Semantics of Matching Trace Monitoring Patterns
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 On the Semantics of Matching Trace Monitoring Patterns
Conclusion -A skipping language with modified Kleene closure and exact-matching language have the same expressive power. On the Semantics of Matching Trace Monitoring Patterns
Conclusion On the Semantics of Matching Trace Monitoring Patterns
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 On the Semantics of Matching Trace Monitoring Patterns