Specifying Timed Patterns using Temporal Logic Dogan Ulus and Oded - - PowerPoint PPT Presentation

specifying timed patterns using temporal logic
SMART_READER_LITE
LIVE PREVIEW

Specifying Timed Patterns using Temporal Logic Dogan Ulus and Oded - - PowerPoint PPT Presentation

Introduction Logic of Time Periods Computing Match Sets Conclusions Specifying Timed Patterns using Temporal Logic Dogan Ulus and Oded Maler Verimag, University of Grenoble-Alpes/CNRS, France CPSWEEK::HSCC 2018 Porto, Portugal April 13 1 /


slide-1
SLIDE 1

Introduction Logic of Time Periods Computing Match Sets Conclusions

Specifying Timed Patterns using Temporal Logic

Dogan Ulus and Oded Maler

Verimag, University of Grenoble-Alpes/CNRS, France

CPSWEEK::HSCC 2018 Porto, Portugal April 13

1 / 22

slide-2
SLIDE 2

Introduction Logic of Time Periods Computing Match Sets Conclusions

Temporal Behaviors

Cyber-Physical Systems (CPS) generate temporal behaviors.

Expressed in sequential forms: signals, waveforms, time series, event sequences.

There are patterns in any temporal behavior.

2 / 22

slide-3
SLIDE 3

Introduction Logic of Time Periods Computing Match Sets Conclusions

Detecting Patterns in Temporal Behaviors

Specific shapes on waveforms:

Rise and falls, various pulses, decays, . . .

Specific arrangements of physical observations.

High speed period after high acceleration, . . .

Sequences of actions, simultaneous occurrences.

Overtaking a car. Speeding-up while overtaken. (illegal pattern)

3 / 22

slide-4
SLIDE 4

Introduction Logic of Time Periods Computing Match Sets Conclusions

Detecting Patterns in Temporal Behaviors

Specific shapes on waveforms:

Rise and falls, various pulses, decays, . . .

Specific arrangements of physical observations.

High speed period after high acceleration, . . .

Sequences of actions, simultaneous occurrences.

Overtaking a car. Speeding-up while overtaken. (illegal pattern)

Find such pre-defined temporal patterns.

3 / 22

slide-5
SLIDE 5

Introduction Logic of Time Periods Computing Match Sets Conclusions

Timed Patterns

We are inspired from textual pattern matching. Applications: Text search, lexers, parsers, NLP.

4 / 22

slide-6
SLIDE 6

Introduction Logic of Time Periods Computing Match Sets Conclusions

Timed Patterns

We are inspired from textual pattern matching. Applications: Text search, lexers, parsers, NLP. A temporal behavior is different than a text —

  • ne-dimensional discrete sequence of single chars.

Time is dense (continuous). Temporal behaviors are multi-dimensional (multi-variate/multi-channel behaviors). Many patterns in time talk about different dimensions. Durations (and timings) are important.

4 / 22

slide-7
SLIDE 7

Introduction Logic of Time Periods Computing Match Sets Conclusions

An Example

t t′ Time Proximity Change in proximity Acceleration

Getting close Falling behind Keeping distance Safe distance Close distance Negative Positive

Pattern found. — Find all falling behind periods begun by a deceleration period and followed by a period of safe and keeping distance at least 30 seconds.

5 / 22

slide-8
SLIDE 8

Introduction Logic of Time Periods Computing Match Sets Conclusions

Related Work

Timed Pattern Matching (2014):

Inspired by textual pattern matching. Defined to be a computation to find all instances of a timed pattern over temporal behaviors. Solved for timed regular expressions by an offline algorithm

  • ver dense-time Boolean behaviors.

6 / 22

slide-9
SLIDE 9

Introduction Logic of Time Periods Computing Match Sets Conclusions

Related Work

Timed Pattern Matching (2014):

Inspired by textual pattern matching. Defined to be a computation to find all instances of a timed pattern over temporal behaviors. Solved for timed regular expressions by an offline algorithm

  • ver dense-time Boolean behaviors.

Later extended by online algorithms, measurements, timed automata patterns, skipping, quantitative semantics, and tools.

6 / 22

slide-10
SLIDE 10

Introduction Logic of Time Periods Computing Match Sets Conclusions

Contribution

Explore temporal logic patterns for TPM. Propose period-based TL for the specs. Introduce Metric Compass Logic (MCL)

Period-based Temporal Logic + Timing Constraints.

Present an offline pattern matching algorithm for MCL.

7 / 22

slide-11
SLIDE 11

Logic of Time Periods

slide-12
SLIDE 12

Introduction Logic of Time Periods Computing Match Sets Conclusions

Time Periods

A time period (t, t′) is a pair such that t < t′. It begins at t, ends at t′, and has a duration

  • f t′ − t.

Illustrated on the xy-plane. t t′ Time t t′ − t t′ x = y x y

8 / 22

slide-13
SLIDE 13

Introduction Logic of Time Periods Computing Match Sets Conclusions

Relations between Time Periods

Known as Allen’s interval relations. t t′

(L) (A) (O) (E) (D) (B) (=) (B−1) (D−1) (E −1) (O−1) (A−1) (L−1)

Relations: Adjacent (A), Begins (B), Ends (E), Overlaps (O), Later (L), During (D), and their inverses.

9 / 22

slide-14
SLIDE 14

Introduction Logic of Time Periods Computing Match Sets Conclusions

Relations between Time Periods

t t′

A−1 E−1 E O−1 D−1 O B B−1 A L−1 D L

Relations: Adjacent (A), Begins (B), Ends (E), Overlaps (O), Later (L), During (D), and their inverses. You can ask questions if there exists or for all . . . related periods.

10 / 22

slide-15
SLIDE 15

Introduction Logic of Time Periods Computing Match Sets Conclusions

A Temporal Logic of Time Periods

We have more relations (Allen’s) for time periods and consequently more temporal operators. (cf. time periods) It is shown that six of them is enough. Known as Halpern-Shoham (HS) logic1. Intractable for satisfiability, validity, model checking.

1Halpern and Shoham. A propositional modal logic of time intervals. 1986. 11 / 22

slide-16
SLIDE 16

Introduction Logic of Time Periods Computing Match Sets Conclusions

A Temporal Logic of Time Periods

We have more relations (Allen’s) for time periods and consequently more temporal operators. (cf. time periods) It is shown that six of them is enough. Known as Halpern-Shoham (HS) logic1. Intractable for satisfiability, validity, model checking. No problem for pattern matching. :)

1Halpern and Shoham. A propositional modal logic of time intervals. 1986. 11 / 22

slide-17
SLIDE 17

Introduction Logic of Time Periods Computing Match Sets Conclusions

Temporal Operators (Diamonds and Boxes)

There exists a time period — Begins (Begin at the same time, End earlier) — Begun-by (Begin at the same time, End later) — Ends (Begin earlier, End at the same time) — Ended-by (Begin later, End at the same time) — Adjacent in the past (Ends where it begins) — Adjacent in the future (Begins where it ends) the current time period. Boxes: ≡ ¬ ¬ Also called compass logic due to the decoration.

12 / 22

slide-18
SLIDE 18

Introduction Logic of Time Periods Computing Match Sets Conclusions

Metric Compass Logic (MCL)

We add timing constraints to HS logic. Use as a timed pattern specification language.

13 / 22

slide-19
SLIDE 19

Introduction Logic of Time Periods Computing Match Sets Conclusions

Metric Compass Logic (MCL)

We add timing constraints to HS logic. Use as a timed pattern specification language. Defined inductively over a set P of atomic propositions:

An atomic proposition p ∈ P is a MCL formula. If ϕ1 and ϕ2 are formulas, then ϕ1 ∪ ϕ2, ϕ1 ∩ ϕ2, and ϕ1 are formulas. If ϕ is a formula, then

I ϕ, I ϕ, I ϕ, I ϕ, I ϕ, and I ϕ are formulas.

13 / 22

slide-20
SLIDE 20

Introduction Logic of Time Periods Computing Match Sets Conclusions

Metric Compass Logic (MCL)

We add timing constraints to HS logic. Use as a timed pattern specification language. Defined inductively over a set P of atomic propositions:

An atomic proposition p ∈ P is a MCL formula. If ϕ1 and ϕ2 are formulas, then ϕ1 ∪ ϕ2, ϕ1 ∩ ϕ2, and ϕ1 are formulas. If ϕ is a formula, then

I ϕ, I ϕ, I ϕ, I ϕ, I ϕ, and I ϕ are formulas.

One diamond for relations A−1, A, B−1, B, E −1, E. The rest of operators/relations is derivable.

13 / 22

slide-21
SLIDE 21

Introduction Logic of Time Periods Computing Match Sets Conclusions

One Diamond Explained

— Ended-by (Begin later, End at the same time) t t′ t′′

t + a t + b

  • [a,b] p

p p

14 / 22

slide-22
SLIDE 22

Introduction Logic of Time Periods Computing Match Sets Conclusions

An Example

— Find all falling behind periods begun by a deceleration period and followed by a period of safe and keeping distance at least 30 seconds. ϕ : fall-behind ∧ decel ∧

[30,∞)(safe ∧ keep-dist)

15 / 22

slide-23
SLIDE 23

Computing Match Sets

slide-24
SLIDE 24

Introduction Logic of Time Periods Computing Match Sets Conclusions

Timed Pattern Matching

A computation for identifying all time periods of a temporal behavior that satisfy a timed pattern.

16 / 22

slide-25
SLIDE 25

Introduction Logic of Time Periods Computing Match Sets Conclusions

Timed Pattern Matching

A computation for identifying all time periods of a temporal behavior that satisfy a timed pattern. Patterns specified in Metric Compass Logic. (This Paper)

16 / 22

slide-26
SLIDE 26

Introduction Logic of Time Periods Computing Match Sets Conclusions

Timed Pattern Matching

A computation for identifying all time periods of a temporal behavior that satisfy a timed pattern. Patterns specified in Metric Compass Logic. (This Paper) The set of all satisfying segments is called the match set of the pattern ϕ over a temporal behavior w. Mw(ϕ) = {(t, t′) | w[t, t′] satisfies ϕ}

16 / 22

slide-27
SLIDE 27

Introduction Logic of Time Periods Computing Match Sets Conclusions

Timed Pattern Matching

A computation for identifying all time periods of a temporal behavior that satisfy a timed pattern. Patterns specified in Metric Compass Logic. (This Paper) The set of all satisfying segments is called the match set of the pattern ϕ over a temporal behavior w. Mw(ϕ) = {(t, t′) | w[t, t′] satisfies ϕ} Compute the match set Mw(ϕ) in the following.

16 / 22

slide-28
SLIDE 28

Introduction Logic of Time Periods Computing Match Sets Conclusions

Skeleton Algorithm

Z = evalW (ϕ) is the match set of the pattern ϕ over W . select (ϕ) case p: Z := V (p) case ψ: Z := complement(evalW (ψ)) case ψ1 ∪ ψ2: Z := union(evalW (ψ2), evalW (ψ2)) case ψ1 ∩ ψ2: Z := intersect(evalW (ψ2), evalW (ψ2)) case

I ψ:

Z :=

  • shift(evalW (ψ), I)

end select return Z

17 / 22

slide-29
SLIDE 29

Introduction Logic of Time Periods Computing Match Sets Conclusions

Shifting Time Periods

1 2 1 2 Z

I Z I Z I Z

x y 1 2 1 2 Z

I Z I Z I Z

x y

Look at the effect of

I on a single period.

Need to represent and manipulate sets of time periods.

18 / 22

slide-30
SLIDE 30

Introduction Logic of Time Periods Computing Match Sets Conclusions

Representing Match Sets

A zone is a convex set of time periods, formed by constraints on begins, ends, and durations. c1 ≺ x ≺ c2 c3 ≺ y ≺ c4 c5 ≺ y − x ≺ c6 We represent a match set Z by a finite union RZ of zones. x y

19 / 22

slide-31
SLIDE 31

Introduction Logic of Time Periods Computing Match Sets Conclusions

Shifting Zones

3 5 5 7 Z x y 1 4 5 7

[1,2] Z

x y Theorem: Zones are closed under

I operators.

20 / 22

slide-32
SLIDE 32

Introduction Logic of Time Periods Computing Match Sets Conclusions

Experiments

Offline Algorithm Input Size Test Patterns 100K 500K 1M p 0.18/12 0.95/45 1.88/92

I p

0.07/16 0.29/65 0.66/163

I p

0.49/23 1.98/100 3.92/163

I J p

0.08/20 0.32/37 0.96/60 ( p · q) 0.40/31 1.98/143 3.93/268 ( p · q) ∩

I q

0.43/38 2.17/179 4.30/304

Diamonds are cheap, complementation is expensive. Linear execution time for typical inputs.

21 / 22

slide-33
SLIDE 33

Introduction Logic of Time Periods Computing Match Sets Conclusions

Conclusions

Presented a pattern matching solution for MCL. A substantial addition for timed pattern matching.

22 / 22

slide-34
SLIDE 34

Introduction Logic of Time Periods Computing Match Sets Conclusions

Conclusions

Presented a pattern matching solution for MCL. A substantial addition for timed pattern matching. We should consider more concise, expressive, and elegant formalisms for monitoring and pattern matching even though they are not good for other tasks.

22 / 22

slide-35
SLIDE 35

Introduction Logic of Time Periods Computing Match Sets Conclusions

Conclusions

Presented a pattern matching solution for MCL. A substantial addition for timed pattern matching. We should consider more concise, expressive, and elegant formalisms for monitoring and pattern matching even though they are not good for other tasks. Expressiveness? (FAQ):

, is not expressible in regular expressions. Concatenation is not expressible in compass logic.

Online algorithm? (A theoretical and practical challenge) Thank you!

22 / 22