Checking Timed Regular Expressions on Boolean Signals Eugene - - PowerPoint PPT Presentation

checking timed regular expressions on boolean signals
SMART_READER_LITE
LIVE PREVIEW

Checking Timed Regular Expressions on Boolean Signals Eugene - - PowerPoint PPT Presentation

Checking Timed Regular Expressions on Boolean Signals Eugene Asarin, Thomas Ferrere, Oded Maler, Dogan Ulus Verimag & LIAFA July 9, 2014 Here we begin Introduction Patterns exist on signals. (Intentionally or unintentionally) Checking


slide-1
SLIDE 1

Checking Timed Regular Expressions

  • n Boolean Signals

Eugene Asarin, Thomas Ferrere, Oded Maler, Dogan Ulus

Verimag & LIAFA July 9, 2014

slide-2
SLIDE 2

Here we begin

Introduction Patterns exist on signals. (Intentionally or unintentionally) Checking patterns is an important verification task. Regular Expressions (Usual solution) Uses: PSL, SVA This work A complete solution for Timed Pattern Matching problem

2 / 23

slide-3
SLIDE 3

Timed Pattern Matching

Problem (Timed Pattern Matching) Let T = [0, d]. Given a dense-time signal w : T → Bm and a timed regular expression ϕ, find all intervals (t, t′) ∈ T × T that matches ϕ. We need to define ...

1 Timed Regular Expressions 2 Match-Set

3 / 23

slide-4
SLIDE 4

Timed Pattern Matching

Problem (Timed Pattern Matching) Let T = [0, d]. Given a dense-time signal w : T → Bm and a timed regular expression ϕ, find all intervals (t, t′) ∈ T × T that matches ϕ. We need to define ...

1 Timed Regular Expressions 2 Match-Set

4 / 23

slide-5
SLIDE 5

Timed Regular Expressions

Definition (Syntax of TRE) ϕ := ǫ | p | p | ϕ · ϕ | ϕ ∨ ϕ | ϕ ∧ ϕ | ϕ∗ | ϕI (p propositional variable; I duration constraint)

5 / 23

slide-6
SLIDE 6

Timed Regular Expressions

Definition (Syntax of TRE) ϕ := ǫ | p | p | ϕ · ϕ | ϕ ∨ ϕ | ϕ ∧ ϕ | ϕ∗ | ϕI (p propositional variable; I duration constraint) It will match ... ϕ := p — any interval s.t. p uniformly holds ϕ := p · q — any interval s.t. p followed by q ϕ := p · q[3,4] — any interval with a duration between [3,4] s.t. p followed by q

6 / 23

slide-7
SLIDE 7

Timed Regular Expressions

Definition (Syntax of TRE) ϕ := ǫ | p | p | ϕ · ϕ | ϕ ∨ ϕ | ϕ ∧ ϕ | ϕ∗ | ϕI (p propositional variable; I duration constraint) Definition (Semantics of TRE)

(w, t, t′) ǫ ↔ t = t′ (w, t, t′) p ↔ t < t′ and ∀s ∈ (t, t′) : p[s] = 1 (w, t, t′) p similar (w, t, t′) ϕ · ψ ↔ ∃t′′. (w, t, t′′) ϕ and (w, t′′, t′) ψ (w, t, t′) ϕ ∨ ψ ↔ (w, t, t′) ϕ or (w, t, t′) ψ (w, t, t′) ϕ ∧ ψ similar (w, t, t′) ϕ∗ ↔ ∃k ≥ 0. (w, t, t′) ϕk (w, t, t′) ϕI ↔ t′ − t ∈ I and (w, t, t′) ϕ

7 / 23

slide-8
SLIDE 8

An Example

Expression ϕ := (p ∧ q) · ¯ q · q[4,5] · ¯ p Signals

p 2 4 6 8 10 12 q 8 / 23

slide-9
SLIDE 9

An Example

Expression ϕ := (p ∧ q) · ¯ q · q[4,5] · ¯ p Signals

p 2 4 6 8 10 12 q

A few matches

1.3 2.0 6.06.3 6.8 p ∧ q ¯ q q ¯ p 1.5 2.0 6.0 6.4 7.0 p ∧ q ¯ q q ¯ p 9 / 23

slide-10
SLIDE 10

Problem Statement

Definition (Match-set) For a signal w and an expression ϕ the match-set is M(ϕ, w) := {(t, t′) ∈ T × T | (w, t, t′) ϕ} Problem (Timed pattern matching) Given a signal and an expression compute the match-set.

10 / 23

slide-11
SLIDE 11

Problem Statement

Definition (Match-set) For a signal w and an expression ϕ the match-set is M(ϕ, w) := {(t, t′) ∈ T × T | (w, t, t′) ϕ} Problem (Timed pattern matching) Given a signal and an expression compute the match-set.

11 / 23

slide-12
SLIDE 12

Data Structure

Definition (2D Zone) A 2D zone is a subset of R2 described by inequalities b < t < b e < t′ < e d < t′ − t < d with b, b, e, e, d, d are constants. About 2D zones Representing a set of intervals (t, t’) [b, b], [e, e], [d, d] correspond begin, end and duration constraints. Zones (in general) used for timed automata verification; efficient algorithms and libraries exist. Many examples below.

12 / 23

slide-13
SLIDE 13

Main Result

Theorem The match-set M(ϕ, w) is a finite union of 2D zones. It is computable knowing expression ϕ and signal w. Method for algorithms Structural induction over ϕ.

13 / 23

slide-14
SLIDE 14

Main Result

Theorem The match-set M(ϕ, w) is a finite union of 2D zones. It is computable knowing expression ϕ and signal w. Method for algorithms Structural induction over ϕ.

14 / 23

slide-15
SLIDE 15

Computation: Literals

A Literal

M(p) — a union of triangle zones

1 2 3 4 5 6 7 8 9 10 11 12

p

1 2 3 4 5 6 7 8 9 10 11 12 p

1Dropping w when w is clear 15 / 23

slide-16
SLIDE 16

Computation: Time Restriction

Time Restriction

M(ϕI) = M(ϕ)∩{(t, t′) | t′ −t ∈ I}

1 2 3 4 5 6 7 8 9 10 11 12

p[1,2]

1 2 3 4 5 6 7 8 9 10 11 12 p

16 / 23

slide-17
SLIDE 17

Computation: Concatenation

Concatenation

M(ϕ · ψ) = M(ϕ) ◦ M(ψ)

Composition preserves zones

(t, t′) ∈ M(ϕ) ◦ M(ψ) ↔ ∃t′′ : (t, t′′) ∈ M(ϕ) ∧ (t′′, t′) ∈ M(ψ) Can be obtained using standard zone operations.

17 / 23

slide-18
SLIDE 18

Concatenation with pictures

1 2 3 4 5 6 7 8

ϕ ψ ϕ · ψ

p 1 2 3 4 5 6 7 8 q t′′ t′ p t t′′ t′ q

ϕ := p[1,∞], ψ := q[0,2] and ϕ · ψ

Explanation

18 / 23

slide-19
SLIDE 19

Back to the First Example

Expression ϕ := (p ∧ q) · ¯ q · q[4,5] · ¯ p Signals

p 2 4 6 8 10 12 q

Correct Result M(ϕ, w) := {(t, t′) ∈ [1, 2] × [6, 7]}

19 / 23

slide-20
SLIDE 20

Back to the First Example

Match-Set Computation

1 2 3 4 5 6 7 8 9 10 11 12

p ¯ p q ¯ q p ∧ q (p ∧ q) · ¯ q

1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12

(p ∧ q) · ¯ q · q

1 2 3 4 5 6 7 8 9 10 11 12

(p ∧ q) · ¯ q · q[4,5]

1 2 3 4 5 6 7 8 9 10 11 12

(p ∧ q) · ¯ q · q[4,5] · ¯ p

20 / 23

slide-21
SLIDE 21

Performance

Experimental Setup A complex expression ϕ. Random signals p and q with variability V and length L Notes Python calling IF zone library (in C)

ϕ := (p·¯ p[0,10])∗∧(q·¯ q[0,10])∗[80,∞] V L |Zϕ| Time (s) 0.025 40000 0.08 0.025 80000 0.17 0.025 160000 0.37 0.05 40000 0.27 0.05 80000 0.60 0.05 160000 1.27 0.075 40000 1 0.64 0.075 80000 4 1.40 0.075 160000 5 2.88 0.1 40000 10 1.35 0.1 80000 23 2.73 0.1 160000 47 5.83

21 / 23

slide-22
SLIDE 22

Conclusion

Summary Timed Pattern Matching Zones to represent match-sets Experiments witness scalability. Discussion Trivial to extend for any discrete value domain. Natural companion for specification logics.

22 / 23

slide-23
SLIDE 23

More patterns using zones

Thanks

23 / 23