timed pattern matching
play

Timed Pattern Matching Doan Ulus joint with T. Ferrere, E. Asarin, - PowerPoint PPT Presentation

Timed Pattern Matching Doan Ulus joint with T. Ferrere, E. Asarin, O. Maler and D. Nickovic Verimag, University of Grenoble-Alpes May 6, 2015 Real-time systems 2 Control Systems with Real-time Communication timing systems Biological


  1. Timed Pattern Matching Doğan Ulus joint with T. Ferrere, E. Asarin, O. Maler and D. Nickovic Verimag, University of Grenoble-Alpes May 6, 2015

  2. Real-time systems 2 Control Systems with Real-time Communication timing systems Biological . . . constraints They are complex + Extremely large (or infinite) state-spaces + Functional equivalence between abstractions is an exception. Verification of real-time systems + Simulation -based techniques to reason about correctness/performance + Only some segments of simulation behaviors are interesting.

  3. Pattern Matching 3 Example Find for "was" or "were" in the text Regex Pattern w ( as + ere ) It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to Heaven, we were all going direct the other way - in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only.

  4. Our intention 4 Consider a simulation behavior including some pulses. Assume long pulses are interesting. y ( t ) t

  5. Our intention 4 Consider a simulation behavior including some pulses. Assume long pulses are interesting. y ( t ) t We would like to + Locate all interesting segments in a formal way.

  6. Our intention 4 Consider a simulation behavior including some pulses. Assume long pulses are interesting. y ( t ) t We would like to + Locate all interesting segments in a formal way. How? + Abstract behaviors in timed level + Specify patterns using timed regular expressions + Perform timed pattern matching

  7. Outline 5 + A Long Introduction + Timed level of abstraction + Why not real-time logics? + Path to timed regular expressions + Theory and Practice + Definitions + Algorithms + Implementation

  8. Timed Level of Abstraction 6 + Discrete values + Metric Time w 0 : + States as primitive timed w 1 : entities t Visual representation for timed state sequences (signals)

  9. Timed Level of Abstraction 6 + Discrete values + Metric Time w 0 : + States as primitive timed w 1 : entities t Visual representation for timed state sequences (signals) + Timed patterns are meaningful compositions of timed states. duration + Certain patterns are caused by design or by nature. t A timed pattern

  10. Flow 7 i o n a t u l m i S Real-time Behaviors System Deeper reality Abstraction Timed level Signals

  11. Flow 7 i o n a t u l m i S Real-time Behaviors System Deeper reality Abstraction Timed level Timed Matches Signals Signals Pattern (Locations Matching in time) Timed Regular Expressions Our extent

  12. Flow 7 i o n a t u l m i S Real-time Interesting Behaviors System Behaviors More analysis Deeper reality Abstraction Timed level Timed Matches Signals Signals Pattern (Locations More analysis Matching in time) Timed Regular Expressions Our extent

  13. Flow 7 i o n a t u l m i S Real-time Interesting Behaviors System Behaviors More analysis Deeper reality Abstraction Timed level Timed Matches Signals Signals Pattern (Locations More analysis Matching in time) Timed Regular Expressions Our extent + We use TRE as a timed specification language. Why not real-time logics?

  14. Real-time logics 8 + Real-time logics (e.g. MTL) used to specify timed properties + Until operator (of LTL) enhanced as U I for time-bounded sequential reasoning. ( w , t ) � ψ 1 U [ a , b ] ψ 2 ↔ ∃ t ′ ∈ [ t + a , t + b ] . ( w , t ′ ) � ψ 2 and ∀ t ′′ ∈ [ t , t ′ ] . ( w , t ′′ ) � ψ 1 B p q p U [ 3 , 5 ] q t 0 1 2 3 4 5 6 7 8 9 10 11 12 13

  15. Pulse Example 9 + Consider a pulse.  Inc if ˙ y ( t ) > d �  High if y ( t ) > c h + Pulse spec in English:  w 0 ( t ) = w 1 ( t ) = Dec if ˙ y ( t ) < - d Low if y ( t ) < c l  Flat if otherwise  When low, increase until high and flat more than 0.5 time units then decrease y ( t ) until low + In MTL: ψ = ( Low ∧ Inc ) U ( Inc U ( High ∧ Flat ) w 0 : High Low Low U ≥ 0 . 5 ( Dec w 1 : Flat Inc Flat Dec Flat U ( Dec ∧ Low )))) t + In TRE: ϕ := ( Low ∧ Inc ) · Inc · � High ∧ Flat � ≥ 0 . 5 · Dec · ( Dec ∧ Low )

  16. Comparison 1 - Intuitiveness 10 Adding additional constraint over total duration will result: + In MTL: ψ ′ = ( Low ∧ Inc ) (( Low ∧ Inc ) U ( Inc ∨ Inc U ( High ∧ Flat ) ∧ ∨ ( High ∧ Flat ) U ≥ 0 . 5 ( Dec ∨ Dec ) U ( Dec ∧ Low )))) U [ 2 , 5 ] ( Dec ∧ Low ) + In TRE: ϕ ′ := � ( Low ∧ Inc ) · Inc ·� High ∧ Flat � ≥ 0 . 5 · Dec · ( Dec ∧ Low ) � [ 2 , 5 ]

  17. Comparison 2 - Expressiveness 11 Everyday patterns We can express in Sequential composition y ( t ) MTL and TRE (Pulse) t y ( t ) y ( t ) Alternation OR MTL and TRE (2nd order response) t t y ( t ) y ( t ) Parallel composition AND MTL and TRE (Switching capacitors) t t Repetition y ( t ) only TRE (Modulated pulse) t

  18. Comparison 3 - Semantics 12 + MTL semantics is over time-points , monitoring gives only beginnings. + TRE semantics is over time-segments , monitoring gives all beginnings, endings and durations. End w 0 : Low High Low w 1 : Flat Inc Flat Dec Flat t Begin Begin χ ( ψ, w ) M ( ϕ, w )

  19. Timed regular expressions 13 ϕ := ǫ | p | p | ϕ · ϕ | ϕ ∨ ϕ | ϕ ∧ ϕ | ϕ ∗ | � ϕ � I p is a propositional variable, I is an interval ( w , t , t ′ ) ↔ t = t ′ � ǫ t < t ′ and ∀ t ′′ ∈ ( t , t ′ ) , p [ t ′′ ] = 1 ( w , t , t ′ ) ↔ � p ( w , t , t ′ ) � p ↔ . . . ∃ t ′′ ∈ ( t , t ′ ) , ( w , t , t ′′ ) � ϕ and ( w , t ′′ , t ′ ) � ψ ( w , t , t ′ ) � ϕ · ψ ↔ ( w , t , t ′ ) � ϕ ∨ ψ ↔ ( w , t , t ′ ) � ϕ or ( w , t , t ′ ) � ψ ( w , t , t ′ ) � ϕ ∧ ψ ↔ . . . ∃ k ≥ 0 , ( w , t , t ′ ) � ϕ k ( w , t , t ′ ) � ϕ ∗ ↔ t ′ − t ∈ I and ( w , t , t ′ ) � ϕ ( w , t , t ′ ) � � ϕ � I ↔

  20. Formal problem statement 14 Definition (Match-set) For a signal w and an expression ϕ the match-set is M ( ϕ, w ) := { ( t , t ′ ) | ( w , t , t ′ ) � ϕ } Problem (Timed pattern matching) Given a signal and an expression compute the match-set.

  21. Data structure 15 Mark ( t , t ′ ) if ( w , t , t ′ ) � ϕ . Better mark as zones. End End e ′ d ′ e t ′ d b b ′ Begin t Begin b ≤ t ≤ b ′ A match beginning at t e ≤ t ′ ≤ e ′ ending at t ′ . d ≤ t ′ − t ≤ d ′

  22. Main result 16 Theorem The match-set M ( ϕ, w ) is computable as a finite union of 2D zones.

  23. Base cases - Literals 17 p p p t A signal w Going 2D t ′ + When a segment of p satisfies, all sub-segments satisfy p . + Triangle zones t M ( p , w )

  24. Base cases - Duration constraints 18 p p t A signal w t ′ + Restricting duration M ( � ϕ � I , w ) = M ( ϕ, w ) ∩ { ( t , t ′ ) | t ′ − t ∈ I } t M ( � p � [ 1 , 2 ] , w )

  25. Base cases - Concatenation 19 + Concatenation is a composition of match sets. M ( ϕ · ψ ) = M ( ϕ ) ◦ M ( ψ ) ( t , t ′ ) ∈ M ( ϕ ) ◦M ( ψ ) ↔ ∃ t ′′ : ( t , t ′′ ) ∈ M ( ϕ ) ∧ ( t ′′ , t ′ ) ∈ M ( ψ ) + Can be obtained using standard zone operations. + Composition preserves zones and match sets � � � z ′ z i ◦ z ′ z i ◦ j = j i j ij + Most resulting zones are empty in practice. + Plane-sweep algorithm: sorting zones by start / end time allows to avoid most empty operations

  26. Overall Computation 20 ϕ := ( Low ∧ Inc ) · Inc · � High ∧ Flat � > 0 . 5 · Dec · ( Dec ∧ Low ) • ∧ • Low Inc Inc • �� > 0 . 5 • ∧ Dec ∧ High Flat Dec Low

  27. Matching Pulse Example 21 ϕ := ( Low ∧ Inc ) · Inc · � High ∧ Flat � ≥ 0 . 5 · Dec · ( Dec ∧ Low ) t ′ t High Low Low Flat Inc Flat Dec Flat t

  28. Matching Pulse Example 21 ϕ := ( Low ∧ Inc ) · Inc · � High ∧ Flat � ≥ 0 . 5 · Dec · ( Dec ∧ Low ) t ′ t High Low Low Flat Inc Flat Dec Flat t

  29. Matching Pulse Example 21 ϕ := ( Low ∧ Inc ) · Inc · � High ∧ Flat � ≥ 0 . 5 · Dec · ( Dec ∧ Low ) t ′ t High Low Low Flat Inc Flat Dec Flat t

  30. Matching Pulse Example 21 ϕ := ( Low ∧ Inc ) · Inc · � High ∧ Flat � ≥ 0 . 5 · Dec · ( Dec ∧ Low ) t ′ t High Low Low Flat Inc Flat Dec Flat t

  31. Matching Pulse Example 21 ϕ := ( Low ∧ Inc ) · Inc · � High ∧ Flat � ≥ 0 . 5 · Dec · ( Dec ∧ Low ) t ′ t High Low Low Flat Inc Flat Dec Flat t

  32. Matching Pulse Example 21 ϕ := ( Low ∧ Inc ) · Inc · � High ∧ Flat � ≥ 0 . 5 · Dec · ( Dec ∧ Low ) t ′ t High Low Low Flat Inc Flat Dec Flat t

  33. Matching Pulse Example 21 ϕ := ( Low ∧ Inc ) · Inc · � High ∧ Flat � ≥ 0 . 5 · Dec · ( Dec ∧ Low ) t ′ t High Low Low Flat Inc Flat Dec Flat t

  34. Matching Pulse Example 21 ϕ := ( Low ∧ Inc ) · Inc · � High ∧ Flat � ≥ 0 . 5 · Dec · ( Dec ∧ Low ) t ′ t High Low Low Flat Inc Flat Dec Flat t

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend