Measuring with Timed Patterns CAV’15 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, signal processing blocks, etc. ◮ ad-hoc approach
Declarative language for measurements measure behavior aggregation identification w ( t i , t ′ i ) m i ϕ µ [0 , T ] → R n R 2 R ◮ timed regular expression ϕ describes intervals where measure can be taken ◮ continuous aggregating operators µ : duration, integral, maximum, etc.
Declarative language for measurements measure behavior aggregation identification w ( t i , t ′ i ) m i ϕ µ [0 , T ] → R n R 2 R ◮ timed regular expression ϕ describes intervals where measure can be taken ◮ continuous aggregating operators µ : duration, integral, maximum, etc.
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 ′ iff ∀ t < t ′′ < t ′ , p ∈ w [ t ′′ ] ( t, t ′ ) ∈ � p � w iff ∃ t ≤ t ′′ ≤ t ′ , ( t, t ′′ ) ∈ � ϕ � w and ( t ′′ , t ′ ) ∈ � ψ � w ( t, t ′ ) ∈ � ϕ · ψ � w ( t, t ′ ) ∈ � ϕ ∨ ψ � w iff . . . ( t, t ′ ) ∈ � ϕ ∧ ψ � w iff . . . ( t, t ′ ) ∈ � ϕ ∗ � w iff . . . iff l ≤ t ′ − t ≤ u and ( t, t ′ ) ∈ � ϕ � w ( t, t ′ ) ∈ � � ϕ � [ l,u ] � w
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 ′ iff ∀ t < t ′′ < t ′ , p ∈ w [ t ′′ ] ( t, t ′ ) ∈ � p � w iff ∃ t ≤ t ′′ ≤ t ′ , ( t, t ′′ ) ∈ � ϕ � w and ( t ′′ , t ′ ) ∈ � ψ � w ( t, t ′ ) ∈ � ϕ · ψ � w ( t, t ′ ) ∈ � ϕ ∨ ψ � w iff . . . ( t, t ′ ) ∈ � ϕ ∧ ψ � w iff . . . ( t, t ′ ) ∈ � ϕ ∗ � w iff . . . iff l ≤ t ′ − t ≤ u and ( t, t ′ ) ∈ � ϕ � w ( t, t ′ ) ∈ � � ϕ � [ l,u ] � w
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 ϕ t i < t < t ′ < t i +1 z p � z ϕ ◦ z ψ z ϕ · ψ � . . . z ϕ ∧ l < t ′ − t < u z � ϕ � [ l,u ] �
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 ϕ t i < t < t ′ < t i +1 z p � z ϕ ◦ z ψ z ϕ · ψ � . . . z ϕ ∧ l < t ′ − t < u z � ϕ � [ l,u ] �
Example Expressions: ϕ = � p � [1 , 5] ψ = � q � [0 , 2] ϕ · ψ Set of matches: 8 7 ϕ · ψ ψ 6 5 4 3 ϕ 2 1 0 p q 0 1 2 3 4 5 6 7 8
Example Expressions: ϕ = � p � [1 , 5] ψ = � q � [0 , 2] ϕ · ψ Set of matches: ϕ · ψ ψ • • t ′ • ϕ p q t t ′′ t ′
Conditional expressions Introduce preconditions and postconditions . Definition (Syntax of Conditional TRE) ϕ := . . . | ϕ · ϕ | . . . | ϕ ? ϕ | ϕ ! ϕ Definition (Semantics of Conditional TRE) . . . ∃ t ≤ t ′′ ≤ t ′ ( t, t ′ ) ∈ � ϕ · ψ � w ( t, t ′′ ) ∈ � ϕ � w ( t ′′ , t ′ ) ∈ � ψ � w iff and . . . ∃ t ′′ ≤ t ( t, t ′ ) ∈ � ψ ? ϕ � w ( t, t ′ ) ∈ � ϕ � w ( t ′′ , t ) ∈ � ψ � w iff and ∃ t ′ ≤ t ′′ ( t, t ′ ) ∈ � ϕ ! ψ � w ( t, t ′ ) ∈ � ϕ � w ( t ′ , t ′′ ) ∈ � ψ � w iff and
Conditional expressions Introduce preconditions and postconditions . Definition (Syntax of Conditional TRE) ϕ := . . . | ϕ · ϕ | . . . | ϕ ? ϕ | ϕ ! ϕ Definition (Semantics of Conditional TRE) . . . ∃ t ≤ t ′′ ≤ t ′ ( t, t ′ ) ∈ � ϕ · ψ � w ( t, t ′′ ) ∈ � ϕ � w ( t ′′ , t ′ ) ∈ � ψ � w iff and . . . ∃ t ′′ ≤ t ( t, t ′ ) ∈ � ψ ? ϕ � w ( t, t ′ ) ∈ � ϕ � w ( t ′′ , t ) ∈ � ψ � w iff and ∃ t ′ ≤ t ′′ ( t, t ′ ) ∈ � ϕ ! ψ � w ( t, t ′ ) ∈ � ϕ � w ( t ′ , t ′′ ) ∈ � ψ � w iff and
Conditional expressions Introduce preconditions and postconditions . Definition (Syntax of Conditional TRE) ϕ := . . . | ϕ · ϕ | . . . | ϕ ? ϕ | ϕ ! ϕ Definition (Semantics of Conditional TRE) . . . ∃ t ≤ t ′′ ≤ t ′ ( t, t ′ ) ∈ � ϕ · ψ � w ( t, t ′′ ) ∈ � ϕ � w ( t ′′ , t ′ ) ∈ � ψ � w iff and . . . ∃ t ′′ ≤ t ( t, t ′ ) ∈ � ψ ? ϕ � w ( t, t ′ ) ∈ � ϕ � w ( t ′′ , t ) ∈ � ψ � w iff and ∃ t ′ ≤ t ′′ ( t, t ′ ) ∈ � ϕ ! ψ � w ( t, t ′ ) ∈ � ϕ � w ( t ′ , t ′′ ) ∈ � ψ � w iff and
Example Expressions: ϕ = � p � [1 , 5] ψ = � q � [0 , 2] ϕ ! ψ ϕ ! ψ Set of matches: 8 8 7 7 ψ ψ 6 6 ϕ ? ψ 5 5 ϕ ! ψ 4 4 3 3 ϕ ϕ 2 2 1 1 0 0 p p q q 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8
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.
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.
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.
Example Expressions: ↓ p ↑ q ϕ = � p � [1 , 5] ↑ q · ϕ · ↓ p Set of matches: 8 7 6 ↑ q · ϕ · ↓ p • • 5 ϕ ↓ p 4 3 • ↑ q 2 1 0 p q 0 1 2 3 4 5 6 7 8
Measurements Measure Pattern A Conditional TRE ϕ = α ? ψ ! β with arbitrary conditions α, β , and ψ event-bounded. Measure Expression An expression µ ( ϕ ) with ϕ a measure pattern, and µ = duration , sup x , integral x , . . . continuous aggregation operator.
Measurements Measure Pattern A Conditional TRE ϕ = α ? ψ ! β with arbitrary conditions α, β , and ψ event-bounded. Measure Expression An expression µ ( ϕ ) with ϕ a measure pattern, and µ = duration , sup x , integral x , . . . continuous aggregation operator.
DSI3 standard CONTROLER SENSOR i R e ( t ) v a ( t ) C ◮ Analog communication protocol ◮ Communication via pulses on ◮ voltage line v ◮ current line i ◮ Two phases with different nominal levels ◮ discovery mode: v in range V 0 to V 1 ◮ command and response mode: v in range V 2 to V 3
DSI3 standard CONTROLER SENSOR i R e ( t ) v a ( t ) C ◮ Analog communication protocol ◮ Communication via pulses on ◮ voltage line v ◮ current line i ◮ Two phases with different nominal levels ◮ discovery mode: v in range V 0 to V 1 ◮ command and response mode: v in range V 2 to V 3
DSI3 standard CONTROLER SENSOR i R e ( t ) v a ( t ) C ◮ Analog communication protocol ◮ Communication via pulses on ◮ voltage line v ◮ current line i ◮ Two phases with different nominal levels ◮ discovery mode: v in range V 0 to V 1 ◮ command and response mode: v in range V 2 to V 3
Model and requirements CONTROLER SENSOR i R e ( t ) v a ( t ) C ◮ 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
Model and requirements CONTROLER SENSOR i R e ( t ) v a ( t ) C ◮ 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
Model and requirements CONTROLER SENSOR i R e ( t ) v a ( t ) C ◮ 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
Recommend
More recommend