Measuring with Timed Patterns CAV15 ere 1 Oded Maler 1 Dejan - - PowerPoint PPT Presentation

measuring with timed patterns
SMART_READER_LITE
LIVE PREVIEW

Measuring with Timed Patterns CAV15 ere 1 Oded Maler 1 Dejan - - PowerPoint PPT Presentation

Measuring with Timed Patterns CAV15 ere 1 Oded Maler 1 Dejan Nickovic 2 Dogan Ulus 1 Thomas Ferr` 1 VERIMAG University of Grenoble / CNRS 2 AIT Austrian Institute of Technology July 24, 2015 Measurements current practice... scripts,


slide-1
SLIDE 1

Measuring with Timed Patterns

CAV’15 Thomas Ferr` ere1 Oded Maler1 Dejan Nickovic2 Dogan Ulus1

1 VERIMAG University of Grenoble / CNRS 2 AIT Austrian Institute of Technology

July 24, 2015

slide-2
SLIDE 2

Measurements current practice...

◮ scripts, signal processing blocks, etc. ◮ ad-hoc approach

slide-3
SLIDE 3

Declarative language for measurements

w [0, T] → Rn ϕ behavior identification (ti, t′

i)

R2 µ measure aggregation mi R

◮ timed regular expression ϕ describes intervals where measure can be

taken

◮ continuous aggregating operators µ: duration, integral, maximum, etc.

slide-4
SLIDE 4

Declarative language for measurements

w [0, T] → Rn ϕ behavior identification (ti, t′

i)

R2 µ measure aggregation mi R

◮ timed regular expression ϕ describes intervals where measure can be

taken

◮ continuous aggregating operators µ: duration, integral, maximum, etc.

slide-5
SLIDE 5

Timed regular expressions – interval semantics

Definition (Syntax of TRE)

ϕ := ǫ | p | ϕ · ϕ | ϕ ∨ ϕ | ϕ ∧ ϕ | ϕ∗ | ϕ[l,u] p proposition, and l, u integer constants.

Definition (Semantics of TRE)

(t, t′) ∈ ǫw iff t = t′ (t, t′) ∈ pw iff ∀t < t′′ < t′, p ∈ w[t′′] (t, t′) ∈ ϕ · ψw iff ∃t ≤ t′′ ≤ t′, (t, t′′) ∈ ϕw and (t′′, t′) ∈ ψw (t, t′) ∈ ϕ ∨ ψw iff . . . (t, t′) ∈ ϕ ∧ ψw iff . . . (t, t′) ∈ ϕ∗w iff . . . (t, t′) ∈ ϕ[l,u]w iff l ≤ t′ − t ≤ u and (t, t′) ∈ ϕw

slide-6
SLIDE 6

Timed regular expressions – interval semantics

Definition (Syntax of TRE)

ϕ := ǫ | p | ϕ · ϕ | ϕ ∨ ϕ | ϕ ∧ ϕ | ϕ∗ | ϕ[l,u] p proposition, and l, u integer constants.

Definition (Semantics of TRE)

(t, t′) ∈ ǫw iff t = t′ (t, t′) ∈ pw iff ∀t < t′′ < t′, p ∈ w[t′′] (t, t′) ∈ ϕ · ψw iff ∃t ≤ t′′ ≤ t′, (t, t′′) ∈ ϕw and (t′′, t′) ∈ ψw (t, t′) ∈ ϕ ∨ ψw iff . . . (t, t′) ∈ ϕ ∧ ψw iff . . . (t, t′) ∈ ϕ∗w iff . . . (t, t′) ∈ ϕ[l,u]w iff l ≤ t′ − t ≤ u and (t, t′) ∈ ϕw

slide-7
SLIDE 7

Timed pattern matching

Theorem (FORMATS’14)

The set of matches ϕw is computable as a finite union of 2d zones

Proof principle

Structural induction over ϕ zp

  • ti < t < t′ < ti+1

zϕ·ψ

  • zϕ ◦ zψ

. . . zϕ[l,u]

  • zϕ ∧ l < t′ − t < u
slide-8
SLIDE 8

Timed pattern matching

Theorem (FORMATS’14)

The set of matches ϕw is computable as a finite union of 2d zones

Proof principle

Structural induction over ϕ zp

  • ti < t < t′ < ti+1

zϕ·ψ

  • zϕ ◦ zψ

. . . zϕ[l,u]

  • zϕ ∧ l < t′ − t < u
slide-9
SLIDE 9

Example

Expressions: ϕ = p[1,5] ψ = q[0,2] ϕ · ψ Set of matches:

1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 ϕ ψ ϕ · ψ p q

slide-10
SLIDE 10

Example

Expressions: ϕ = p[1,5] ψ = q[0,2] ϕ · ψ Set of matches:

t′ t t′ t′′

  • ϕ

ψ ϕ · ψ p q

slide-11
SLIDE 11

Conditional expressions

Introduce preconditions and postconditions.

Definition (Syntax of Conditional TRE)

ϕ := . . . | ϕ · ϕ | . . . | ϕ ? ϕ | ϕ ! ϕ

Definition (Semantics of Conditional TRE)

. . . (t, t′) ∈ ϕ · ψw iff ∃t ≤ t′′ ≤ t′ (t, t′′) ∈ ϕw and (t′′, t′) ∈ ψw . . . (t, t′) ∈ ψ ? ϕw iff ∃t′′ ≤ t (t, t′) ∈ ϕw and (t′′, t) ∈ ψw (t, t′) ∈ ϕ ! ψw iff ∃t′ ≤ t′′ (t, t′) ∈ ϕw and (t′, t′′) ∈ ψw

slide-12
SLIDE 12

Conditional expressions

Introduce preconditions and postconditions.

Definition (Syntax of Conditional TRE)

ϕ := . . . | ϕ · ϕ | . . . | ϕ ? ϕ | ϕ ! ϕ

Definition (Semantics of Conditional TRE)

. . . (t, t′) ∈ ϕ · ψw iff ∃t ≤ t′′ ≤ t′ (t, t′′) ∈ ϕw and (t′′, t′) ∈ ψw . . . (t, t′) ∈ ψ ? ϕw iff ∃t′′ ≤ t (t, t′) ∈ ϕw and (t′′, t) ∈ ψw (t, t′) ∈ ϕ ! ψw iff ∃t′ ≤ t′′ (t, t′) ∈ ϕw and (t′, t′′) ∈ ψw

slide-13
SLIDE 13

Conditional expressions

Introduce preconditions and postconditions.

Definition (Syntax of Conditional TRE)

ϕ := . . . | ϕ · ϕ | . . . | ϕ ? ϕ | ϕ ! ϕ

Definition (Semantics of Conditional TRE)

. . . (t, t′) ∈ ϕ · ψw iff ∃t ≤ t′′ ≤ t′ (t, t′′) ∈ ϕw and (t′′, t′) ∈ ψw . . . (t, t′) ∈ ψ ? ϕw iff ∃t′′ ≤ t (t, t′) ∈ ϕw and (t′′, t) ∈ ψw (t, t′) ∈ ϕ ! ψw iff ∃t′ ≤ t′′ (t, t′) ∈ ϕw and (t′, t′′) ∈ ψw

slide-14
SLIDE 14

Example

Expressions: ϕ = p[1,5] ψ = q[0,2] ϕ ! ψ ϕ ! ψ Set of matches:

1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 ϕ ψ ϕ ? ψ p q 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 ϕ ψ ϕ ! ψ p q

slide-15
SLIDE 15

Expressions with events

Events

Zero-duration expressions: ↑ p = p ? ǫ ! p (rising edge) ↓ p = p ? ǫ ! p (falling edge)

Event-bounded expressions

Syntactically enforced: ψ := ↑ p | ↓ p | ψ · ϕ · ψ | ψ ∪ ψ | ψ ∩ ϕ with ϕ arbitrary expression

Proposition (Finiteness)

Event-bounded expressions have a finite set of matches.

slide-16
SLIDE 16

Expressions with events

Events

Zero-duration expressions: ↑ p = p ? ǫ ! p (rising edge) ↓ p = p ? ǫ ! p (falling edge)

Event-bounded expressions

Syntactically enforced: ψ := ↑ p | ↓ p | ψ · ϕ · ψ | ψ ∪ ψ | ψ ∩ ϕ with ϕ arbitrary expression

Proposition (Finiteness)

Event-bounded expressions have a finite set of matches.

slide-17
SLIDE 17

Expressions with events

Events

Zero-duration expressions: ↑ p = p ? ǫ ! p (rising edge) ↓ p = p ? ǫ ! p (falling edge)

Event-bounded expressions

Syntactically enforced: ψ := ↑ p | ↓ p | ψ · ϕ · ψ | ψ ∪ ψ | ψ ∩ ϕ with ϕ arbitrary expression

Proposition (Finiteness)

Event-bounded expressions have a finite set of matches.

slide-18
SLIDE 18

Example

Expressions: ↓ p ↑ q ϕ = p[1,5] ↑ q · ϕ · ↓ p Set of matches:

1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8

  • ↓ p

↑ q ϕ ↑ q · ϕ · ↓ p p q

slide-19
SLIDE 19

Measurements

Measure Pattern

A Conditional TRE ϕ = α ? ψ ! β with arbitrary conditions α, β, and ψ event-bounded.

Measure Expression

An expression µ(ϕ) with ϕ a measure pattern, and µ = duration, supx, integralx, . . . continuous aggregation operator.

slide-20
SLIDE 20

Measurements

Measure Pattern

A Conditional TRE ϕ = α ? ψ ! β with arbitrary conditions α, β, and ψ event-bounded.

Measure Expression

An expression µ(ϕ) with ϕ a measure pattern, and µ = duration, supx, integralx, . . . continuous aggregation operator.

slide-21
SLIDE 21

DSI3 standard

e(t) a(t) R C CONTROLER SENSOR i v

◮ Analog communication protocol ◮ Communication via pulses on

◮ voltage line v ◮ current line i

◮ Two phases with different nominal levels

◮ discovery mode: v in range V0 to V1 ◮ command and response mode: v in range V2 to V3

slide-22
SLIDE 22

DSI3 standard

e(t) a(t) R C CONTROLER SENSOR i v

◮ Analog communication protocol ◮ Communication via pulses on

◮ voltage line v ◮ current line i

◮ Two phases with different nominal levels

◮ discovery mode: v in range V0 to V1 ◮ command and response mode: v in range V2 to V3

slide-23
SLIDE 23

DSI3 standard

e(t) a(t) R C CONTROLER SENSOR i v

◮ Analog communication protocol ◮ Communication via pulses on

◮ voltage line v ◮ current line i

◮ Two phases with different nominal levels

◮ discovery mode: v in range V0 to V1 ◮ command and response mode: v in range V2 to V3

slide-24
SLIDE 24

Model and requirements

e(t) a(t) R C CONTROLER SENSOR i v

◮ Behavioral model:

◮ gaussian distribution of pulse timing ◮ uniform distribution of sensor load resistance

◮ Simulation: 100 sequences of discovery + command and response ◮ Measurements:

  • 1. time between consecutive discovery pulses
  • 2. energy transmitted through power pulses
slide-25
SLIDE 25

Model and requirements

e(t) a(t) R C CONTROLER SENSOR i v

◮ Behavioral model:

◮ gaussian distribution of pulse timing ◮ uniform distribution of sensor load resistance

◮ Simulation: 100 sequences of discovery + command and response ◮ Measurements:

  • 1. time between consecutive discovery pulses
  • 2. energy transmitted through power pulses
slide-26
SLIDE 26

Model and requirements

e(t) a(t) R C CONTROLER SENSOR i v

◮ Behavioral model:

◮ gaussian distribution of pulse timing ◮ uniform distribution of sensor load resistance

◮ Simulation: 100 sequences of discovery + command and response ◮ Measurements:

  • 1. time between consecutive discovery pulses
  • 2. energy transmitted through power pulses
slide-27
SLIDE 27

Model and requirements

e(t) a(t) R C CONTROLER SENSOR i v

◮ Behavioral model:

◮ gaussian distribution of pulse timing ◮ uniform distribution of sensor load resistance

◮ Simulation: 100 sequences of discovery + command and response ◮ Measurements:

  • 1. time between consecutive discovery pulses
  • 2. energy transmitted through power pulses
slide-28
SLIDE 28

Measurement 1: time between consecutive discovery pulses

time between 2 consecutive pulses ∈ [l, u] ϕ1 ↓ c V0 V1 b b a c ↓ c ↑ c

◮ Voltage levels:

a ≡ v ≤ V0 b ≡ V0 ≤ v ≤ V1 c ≡ v ≥ V1

◮ Pulse pattern:

ϕ1 ≡ ↓ c · b · a · b[l,u] · ↑ c

◮ Measure expression: M1 = duration(ϕ1 · c ! ϕ1)

slide-29
SLIDE 29

Measurement 1: time between consecutive discovery pulses

time between 2 consecutive pulses ∈ [l, u] ϕ1 ↓ c V0 V1 b b a c ↓ c ↑ c

◮ Voltage levels:

a ≡ v ≤ V0 b ≡ V0 ≤ v ≤ V1 c ≡ v ≥ V1

◮ Pulse pattern:

ϕ1 ≡ ↓ c · b · a · b[l,u] · ↑ c

◮ Measure expression: M1 = duration(ϕ1 · c ! ϕ1)

slide-30
SLIDE 30

Measurement 1: time between consecutive discovery pulses

time between 2 consecutive pulses ∈ [l, u] ϕ1 ↓ c V0 V1 b b a c ↓ c ↑ c

◮ Voltage levels:

a ≡ v ≤ V0 b ≡ V0 ≤ v ≤ V1 c ≡ v ≥ V1

◮ Pulse pattern:

ϕ1 ≡ ↓ c · b · a · b[l,u] · ↑ c

◮ Measure expression: M1 = duration(ϕ1 · c ! ϕ1)

slide-31
SLIDE 31

Measurement 2: energy transmitted during power pulses

Power Phase i V2 V3

◮ Voltage levels:

e ≡ v ≥ V2 f ≡ V2 ≤ v ≤ V3 g ≡ v ≥ V3

◮ Pulse pattern:

ϕ2 ≡ ↑ e · f · g · f · ↓ e

◮ Measure expression: M2 := integralv×i(ϕ2)

slide-32
SLIDE 32

Measurement 2: energy transmitted during power pulses

Power Phase i V2 V3

◮ Voltage levels:

e ≡ v ≥ V2 f ≡ V2 ≤ v ≤ V3 g ≡ v ≥ V3

◮ Pulse pattern:

ϕ2 ≡ ↑ e · f · g · f · ↓ e

◮ Measure expression: M2 := integralv×i(ϕ2)

slide-33
SLIDE 33

Measurement 2: energy transmitted during power pulses

Power Phase i V2 V3

◮ Voltage levels:

e ≡ v ≥ V2 f ≡ V2 ≤ v ≤ V3 g ≡ v ≥ V3

◮ Pulse pattern:

ϕ2 ≡ ↑ e · f · g · f · ↓ e

◮ Measure expression: M2 := integralv×i(ϕ2)

slide-34
SLIDE 34

Results

235.0 240.0 245.0 250.0 255.0 260.0 265.0

Measured duration (µs)

5 10 15 20 25 30 35

Number of occurrence

3.5 3.6 3.7 3.8 3.9 4.0 4.1 4.2 4.3

Measured energy (mJ)

1 2 3 4 5 6 7 8

Number of occurrence

slide-35
SLIDE 35

Performance

Computation time (seconds) relative to sampling rate: Measure 1 Measure 2 samples Tp Tϕ Tµ T Tp Tϕ Tµ T 1M 0.047 0.617 0.000 0.664 0.009 0.004 0.011 0.024 5M 0.197 0.612 0.000 0.809 0.050 0.005 0.047 0.103 10M 0.386 0.606 0.000 0.992 0.101 0.005 0.100 0.216 20M 0.759 0.609 0.000 1.368 0.203 0.005 0.260 0.468 Program:

◮ TRE matching algorithms based on IF library ◮ Python signal processing library

slide-36
SLIDE 36

Conclusion

Present

◮ declarative language for mixed-signal measurements ◮ general and efficient to monitor

Future

◮ language extension ◮ online measurements