Online Quantitative Timed Pattern Matching with Semiring-Valued - - PowerPoint PPT Presentation

online quantitative timed pattern matching with semiring
SMART_READER_LITE
LIVE PREVIEW

Online Quantitative Timed Pattern Matching with Semiring-Valued - - PowerPoint PPT Presentation

Online Quantitative Timed Pattern Matching with Semiring-Valued Weighted Automata Masaki Waga 1,2,3 National Institute of Informatics 1 , SOKENDAI 2 , JSPS Research Fellow 3 27 August 2019, FORMATS 2019 This work is partially supported by


slide-1
SLIDE 1
  • M. Waga (NII)

Online Quantitative Timed Pattern Matching with Semiring-Valued Weighted Automata

1

Masaki Waga1,2,3 


National Institute of Informatics1, SOKENDAI2, JSPS Research Fellow3 27 August 2019, FORMATS 2019

This work is partially supported by JST ERATO HASUO Metamathematics for Systems Design Project (No. JPMJER1603), by JSPS Grants-in-Aid No. 15KT0012 & 18J22498

slide-2
SLIDE 2
  • M. Waga (NII)

Online Quantitative Timed Pattern Matching with Semiring-Valued Weighted Automata

1

Masaki Waga1,2,3 


National Institute of Informatics1, SOKENDAI2, JSPS Research Fellow3 27 August 2019, FORMATS 2019

This work is partially supported by JST ERATO HASUO Metamathematics for Systems Design Project (No. JPMJER1603), by JSPS Grants-in-Aid No. 15KT0012 & 18J22498

Online Quantitative Timed Pattern Matching with Semiring-Valued Weighted Automata

Monitoring

slide-3
SLIDE 3
  • M. Waga (NII)

Why Monitoring?

Exhaustive formal method
 (e.g. model checking, reachability analysis)

  • The system is correct/incorrect for any execution
  • We need system model (white box)
  • Scalability is a big issue

Monitoring

  • The system is correct/incorrect for the given execution
  • data-driven analysis
  • We do not need system model (black box is OK)
  • Usually scalable

2

slide-4
SLIDE 4
  • M. Waga (NII)

Input

  • Finite-valued signal σ
  • System log
  • e.g.,
  • Real-time spec.
  • Spec. to be monitored
  • e.g., The velocity should not keep high for > 1 sec.


Output

  • All the subsignals σ([t,t′)) of the log satisfies the spec.
  • e.g., σ([4.0,8.0)), σ([6.0,8.0)), σ([6.0,7.5)), …

3

(Qualitative) timed pattern matching

[Ulus+, FORMATS’14]

t v vhigh vlow 4.0 8.0

W

discretized!!

slide-5
SLIDE 5
  • M. Waga (NII)

Input

  • Finite-valued signal σ
  • System log
  • e.g.,
  • Real-time spec.
  • Spec. to be monitored
  • e.g., The velocity should not keep high for > 1 sec.


Output

  • All the subsignals σ([t,t′)) of the log satisfies the spec.
  • e.g., σ([4.0,8.0)), σ([6.0,8.0)), σ([6.0,7.5)), …

3

(Qualitative) timed pattern matching

[Ulus+, FORMATS’14]

t v vhigh vlow 4.0 8.0

W

discretized!!

slide-6
SLIDE 6
  • M. Waga (NII)

Input

  • Finite-valued signal σ
  • System log
  • e.g.,
  • Real-time spec.
  • Spec. to be monitored
  • e.g., The velocity should not keep high for > 1 sec.


Output

  • All the subsignals σ([t,t′)) of the log satisfies the spec.
  • e.g., σ([4.0,8.0)), σ([6.0,8.0)), σ([6.0,7.5)), …

3

(Qualitative) timed pattern matching

[Ulus+, FORMATS’14]

t v vhigh vlow 4.0 8.0

W

discretized!! 4.0 8.0

8.0 4.0

slide-7
SLIDE 7
  • M. Waga (NII)

Input

  • Finite-valued signal σ
  • System log
  • e.g.,
  • Real-time spec.
  • Spec. to be monitored
  • e.g., The velocity should not keep high for > 1 sec.


Output

  • All the subsignals σ([t,t′)) of the log satisfies the spec.
  • e.g., σ([4.0,8.0)), σ([6.0,8.0)), σ([6.0,7.5)), …

3

(Qualitative) timed pattern matching

[Ulus+, FORMATS’14]

t v vhigh vlow 4.0 8.0

W

discretized!! 4.0 8.0 6.0

8.0 4.0 6.0 8.0

slide-8
SLIDE 8
  • M. Waga (NII)

Input

  • Finite-valued signal σ
  • System log
  • e.g.,
  • Real-time spec.
  • Spec. to be monitored
  • e.g., The velocity should not keep high for > 1 sec.


Output

  • All the subsignals σ([t,t′)) of the log satisfies the spec.
  • e.g., σ([4.0,8.0)), σ([6.0,8.0)), σ([6.0,7.5)), …

3

(Qualitative) timed pattern matching

[Ulus+, FORMATS’14]

t v vhigh vlow 4.0 8.0

W

discretized!! 4.0 8.0 6.07.5

8.0 4.0 6.0 8.0 6.0 7.5

slide-9
SLIDE 9
  • M. Waga (NII)

Input

  • Finite-valued signal σ
  • System log
  • e.g.,
  • Real-time spec.
  • Spec. to be monitored
  • e.g., The velocity should not keep high for > 1 sec.


Output

  • All the subsignals σ([t,t′)) of the log satisfies the spec.
  • e.g., σ([4.0,8.0)), σ([6.0,8.0)), σ([6.0,7.5)), …

3

(Qualitative) timed pattern matching

[Ulus+, FORMATS’14]

t v vhigh vlow 4.0 8.0

W

discretized!!

We want to know how robustly the spec. is satisfied!!

4.0 8.0 6.07.5

8.0 4.0 6.0 8.0 6.0 7.5

slide-10
SLIDE 10
  • M. Waga (NII)

Input

  • Real-valued piecewise-constant signal σ
  • System log
  • e.g., 

  • Real-time spec. with signal constraints
  • Spec. to be monitored
  • e.g., The velocity should not keep > 80 for > 1 sec.

Output

  • How robustly, each subsignals σ([t,t′)) of the log, satisfies the

spec.

  • e.g., M(σ, W)(2.0,4.0) = -20, M(σ, W)(6.5,7.8) = 40, …

4

Quantitative timed pattern matching

[Bakhirkin+, FORMATS’17]

W

t v 120 60 45 4.0 8.010.0 6.2 100 satisfaction degree of for σ([2.0,4.0)) W

slide-11
SLIDE 11
  • M. Waga (NII)

Input

  • Real-valued piecewise-constant signal σ
  • System log
  • e.g., 

  • Real-time spec. with signal constraints
  • Spec. to be monitored
  • e.g., The velocity should not keep > 80 for > 1 sec.

Output

  • How robustly, each subsignals σ([t,t′)) of the log, satisfies the

spec.

  • e.g., M(σ, W)(2.0,4.0) = -20, M(σ, W)(6.5,7.8) = 40, …

4

Quantitative timed pattern matching

[Bakhirkin+, FORMATS’17]

W

t v 120 60 45 4.0 8.010.0 6.2 100

2 4 6 8 10 t 2 4 6 8 10

t

  • 40
  • 30
  • 20
  • 10

10 20 30 40

satisfaction degree of for σ([2.0,4.0)) W

slide-12
SLIDE 12
  • M. Waga (NII)

Input

  • Real-valued piecewise-constant signal σ
  • System log
  • e.g., 

  • Real-time spec. with signal constraints
  • Spec. to be monitored
  • e.g., The velocity should not keep > 80 for > 1 sec.

Output

  • How robustly, each subsignals σ([t,t′)) of the log, satisfies the

spec.

  • e.g., M(σ, W)(2.0,4.0) = -20, M(σ, W)(6.5,7.8) = 40, …

4

Quantitative timed pattern matching

[Bakhirkin+, FORMATS’17]

W

t v 120 60 45 4.0 8.010.0 6.2 100

2 4 6 8 10 t 2 4 6 8 10

t

  • 40
  • 30
  • 20
  • 10

10 20 30 40

satisfaction degree of for σ([2.0,4.0)) W

2.0 4.0

2.0 4.0

slide-13
SLIDE 13
  • M. Waga (NII)

Input

  • Real-valued piecewise-constant signal σ
  • System log
  • e.g., 

  • Real-time spec. with signal constraints
  • Spec. to be monitored
  • e.g., The velocity should not keep > 80 for > 1 sec.

Output

  • How robustly, each subsignals σ([t,t′)) of the log, satisfies the

spec.

  • e.g., M(σ, W)(2.0,4.0) = -20, M(σ, W)(6.5,7.8) = 40, …

4

Quantitative timed pattern matching

[Bakhirkin+, FORMATS’17]

W

t v 120 60 45 4.0 8.010.0 6.2 100

2 4 6 8 10 t 2 4 6 8 10

t

  • 40
  • 30
  • 20
  • 10

10 20 30 40

satisfaction degree of for σ([2.0,4.0)) W

2.0 4.0 6.5 7.8

2.0 4.0 6.5 7.8

slide-14
SLIDE 14
  • M. Waga (NII)

Online Pattern Matching

  • After reading the prefix signal σ' of σ = σ'・σ'', we
  • btain the partial result M(σ',W) of M(σ,W)
  • Important in practice

5

slide-15
SLIDE 15
  • M. Waga (NII)

Timed symbolic weighted automata (TSWA)

  • New formalism for spec.
  • Automata structure is good for online monitoring
  • Generality of semiring (same as the usual WFA)

6

Boolean sup-inf tropical

S

{True/False} R ∪ {±∞} R ∪ {+∞}

⊕ ∨ sup inf ⊗ ∧ inf +

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

r

  • u, (a1a2 . . . am)
  • =

inf

i∈{1,2,...,n} r(u, (ai))

r n ^

i=1

(xi . /i di), (a)

  • =

inf

i∈{1,2,...,n} r(xi .

/i di, (a)) where . /i2 {>, , , <} r(x d, (a)) = a(x) d where 2 {, >} r(x d, (a)) = d a(x) where 2 {, <}

slide-16
SLIDE 16
  • M. Waga (NII)

Contribution

  • Introduced timed symbolic weighted automata (TSWA)
  • TSWA: timed automata with signal constraints (TSA)



 + semiring-valued weight function


  • Gave online algorithm for quantitative timed pattern

matching

  • Implementation + experiments → Scalable!!

7

Automata structure Quantitative semantics

slide-17
SLIDE 17
  • M. Waga (NII)

Related Works

8

Qualitative Quantitative Offline

[Ulus+, FORMATS’14]


(TRE)

[Bakhirkin+, FORMATS’17]


(Signal RE)

Online

[Ulus+, TACAS’16], [Bakhirkin+, FORMATS’18]


(TRE & TA)

[Contribution]


(TSWA)

Timed automata Timed automata
 with 
 signal constraints Only “Robust” Semantics

[Fainekos & Pappas, TCS’09]

Any Semantics
 defined by semiring- valued weight function

slide-18
SLIDE 18
  • M. Waga (NII)

Outline

  • Motivation + Introduction
  • Technical Part
  • Timed symbolic weighted automata (TSWA)
  • TSWA: TA with signal constraints + weight function
  • Quantitative monitoring/timed pattern matching algorithm
  • Idea: zone construction with weight
  • Experiments

9

slide-19
SLIDE 19
  • M. Waga (NII)

TSWA: TA with signal constraints + weight function

Timed Automaton (TA)

10

l0 start l1 l2 c < 5 /c := 0 c < 10

slide-20
SLIDE 20
  • M. Waga (NII)

TSWA: TA with signal constraints + weight function

Timed Symbolic Automaton (TSA)

11

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

slide-21
SLIDE 21
  • M. Waga (NII)

TSWA: TA with signal constraints + weight function

Timed Symbolic Weighted Automaton (TSWA)

12

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

+

r

  • u, (a1a2 . . . am)
  • =

inf

i∈{1,2,...,n} r(u, (ai))

r n ^

i=1

(xi . /i di), (a)

  • =

inf

i∈{1,2,...,n} r(xi .

/i di, (a)) where . /i2 {>, , , <} r(x d, (a)) = a(x) d where 2 {, >} r(x d, (a)) = d a(x) where 2 {, <}

slide-22
SLIDE 22
  • M. Waga (NII)

TSWA: TA with signal constraints + weight function

Timed Symbolic Weighted Automaton (TSWA)

12

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

+

r

  • u, (a1a2 . . . am)
  • =

inf

i∈{1,2,...,n} r(u, (ai))

r n ^

i=1

(xi . /i di), (a)

  • =

inf

i∈{1,2,...,n} r(xi .

/i di, (a)) where . /i2 {>, , , <} r(x d, (a)) = a(x) d where 2 {, >} r(x d, (a)) = d a(x) where 2 {, <}

Automata structure Quantitative semantics

slide-23
SLIDE 23
  • M. Waga (NII)

Weight function 
 κ: Φ(X, D) × (DX)⊛ → S

  • κ(Λ(l),u): weight for the stay at l with signal values u
  • Semiring: set S with accumulating operators ⊕ and ⊗
  • We can use any complete and idempotent semiring

13

Constraints on signal values at the location Sequence of signal values at the location Semiring value

slide-24
SLIDE 24
  • M. Waga (NII)

continuous transitions

Semantics: Weighted TTS

14

→(l, ν, t, u) (l, ν + 3, t + 3, u ○ u') (l', ν', t +3, ε) 3.0 e

κ(Λ(l), u ○ u')

4.0 (l, ν + 4, t + 4, u ○ u") (l', ν", t + 4, ε) e

κ(Λ(l), u ○ u")

  • l: location
  • ν: clock valuation
  • t: absolute time
  • u: sequence of signal values after the latest discrete transition

discrete transitions

slide-25
SLIDE 25
  • M. Waga (NII)

One path in Weighted TTS

15

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

t v 12.0 7.0 7.0 3.5

→(l0, c=0, 0,ε)

here

slide-26
SLIDE 26
  • M. Waga (NII)

One path in Weighted TTS

15

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

t v 12.0 7.0 7.0 3.5

→(l0, c=0, 0,ε) (l0, c=2, 2, {v = 7}) 2.0

2.0 here

slide-27
SLIDE 27
  • M. Waga (NII)

One path in Weighted TTS

15

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

t v 12.0 7.0 7.0 3.5

→(l0, c=0, 0,ε) (l0, c=2, 2, {v = 7}) (l1, c=0, 2, ε) 2.0 e

κ(v < 15, {v=7})

2.0 here

slide-28
SLIDE 28
  • M. Waga (NII)

One path in Weighted TTS

15

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

t v 12.0 7.0 7.0 3.5

→(l0, c=0, 0,ε) (l0, c=2, 2, {v = 7}) (l1, c=0, 2, ε) (l1, c=5, 7, {v = 7}{v = 12}) 2.0 e

κ(v < 15, {v=7})

5.0

2.0 7.0 here

slide-29
SLIDE 29
  • M. Waga (NII)

One path in Weighted TTS

15

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

t v 12.0 7.0 7.0 3.5

→(l0, c=0, 0,ε) (l0, c=2, 2, {v = 7}) (l1, c=0, 2, ε) (l1, c=5, 7, {v = 7}{v = 12}) (l2, c=5, 7, ε) 2.0 e

κ(v < 15, {v=7})

5.0 e

κ(v > 5, {v=7}{v=12})

2.0 7.0 here

slide-30
SLIDE 30
  • M. Waga (NII)

One path in Weighted TTS

15

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

t v 12.0 7.0 7.0 3.5

→(l0, c=0, 0,ε) (l0, c=2, 2, {v = 7}) (l1, c=0, 2, ε) (l1, c=5, 7, {v = 7}{v = 12}) (l2, c=5, 7, ε) 2.0 e

κ(v < 15, {v=7})

5.0 e

κ(v > 5, {v=7}{v=12})

2.0 7.0 here

Boolean sup-inf tropical

S

{True/False} R ∪ {±∞} R ∪ {+∞}

⊕ ∨ sup inf ⊗ ∧ inf +

slide-31
SLIDE 31
  • M. Waga (NII)

Accumulating paths in Weighted TTS

16

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

t v 12.0 7.0 7.0 3.5

κ(v < 15, {v=7}) ⊗ κ(v > 5, {v=7}{v=12})

→(l0, c=0, 0,ε) (l0, c=2, 2, {v = 7}) (l1, c=0, 3, ε) (l1, c=5, 7, {v = 7}{v = 12}) (l2, c=5, 7, ε) 2.0 e 5.0 e

7.0

Boolean sup-inf tropical

S

{True/False} R ∪ {±∞} R ∪ {+∞}

⊕ ∨ sup inf ⊗ ∧ inf +

κ(v < 15, {v=7}{v=12}) ⊗ κ(v > 5,{v=12})

→(l0, c=0, 0,ε) (l0, c=4, 4, {v = 7}{v = 12}) (l1, c=0, 4, ε) (l1, c=3, 7, {v = 12}) (l2, c=3, 7, ε) 4.0 e 3.0 e

2.0

slide-32
SLIDE 32
  • M. Waga (NII)

Accumulating paths in Weighted TTS

16

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

t v 12.0 7.0 7.0 3.5

κ(v < 15, {v=7}) ⊗ κ(v > 5, {v=7}{v=12})

→(l0, c=0, 0,ε) (l0, c=2, 2, {v = 7}) (l1, c=0, 3, ε) (l1, c=5, 7, {v = 7}{v = 12}) (l2, c=5, 7, ε) 2.0 e 5.0 e

7.0

Boolean sup-inf tropical

S

{True/False} R ∪ {±∞} R ∪ {+∞}

⊕ ∨ sup inf ⊗ ∧ inf +

κ(v < 15, {v=7}{v=12}) ⊗ κ(v > 5,{v=12})

→(l0, c=0, 0,ε) (l0, c=4, 4, {v = 7}{v = 12}) (l1, c=0, 4, ε) (l1, c=3, 7, {v = 12}) (l2, c=3, 7, ε) 4.0 e 3.0 e

⊕ ⊕

2.0

slide-33
SLIDE 33
  • M. Waga (NII)
  • TSA: the automata structure


  • Weight function (κ): the one-step semantics


(weight on each transition)

  • Semiring operations (⊗,⊕): how to accumulate

weights
 One-step semantics → semantics for a path/TSWA

Timed symbolic weighted automata (TSWA)

17

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

slide-34
SLIDE 34
  • M. Waga (NII)

Outline

  • Motivation + Introduction
  • Technical Part
  • Timed symbolic weighted automata (TSWA)
  • TSWA: TA with signal constraints + weight function
  • Quantitative monitoring/timed pattern matching algorithm
  • Idea: zone construction with weight
  • Experiments

18

slide-35
SLIDE 35
  • M. Waga (NII)

Review: Reachability by zones

19

continuous transitions

→(l, ν) (l, ν + 0.1) (l', ν') 0.1 e 0.2 (l, ν + 0.2) (l', ν") e

discrete transitions

0.21 (l, ν + 0.21) (l'', ν'") e'

Infinitely many reachable states!! → symbolic analysis by zones Infinitely many delays!!

slide-36
SLIDE 36
  • M. Waga (NII)

Review: Reachability by zones

  • Zone Z symbolically represents infinitely many

clock valuations!!

20

continuous transitions

→(l, Z) (l, {ν + T | ν ∈ Z, T ∈ R+}) (l', Z') T e

discrete transitions Infinitely many reachable states!! → symbolic analysis by zones

(l'', Z'') e'

slide-37
SLIDE 37
  • M. Waga (NII)

Observation: reachability is shortest distance over Boolean semiring!

21

slide-38
SLIDE 38
  • M. Waga (NII)

Observation: reachability is shortest distance over Boolean semiring!

22

→(l, Z) (l, {ν + T | ν ∈ Z, T ∈ R+}) (l', Z') T e (l'', Z'') e'

slide-39
SLIDE 39
  • M. Waga (NII)

Observation: reachability is shortest distance over Boolean semiring!

22

→(l, Z) (l, {ν + T | ν ∈ Z, T ∈ R+}) (l', Z') T e (l'', Z'') e' Reachable at all the transitions (∧)

slide-40
SLIDE 40
  • M. Waga (NII)

Observation: reachability is shortest distance over Boolean semiring!

22

→(l, Z) (l, {ν + T | ν ∈ Z, T ∈ R+}) (l', Z') T e (l'', Z'') e' Reachable at all the transitions (∧) Reachable for one path (∨)

slide-41
SLIDE 41
  • M. Waga (NII)

Observation: reachability is shortest distance over Boolean semiring!

22

→(l, Z) (l, {ν + T | ν ∈ Z, T ∈ R+}) (l', Z') T e (l'', Z'') e' Reachable at all the transitions (∧) Reachable for one path (∨)

p∈Paths(⋀ i

(pi, pi+1) ∈ E)

Reachability

slide-42
SLIDE 42
  • M. Waga (NII)

Observation: reachability is shortest distance over Boolean semiring!

22

→(l, Z) (l, {ν + T | ν ∈ Z, T ∈ R+}) (l', Z') T e (l'', Z'') e' Reachable at all the transitions (∧) Reachable for one path (∨)

p∈Paths(⋀ i

(pi, pi+1) ∈ E)

p∈Paths (⨂ i

w(pi, pi+1))

Shortest Distance (for semiring)

Boolean sup-inf tropical

S

{True/False} R ∪ {±∞} R ∪ {+∞}

⊕ ∨ sup inf ⊗ ∧ inf +

Reachability

slide-43
SLIDE 43
  • M. Waga (NII)

Observation: reachability is shortest distance over Boolean semiring!

23

Qualitative [Bakhirkin+, FORMATS’18] Quantitative [Contribution]

TA zone graph
 (with Boolean weight) reachability
 (qualitative 
 semantics)

zone constr. reachability checking
 (Boolean shortest distance)

TSWA zone graph
 with semiring weight quantitative
 semantics

zone constr. semiring 
 shortest distance

slide-44
SLIDE 44
  • M. Waga (NII)

Zone construction with weight

24

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε)

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-45
SLIDE 45
  • M. Waga (NII)

Zone construction with weight

24

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-46
SLIDE 46
  • M. Waga (NII)

Zone construction with weight

24

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε)

κ(v < 15, {v=7})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-47
SLIDE 47
  • M. Waga (NII)

Zone construction with weight

24

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-48
SLIDE 48
  • M. Waga (NII)

Zone construction with weight

25

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε)

(l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

3.5

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-49
SLIDE 49
  • M. Waga (NII)

Zone construction with weight

25

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε)

(l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

3.5

(l0, c = T = 3.5, {v = 7})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-50
SLIDE 50
  • M. Waga (NII)

Zone construction with weight

25

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε)

(l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

3.5

(l0, c = T = 3.5, {v = 7}) (l1, 0 < c < T = 3.5, {v = 7})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-51
SLIDE 51
  • M. Waga (NII)

Zone construction with weight

25

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε)

(l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

3.5

(l0, c = T = 3.5, {v = 7}) (l1, 0 < c < T = 3.5, {v = 7}) (l1, c = 0 < T = 3.5, ε)

κ(v < 15,{v=7})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-52
SLIDE 52
  • M. Waga (NII)

Zone construction with weight

26

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

(l0, c = T = 3.5, {v = 7}) (l1, 0 < c < T = 3.5, {v = 7}) (l1, c = 0 < T = 3.5, ε)

κ(v < 15,{v=7})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-53
SLIDE 53
  • M. Waga (NII)

Zone construction with weight

26

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

(l0, c = T = 3.5, {v = 7}) (l1, 0 < c < T = 3.5, {v = 7}) (l1, c = 0 < T = 3.5, ε)

κ(v < 15,{v=7})

(l0, 3.5 < c = T = 7, 
 {v = 7}{v = 12})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-54
SLIDE 54
  • M. Waga (NII)

Zone construction with weight

26

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

(l0, c = T = 3.5, {v = 7}) (l1, 0 < c < T = 3.5, {v = 7}) (l1, c = 0 < T = 3.5, ε)

κ(v < 15,{v=7})

(l0, 3.5 < c = T = 7, 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), {v = 12})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-55
SLIDE 55
  • M. Waga (NII)

Zone construction with weight

26

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

(l0, c = T = 3.5, {v = 7}) (l1, 0 < c < T = 3.5, {v = 7}) (l1, c = 0 < T = 3.5, ε)

κ(v < 15,{v=7})

(l0, 3.5 < c = T = 7, 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), {v = 12}) (l1, 0 < c < T ∈ (3.5,7), 
 {v = 7}{v = 12})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-56
SLIDE 56
  • M. Waga (NII)

Zone construction with weight

26

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

(l0, c = T = 3.5, {v = 7}) (l1, 0 < c < T = 3.5, {v = 7}) (l1, c = 0 < T = 3.5, ε)

κ(v < 15,{v=7})

(l0, 3.5 < c = T = 7, 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), {v = 12}) (l1, 0 < c < T ∈ (3.5,7), 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), ε)

κ(v < 15, {v=7}{v=12})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-57
SLIDE 57
  • M. Waga (NII)

Zone construction with weight

26

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

(l0, c = T = 3.5, {v = 7}) (l1, 0 < c < T = 3.5, {v = 7}) (l1, c = 0 < T = 3.5, ε)

κ(v < 15,{v=7})

(l0, 3.5 < c = T = 7, 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), {v = 12}) (l1, 0 < c < T ∈ (3.5,7), 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), ε)

κ(v < 15, {v=7}{v=12})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-58
SLIDE 58
  • M. Waga (NII)

Zone construction with weight

27

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

(l0, c = T = 3.5, {v = 7}) (l1, 0 < c < T = 3.5, {v = 7}) (l1, c = 0 < T = 3.5, ε)

κ(v < 15,{v=7})

(l0, 3.5 < c = T = 7, 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), {v = 12}) (l1, 0 < c < T ∈ (3.5,7), 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), ε)

κ(v < 15, {v=7}{v=12})

7.0

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-59
SLIDE 59
  • M. Waga (NII)

Zone construction with weight

27

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

(l0, c = T = 3.5, {v = 7}) (l1, 0 < c < T = 3.5, {v = 7}) (l1, c = 0 < T = 3.5, ε)

κ(v < 15,{v=7})

(l0, 3.5 < c = T = 7, 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), {v = 12}) (l1, 0 < c < T ∈ (3.5,7), 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), ε)

κ(v < 15, {v=7}{v=12})

7.0

(l1, 0 < c < T =7, 
 {v = 12})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-60
SLIDE 60
  • M. Waga (NII)

Zone construction with weight

27

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

(l0, c = T = 3.5, {v = 7}) (l1, 0 < c < T = 3.5, {v = 7}) (l1, c = 0 < T = 3.5, ε)

κ(v < 15,{v=7})

(l0, 3.5 < c = T = 7, 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), {v = 12}) (l1, 0 < c < T ∈ (3.5,7), 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), ε)

κ(v < 15, {v=7}{v=12})

7.0

(l1, 0 < c < T =7, 
 {v = 12}) (l1, 0 < c < T = 7, 
 {v = 7}{v = 12})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-61
SLIDE 61
  • M. Waga (NII)

Zone construction with weight

27

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

(l0, c = T = 3.5, {v = 7}) (l1, 0 < c < T = 3.5, {v = 7}) (l1, c = 0 < T = 3.5, ε)

κ(v < 15,{v=7})

(l0, 3.5 < c = T = 7, 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), {v = 12}) (l1, 0 < c < T ∈ (3.5,7), 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), ε)

κ(v < 15, {v=7}{v=12})

7.0

(l1, 0 < c < T =7, 
 {v = 12}) (l1, 0 < c < T = 7, 
 {v = 7}{v = 12}) (l2, 0 < c < T = 7, ε)

κ(v > 5, {v=12})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-62
SLIDE 62
  • M. Waga (NII)

Zone construction with weight

27

t v 12.0 7.0 7.0 3.5

→(l0,c = T = 0, ε) (l0, 0 < c = T < 3.5, 
 {v = 7}) (l1, 0 = c < T < 3.5, ε) (l1, 0 < c < T < 3.5, {v = 7})

κ(v < 15, {v=7})

(l0, c = T = 3.5, {v = 7}) (l1, 0 < c < T = 3.5, {v = 7}) (l1, c = 0 < T = 3.5, ε)

κ(v < 15,{v=7})

(l0, 3.5 < c = T = 7, 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), {v = 12}) (l1, 0 < c < T ∈ (3.5,7), 
 {v = 7}{v = 12}) (l1, 0 < c < T ∈ (3.5, 7), ε)

κ(v < 15, {v=7}{v=12})

7.0

(l1, 0 < c < T =7, 
 {v = 12}) (l1, 0 < c < T = 7, 
 {v = 7}{v = 12}) (l2, 0 < c < T = 7, ε)

κ(v > 5, {v=12}) κ(v > 5, {v=7}{v=12})

  • T: absolute time
  • Accepted ⇔ transit to acc. loc. at T = |σ| (= 7.0)

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

This is OK for monitoring

slide-63
SLIDE 63
  • M. Waga (NII)

Main Theorem: Correctness

28

Thm. The shortest distance in the zone graph with weight is same as the shortest distance in the weighted TTS for any complete and idempotent semiring.

Boolean sup-inf tropical

S

{True/False} R ∪ {±∞} R ∪ {+∞}

⊕ ∨ sup inf ⊗ ∧ inf +

All of them work!!

slide-64
SLIDE 64
  • M. Waga (NII)

Local Conclusion: Zone Construction with Weight

  • The construction is basically same as the usual zone

construction

  • Weights are same as weighted TTS
  • The state space is finite thanks to zones and finite

horizon of the input signal

29

slide-65
SLIDE 65
  • M. Waga (NII)

Matching Automata for Pattern Matching

30

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

linit, > start l0, v < 15 l1, v > 5 l2, > >/T 0 := 0, c := 0 c < 5/c := 0 c < 10

  • Add linit to wait for the beginning of the

matching

  • Add clock variable T’ for the beginning
  • f the matching

[Bakhirkin+, FORMATS’18]

slide-66
SLIDE 66
  • M. Waga (NII)

Outline

  • Motivation + Introduction
  • Technical Part
  • Timed symbolic weighted automata (TSWA)
  • TSWA: TA with signal constraints + weight function
  • Quantitative monitoring/timed pattern matching algorithm
  • Idea: zone construction with weight
  • Experiments

31

slide-67
SLIDE 67
  • M. Waga (NII)
  • Semirings: sup-inf (R ∪ {± ∞}, sup, inf) and tropical (R ∪ {+ ∞}, inf, +)
  • Used 3 original benchmarks (automotive):
  • Inspired by ST-Lib [Kapinski+, SAE Technical Paper’16]
  • Overshoot: |vref - v| gets large after vref changed
  • Only matches the sub-signals of length < 150 time units
  • Ringing: v(t) - v(t-10) gets positive and negative repeatedly
  • Only matches the sub-signals of length < 80 time units
  • Overshoot (unbounded): |vref - v| gets large after vref changed
  • No such bounded
  • Amazon EC2 c4.large instance / Ubuntu 18.04 LTS (64 bit)
  • 2.9 GHz Intel Xeon E5-2666 v3, 2 vCPUs, 3.75 GiB RAM

Environment of Experiments

32

slide-68
SLIDE 68
  • M. Waga (NII)

Execution Time

33

  • Execution time is linear for the bounded spec.
  • 1,000 entries / 1 or 2 sec.
  • Execution time explodes for the unbounded spec.

20 40 60 80 100 120 140 1 2 3 4 5 6 Execution time [s] Number of entries of the signal [×10, 000] Overshoot, sup-inf Ringing sup-inf Overshoot, tropical Ringing tropical 20 40 60 80 100 120 140 1 2 3 4 5 6 7 8 9 10 Execution time [s] Number of entries of the signal [×100]

Overshoot (Unbounded), sup-inf Overshoot (Unbounded), tropical

Bounded Unbounded

slide-69
SLIDE 69
  • M. Waga (NII)

Conclusion

  • Introduced timed symbolic weighted automata (TSWA)
  • TSWA: TA with signal constraints + weight function
  • Gave quantitative monitoring/timed pattern matching

algorithm

  • Idea: zone construction with weight
  • Implementation + experiments
  • scalable for bounded specifications

34

slide-70
SLIDE 70
  • M. Waga (NII)

Appendix

35

slide-71
SLIDE 71
  • M. Waga (NII)

Example: “Robust” Semantics

36

r

  • u, (a1a2 . . . am)
  • =

inf

i∈{1,2,...,n} r(u, (ai))

r n ^

i=1

(xi . /i di), (a)

  • =

inf

i∈{1,2,...,n} r(xi .

/i di, (a)) where . /i2 {>, , , <} r(x d, (a)) = a(x) d where 2 {, >} r(x d, (a)) = d a(x) where 2 {, <}

Weight Function: minimum distance from the threshold Semiring: sup-inf semiring

Robustness

slide-72
SLIDE 72
  • M. Waga (NII)

Example: “Robust” Semantics

36

r

  • u, (a1a2 . . . am)
  • =

inf

i∈{1,2,...,n} r(u, (ai))

r n ^

i=1

(xi . /i di), (a)

  • =

inf

i∈{1,2,...,n} r(xi .

/i di, (a)) where . /i2 {>, , , <} r(x d, (a)) = a(x) d where 2 {, >} r(x d, (a)) = d a(x) where 2 {, <}

Weight Function: minimum distance from the threshold Semiring: sup-inf semiring

Boolean sup-inf tropical

S

{True/False} R ∪ {±∞} R ∪ {+∞}

⊕ ∨ sup inf ⊗ ∧ inf +

Robustness

slide-73
SLIDE 73
  • M. Waga (NII)

Insights: Zone Construction with Weight

  • The construction is basically same as the usual zone

construction

  • The state space is finite thanks to zones and finite

horizon of the input signal

  • The weight is constant because the signal is

piecewise-constant

37

slide-74
SLIDE 74
  • M. Waga (NII)

Comparison of the semiring

38

t v 13.0 7.0

l0, v < 15 start l1, v > 5 l2, > c < 5 /c := 0 c < 10

Boolean sup-inf tropical

S

{True/False} R ∪ {±∞} R ∪ {+∞}

⊕ ∨ sup inf ⊗ ∧ inf +

κ(v < 15, {v=13}) = 2

→(l0, c=0, 0,ε) (l0, c=2, 2, {v = 7}) (l1, c=0, 3, ε) (l1, c=5, 7, {v = 7}{v = 12}) (l2, c=5, 7, ε)

κ(v > 5, {v=13}) = 8

Sup-inf semiring Tropical semiring

2 ⊗ 8 = inf (2, 8) = 2 2 ⊗ 8 = 2 + 8 = 10