A Formally Verified, Optimized Monitor for Metric First-Order - - PowerPoint PPT Presentation

a formally verified optimized monitor
SMART_READER_LITE
LIVE PREVIEW

A Formally Verified, Optimized Monitor for Metric First-Order - - PowerPoint PPT Presentation

A Formally Verified, Optimized Monitor for Metric First-Order Dynamic Logic David Basin, Thibault Dardinier, Lukas Heimes, Sran Krsti , Martin Raszyk , Joshua Schneider and Dmitriy Traytel Department of Computer Science 1 Dmitriy Joshua


slide-1
SLIDE 1

A Formally Verified, Optimized Monitor

for Metric First-Order Dynamic Logic

David Basin, Thibault Dardinier, Lukas Heimes, Srđan Krstić, Martin Raszyk, Joshua Schneider and Dmitriy Traytel

Department of Computer Science

1

slide-2
SLIDE 2

Dmitriy Joshua Srđan Martin Rocket engineer Monitoring researcher Working formalizer Quality assurer

All characters and events mentioned in this presentation are entirely fictitious.

The paper is real.

2

slide-3
SLIDE 3

Act I: Going to Space

Dmitriy Joshua Rocket engineer Monitoring researcher Where: WASA Cafeteria When: One week before the IJCAR deadline

3

slide-4
SLIDE 4

Monitoring

Background image: NASA/JPL-Caltech/MSSS 4

slide-5
SLIDE 5

Monitoring

Correct behavior?

Background image: NASA/JPL-Caltech/MSSS 4

slide-6
SLIDE 6

Monitoring

Correct behavior? Observations at runtime

Background image: NASA/JPL-Caltech/MSSS 4

slide-7
SLIDE 7

Monitoring

Correct behavior? Observations at runtime Monitor

Background image: NASA/JPL-Caltech/MSSS 4

slide-8
SLIDE 8

Specifications

Metric First-Order Temporal Logic (MFOTL) with aggregations

5

slide-9
SLIDE 9

Specifications

Metric First-Order Temporal Logic (MFOTL) with aggregations t ::= x | c | t + t | t × t | ... ϕ ::= p(t1,...,tn) | t = t | t < t | t ≤ t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ | x ← Ω x;

  • x. ϕ | ...

Ω ::= MAX | MIN | CNT | SUM | AVG I ::= [N,N ∪ {∞}]

5

slide-10
SLIDE 10

Specifications

Metric First-Order Temporal Logic (MFOTL) with aggregations t ::= x | c | t + t | t × t | ... ϕ ::= p(t1,...,tn) | t = t | t < t | t ≤ t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ | x ← Ω x;

  • x. ϕ | ...

Ω ::= MAX | MIN | CNT | SUM | AVG I ::= [N,N ∪ {∞}] Examples: Published reports must have been approved in the past seven days. publish(r) → [0,7d] approve(r)

(where I ϕ = true SI ϕ)

5

slide-11
SLIDE 11

Specifications

Metric First-Order Temporal Logic (MFOTL) with aggregations t ::= x | c | t + t | t × t | ... ϕ ::= p(t1,...,tn) | t = t | t < t | t ≤ t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ | x ← Ω x;

  • x. ϕ | ...

Ω ::= MAX | MIN | CNT | SUM | AVG I ::= [N,N ∪ {∞}] Examples: Published reports must have been approved in the past seven days. publish(r) → [0,7d] approve(r)

(where I ϕ = true SI ϕ)

Maximum radiation must not exceed 3 Roentgen. (m ← MAX x. rad(x)) → m ≤ 3

5

slide-12
SLIDE 12

Monitors

. . . 29/05/2020 15:03 approve(report41) 29/05/2020 15:24 publish(report41) 09/06/2020 13:45 approve(report67) 10/06/2020 07:51 publish(report41) 10/06/2020 07:52 publish(report67) . . .

Log/trace/event stream

. . . ✓ ✓ ✓ ✗ (report41) ✓ . . .

Verdict

[JACM 2015] publish(r) → [0,7d] approve(r)

Formal specification

6

slide-13
SLIDE 13

Monitors

. . . 29/05/2020 15:03 approve(report41) 29/05/2020 15:24 publish(report41) 09/06/2020 13:45 approve(report67) 10/06/2020 07:51 publish(report41) 10/06/2020 07:52 publish(report67) . . .

Log/trace/event stream

. . . ✓ ✓ ✓ ✗ (report41) ✓ . . .

Verdict

[JACM 2015] publish(r) → [0,7d] approve(r)

Formal specification

[RV 2019]

6

slide-14
SLIDE 14

Let’s try ...

Spec 1: The robot must not start to move if three or more transmissions of the same data failed within the last ten minutes without a successful transmission in between.

7

slide-15
SLIDE 15

Let’s try ...

Spec 1: The robot must not start to move if three or more transmissions of the same data failed within the last ten minutes without a successful transmission in between. Spec 2: The module with the highest energy consumption within the second to last minute must be reported to ground control.

7

slide-16
SLIDE 16

MFOTL with aggregations t ::= x | c | t + t | t × t | ... ϕ ::= p(t1,...,tn) | t = t | t < t | t ≤ t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ | x ← Ω t;

  • x. ϕ

Ω ::= MAX | MIN | CNT | SUM | AVG I ::= [N,N ∪ {∞}] subset of MFOTL no aggregations t ::= x | c ϕ ::= p(t1,...,tn) | t = t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ I ::= [N,N ∪ {∞}]

8

slide-17
SLIDE 17

MFOTL with aggregations t ::= x | c | t + t | t × t | ... ϕ ::= p(t1,...,tn) | t = t | t < t | t ≤ t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ | x ← Ω t;

  • x. ϕ

Ω ::= MAX | MIN | CNT | SUM | AVG I ::= [N,N ∪ {∞}] subset of MFOTL no aggregations t ::= x | c ϕ ::= p(t1,...,tn) | t = t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ cannot express Spec 2! I ::= [N,N ∪ {∞}]

8

slide-18
SLIDE 18

MFOTL with aggregations t ::= x | c | t + t | t × t | ... ϕ ::= p(t1,...,tn) | t = t | t < t | t ≤ t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ | x ← Ω t;

  • x. ϕ

Ω ::= MAX | MIN | CNT | SUM | AVG I ::= [N,N ∪ {∞}] subset of MFOTL no aggregations t ::= x | c ϕ ::= p(t1,...,tn) | t = t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ I ::= [N,N ∪ {∞}] Spec 1 in MFOTL:

  • x∈N6,
  • i xi=600

[0,x1](¬com_ok(d) S[0,x2] (com_fail(d) ∧ [0,x3](¬com_ok(d) S[0,x4] (com_fail(d) ∧ [0,x5](¬com_ok(d) S[0,x6] com_fail(d))))))

  • → ¬move

8

slide-19
SLIDE 19

MFOTL with aggregations t ::= x | c | t + t | t × t | ... ϕ ::= p(t1,...,tn) | t = t | t < t | t ≤ t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ | x ← Ω t;

  • x. ϕ

Ω ::= MAX | MIN | CNT | SUM | AVG I ::= [N,N ∪ {∞}] subset of MFOTL no aggregations t ::= x | c ϕ ::= p(t1,...,tn) | t = t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ I ::= [N,N ∪ {∞}] Spec 1 in MFOTL:

  • [0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,0](¬com_ok(d) S[0,600]

com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0]

(com_fail(d) ∧ [0,0](¬com_ok(d) S[0,0] (com_fail(d) ∧ [0,1](¬com_ok(d) S[0,599] com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0]

(com_fail(d) ∧ [0,0](¬com_ok(d) S[0,0] (com_fail(d) ∧ [0,2](¬com_ok(d) S[0,598] com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,3](¬com_ok(d) S[0,597]

com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0]

(com_fail(d) ∧ [0,0](¬com_ok(d) S[0,0] (com_fail(d) ∧ [0,4](¬com_ok(d) S[0,596] com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0]

(com_fail(d) ∧ [0,0](¬com_ok(d) S[0,0] (com_fail(d) ∧ [0,5](¬com_ok(d) S[0,595] com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,6](¬com_ok(d) S[0,594]

com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0]

(com_fail(d) ∧ [0,0](¬com_ok(d) S[0,0] (com_fail(d) ∧ [0,7](¬com_ok(d) S[0,593] com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0]

(com_fail(d) ∧ [0,0](¬com_ok(d) S[0,0] (com_fail(d) ∧ [0,8](¬com_ok(d) S[0,592] com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,9](¬com_ok(d) S[0,591]

com_fail(d))))))

  • ∨ ...

664 353 676 371 disjuncts, assuming discrete time in seconds

8

slide-20
SLIDE 20

MFOTL with aggregations t ::= x | c | t + t | t × t | ... ϕ ::= p(t1,...,tn) | t = t | t < t | t ≤ t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ | x ← Ω t;

  • x. ϕ

Ω ::= MAX | MIN | CNT | SUM | AVG I ::= [N,N ∪ {∞}] subset of MFOTL no aggregations t ::= x | c ϕ ::= p(t1,...,tn) | t = t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ I ::= [N,N ∪ {∞}] Spec 1 in MFOTL:

  • [0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,0](¬com_ok(d) S[0,600]

com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0]

(com_fail(d) ∧ [0,0](¬com_ok(d) S[0,0] (com_fail(d) ∧ [0,1](¬com_ok(d) S[0,599] com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0]

(com_fail(d) ∧ [0,0](¬com_ok(d) S[0,0] (com_fail(d) ∧ [0,2](¬com_ok(d) S[0,598] com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,3](¬com_ok(d) S[0,597]

com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0]

(com_fail(d) ∧ [0,0](¬com_ok(d) S[0,0] (com_fail(d) ∧ [0,4](¬com_ok(d) S[0,596] com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0]

(com_fail(d) ∧ [0,0](¬com_ok(d) S[0,0] (com_fail(d) ∧ [0,5](¬com_ok(d) S[0,595] com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,6](¬com_ok(d) S[0,594]

com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0]

(com_fail(d) ∧ [0,0](¬com_ok(d) S[0,0] (com_fail(d) ∧ [0,7](¬com_ok(d) S[0,593] com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0]

(com_fail(d) ∧ [0,0](¬com_ok(d) S[0,0] (com_fail(d) ∧ [0,8](¬com_ok(d) S[0,592] com_fail(d))))))

  • [0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,0](¬com_ok(d) S[0,0] (com_fail(d)∧[0,9](¬com_ok(d) S[0,591]

com_fail(d))))))

  • ∨ ...

664 353 676 371 disjuncts, assuming discrete time in seconds

0.001 0.01 0.1 1 10 10 100 1000 Time [s] Event-rate M

  • n

P

  • l

y VeriMon

8

slide-21
SLIDE 21

Act II: Groundwork on Expressiveness

Joshua Srđan Monitoring researcher Working formalizer Where: VeriMon Headquaters When: 5 days before the IJCAR deadline

9

slide-22
SLIDE 22

Regular expressions

Recall Spec 1: The robot must not start to move if three or more transmissions of the same data failed in a row within the last ten minutes.

com_fail(d) com_fail(d) com_fail(d) move ¬com_ok(d) ¬com_ok(d) ¬com_ok(d) ≤ 600s

10

slide-23
SLIDE 23

Regular expressions

Recall Spec 1: The robot must not start to move if three or more transmissions of the same data failed in a row within the last ten minutes.

com_fail(d) com_fail(d) com_fail(d) move ¬com_ok(d) ¬com_ok(d) ¬com_ok(d) ≤ 600s

In MFOTL:

  • x∈N6,
  • i xi=600

[0,x1](¬com_ok(d) S[0,x2] (com_fail(d) ∧ [0,x3](¬com_ok(d) S[0,x4] (com_fail(d) ∧ [0,x5](¬com_ok(d) S[0,x6] com_fail(d))))))

  • → ¬move

10

slide-24
SLIDE 24

Regular expressions

Recall Spec 1: The robot must not start to move if three or more transmissions of the same data failed in a row within the last ten minutes.

com_fail(d) com_fail(d) com_fail(d) move ¬com_ok(d) ¬com_ok(d) ¬com_ok(d) ≤ 600s

The new operator:

Interval Pattern

where Pattern matches from position i to some past position j ≤ i and their time difference is in Interval.

10

slide-25
SLIDE 25

Regular expressions

Recall Spec 1: The robot must not start to move if three or more transmissions of the same data failed in a row within the last ten minutes.

com_fail(d) com_fail(d) com_fail(d) move ¬com_ok(d) ¬com_ok(d) ¬com_ok(d) ≤ 600s

In MFODL:

  • [0,600] com_fail(d) · (¬com_ok(d))∗ ·

com_fail(d) · (¬com_ok(d))∗ · com_fail(d) · (¬com_ok(d))∗

  • → ¬move

DL stands for Dynamic Logic, as in LDL [De Giacomo & Vardi 2013]

10

slide-26
SLIDE 26

Metric First-Order Dynamic Logic

Formulas: ϕ ::= ...

all existing constructs

|

I e

past match

|

I e

future match

11

slide-27
SLIDE 27

Metric First-Order Dynamic Logic

Formulas: ϕ ::= ...

all existing constructs

|

I e

past match

|

I e

future match

Regular expressions: e ::= _

wildcard

| ϕ?

test formula

| e + e

alternation

| e · e

concatenation

| e∗

Kleene star

11

slide-28
SLIDE 28

Metric First-Order Dynamic Logic

Formulas: ϕ ::= ...

all existing constructs

|

I e

past match

|

I e

future match

Regular expressions: e ::= _

wildcard

| ϕ?

test formula

| e + e

alternation

| e · e

concatenation

| e∗

Kleene star

I com_fail(d) · (¬com_ok(d))∗

abbreviates

I (com_fail(d)? · _) · ((¬com_ok(d))? · _)∗

11

slide-29
SLIDE 29

Metric First-Order Dynamic Logic

Formulas: ϕ ::= ...

all existing constructs

|

I e

past match

|

I e

future match

Regular expressions: e ::= _

wildcard

| ϕ?

test formula

| e + e

alternation

| e · e

concatenation

| e∗

Kleene star

I com_fail(d) · (¬com_ok(d))∗

abbreviates

I (com_fail(d)? · _) · ((¬com_ok(d))? · _)∗

Note: I α ≡

I (α? · _)

α SI β ≡

I (β? · (_ · α?)∗)

I α ≡

I (_ · α?)

α UI β ≡

I ((α? · _)∗ · β?)

11

slide-30
SLIDE 30

Recap: Evaluation in VeriMon

Evaluating (A(x,y) ∧ ¬B(y)) ∨ C(x,y) with finite predicates, using only finite tables: A(x,y) B(y)

¬ ∧

C(x,y)

12

slide-31
SLIDE 31

Recap: Evaluation in VeriMon

Evaluating (A(x,y) ∧ ¬B(y)) ∨ C(x,y) with finite predicates, using only finite tables: A(x,y) B(y)

¬ ∧

C(x,y)

x y 1 2 2 4 3 1 y 1 2 5 x y 5 6

12

slide-32
SLIDE 32

Recap: Evaluation in VeriMon

Evaluating (A(x,y) ∧ ¬B(y)) ∨ C(x,y) with finite predicates, using only finite tables: A(x,y) B(y)

¬ ∧

C(x,y)

x y 1 2 2 4 3 1 y 1 2 5 x y 5 6 y ... ·c

12

slide-33
SLIDE 33

Recap: Evaluation in VeriMon

Evaluating (A(x,y) ∧ ¬B(y)) ∨ C(x,y) with finite predicates, using only finite tables: A(x,y) B(y)

¬ ∧

C(x,y)

x y 1 2 2 4 3 1 y 1 2 5 x y 5 6 y ... ·c x y 2 4

⊲⊳

12

slide-34
SLIDE 34

Recap: Evaluation in VeriMon

Evaluating (A(x,y) ∧ ¬B(y)) ∨ C(x,y) with finite predicates, using only finite tables: A(x,y) B(y)

¬ ∧

C(x,y)

x y 1 2 2 4 3 1 y 1 2 5 x y 5 6 y ... ·c x y 2 4

⊲⊳

x y 2 4 5 6

12

slide-35
SLIDE 35

Recap: Evaluation in VeriMon

Evaluating (A(x,y) ∧ ¬B(y)) ∨ C(x,y) with finite predicates, using only finite tables: A(x,y) B(y)

∧¬

C(x,y)

x y 1 2 2 4 3 1 y 1 2 5 x y 5 6 x y 2 4 x y 2 4 5 6

12

slide-36
SLIDE 36

Recap: Evaluation in VeriMon

Evaluating (A(x,y) ∧ ¬B(y)) ∨ C(x,y) with finite predicates, using only finite tables: A(x,y) B(y)

∧¬

C(x,y)

x y 1 2 2 4 3 1 y 1 2 5 x y 5 6 x y 2 4 x y 2 4 5 6

12

slide-37
SLIDE 37

Recap: Evaluation in VeriMon

Evaluating (A(x,y) ∧ ¬B(y)) ∨ C(x,y) with finite predicates, using only finite tables: A(x,y) B(y)

∧¬

C(x,y)

x y 1 2 2 4 3 1 y 1 2 5 x y 5 6 x y 2 4 x y 2 4 5 6

Syntactic constraints: α ∧ β (join) no constraint α ∧ ¬β (anti-join) FV(β) ⊆ FV(α) α ∨ β (union) FV(α) = FV(β)

12

slide-38
SLIDE 38

Finitely Evaluable Regular Expressions

Kleene star Example: (v,i) |=

[0,∞) r∗

13

slide-39
SLIDE 39

Finitely Evaluable Regular Expressions

Kleene star Example: (v,i) |=

[0,∞) r∗

since r∗ can match from i to i, v can be any valuation of FV(r)

13

slide-40
SLIDE 40

Finitely Evaluable Regular Expressions

Kleene star Example: (v,i) |=

[0,∞) r∗

since r∗ can match from i to i, v can be any valuation of FV(r) must be guarded

13

slide-41
SLIDE 41

Finitely Evaluable Regular Expressions

Kleene star Example: (v,i) |=

[0,∞) r∗

must be guarded Alternation Example: (v,i) |=

[0,∞) r + s

i

x y 1 2

r

x y 3 1

s v ∈

x y 1 2 ∪ x y 3 1

s

13

slide-42
SLIDE 42

Finitely Evaluable Regular Expressions

Kleene star Example: (v,i) |=

[0,∞) r∗

must be guarded Alternation Example: (v,i) |=

[0,∞) r + s

FV(r) = FV(s) i

x y 1 2

r

x y 3 1

s v ∈

x y 1 2 ∪ x y 3 1

s

13

slide-43
SLIDE 43

Finitely Evaluable Regular Expressions

Kleene star Example: (v,i) |=

[0,∞) r∗

must be guarded Alternation Example: (v,i) |=

[0,∞) r + s

FV(r) = FV(s) Concatenation Example: (v,i) |=

[0,∞) r · s

i

x y 3 5

r

x 1

s

x y 1 3

r s matches (i,i) v ∈ (

x y 1 3 ⊲⊳ x 1 ) ∪ x y 3 5

13

slide-44
SLIDE 44

Finitely Evaluable Regular Expressions

Kleene star Example: (v,i) |=

[0,∞) r∗

must be guarded Alternation Example: (v,i) |=

[0,∞) r + s

FV(r) = FV(s) Concatenation Example: (v,i) |=

[0,∞) r · s

i

x y 3 5

r

x 1

s

x y 1 3

r s matches (i,i) v ∈ (

x y 1 3 ⊲⊳ x 1 ) ∪ x y 3 5

FV(r) ⊇ FV(s)

13

slide-45
SLIDE 45

Finitely Evaluable Regular Expressions

Kleene star Example: (v,i) |=

[0,∞) r∗

must be guarded Alternation Example: (v,i) |=

[0,∞) r + s

FV(r) = FV(s) Concatenation Example: (v,i) |=

[0,∞) r · s

FV(r)⊆ FV(s)

13

slide-46
SLIDE 46

MFOTL with aggregations t ::= x | c | t + t | t × t | ... ϕ ::= p(t1,...,tn) | t = t | t < t | t ≤ t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ | x ← Ω t;

  • x. ϕ | ...

Ω ::= MAX | MIN | CNT | SUM | AVG MFODL with aggregations t ::= x | c | t + t | t × t | ... ϕ ::= p(t1,...,tn) | t = t | t < t | t ≤ t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ |

I e | I e

| x ← Ω x;

  • x. ϕ | ...

Ω ::= MAX | MIN | CNT | SUM | AVG e ::= _ | ϕ? | e + e | e · e | e∗

14

slide-47
SLIDE 47

MFOTL with aggregations t ::= x | c | t + t | t × t | ... ϕ ::= p(t1,...,tn) | t = t | t < t | t ≤ t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ | x ← Ω t;

  • x. ϕ | ...

Ω ::= MAX | MIN | CNT | SUM | AVG MFODL with aggregations t ::= x | c | t + t | t × t | ... ϕ ::= p(t1,...,tn) | t = t | t < t | t ≤ t | ¬ϕ | ϕ ∧ ϕ | ∃x. ϕ | I ϕ | I ϕ | ϕ SI ϕ | ϕ UI ϕ |

I e | I e

| x ← Ω x;

  • x. ϕ | ...

can easily express Specs 1 & 2 Ω ::= MAX | MIN | CNT | SUM | AVG e ::= _ | ϕ? | e + e | e · e | e∗

14

slide-48
SLIDE 48

Act III: Let’s Make It Fly

Srđan Martin Working formalizer Quality assurer Where: Implementer’s Den When: 3 days before the IJCAR deadline

15

slide-49
SLIDE 49

Benchmark

(([0,30] P(x,y)) ∧ Q(x,z)) ∧ (◊[0,30] R(x,w)) 0.001 0.01 0.1 1 10 10 100 1000 Time [s] Event-rate M

  • n

P

  • l

y VeriMon

16

slide-50
SLIDE 50

Sliding Window: R(x) S[a,b] T(x)

T0 ⊲⊳ R1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn T1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn · · · Ti ⊲⊳ · · · ⊲⊳ Rn · · · Tn ∪ ((T1 ⊲⊳ R2 ∪ T2) ⊲⊳ R3 ∪ T3) · · · ∪ Tn ∪

17

slide-51
SLIDE 51

Sliding Window: R(x) S[a,b] T(x)

T0 ⊲⊳ R1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn T1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn · · · Ti ⊲⊳ · · · ⊲⊳ Rn · · · Tn ∪ ((T1 ⊲⊳ R2 ∪ T2) ⊲⊳ R3 ∪ T3) · · · ∪ Tn ∪

17

slide-52
SLIDE 52

Sliding Window: R(x) S[a,b] T(x)

T0 ⊲⊳ R1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn T1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn ⊲⊳ Rn+1 · · · Ti ⊲⊳ · · · ⊲⊳ Rn ⊲⊳ Rn+1 · · · Tn ⊲⊳ Rn+1 ∪ ((T1 ⊲⊳ R2 ∪ T2) ⊲⊳ R3 ∪ T3) · · · ∪ Tn ∪

17

slide-53
SLIDE 53

Sliding Window: R(x) S[a,b] T(x)

T0 ⊲⊳ R1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn T1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn ⊲⊳ Rn+1 · · · Ti ⊲⊳ · · · ⊲⊳ Rn ⊲⊳ Rn+1 · · · Tn ⊲⊳ Rn+1 Tn+1 ∪ ((T1 ⊲⊳ R2 ∪ T2) ⊲⊳ R3 ∪ T3) · · · ∪ Tn ∪

17

slide-54
SLIDE 54

Sliding Window: R(x) S[a,b] T(x)

T0 ⊲⊳ R1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn T1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn ⊲⊳ Rn+1 · · · Ti ⊲⊳ · · · ⊲⊳ Rn ⊲⊳ Rn+1 · · · Tn ⊲⊳ Rn+1 Tn+1 ∪ ((T1 ⊲⊳ R2 ∪ T2) ⊲⊳ R3 ∪ T3) · · · ∪ Tn ∪

17

slide-55
SLIDE 55

Sliding Window: R(x) S[a,b] T(x)

T0 ⊲⊳ R1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn T1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn · · · Ti ⊲⊳ · · · ⊲⊳ Rn · · · Tn ∪ (((T0 ⊲⊳ R1∪ T1) ⊲⊳ R2 ∪ T2) · · · ∪ Ti) ⊲⊳ Ri+1 ⊲⊳ Ri+2 ⊲⊳ · · · ⊲⊳ Rn ∪

17

slide-56
SLIDE 56

Sliding Window: R(x) S[a,b] T(x)

T0 ⊲⊳ R1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn T1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn · · · Ti ⊲⊳ · · · ⊲⊳ Rn · · · Tn ∪ T0 T1 · · · Ti · · · Tn (((T0 ⊲⊳ R1∪ T1) ⊲⊳ R2 ∪ T2) · · · ∪ Ti) ⊲⊳ Ri+1 ⊲⊳ Ri+2 ⊲⊳ · · · ⊲⊳ Rn ∪

17

slide-57
SLIDE 57

Sliding Window: R(x) S[a,b] T(x)

T0 ⊲⊳ R1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn T1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn · · · Ti ⊲⊳ · · · ⊲⊳ Rn · · · Tn ∪ T0 T1 · · · Ti · · · Tn (((T0 ⊲⊳ R1∪ T1) ⊲⊳ R2 ∪ T2) · · · ∪ Ti) ⊲⊳ Ri+1 ⊲⊳ Ri+2 ⊲⊳ · · · ⊲⊳ Rn ∪

17

slide-58
SLIDE 58

Sliding Window: R(x) S[a,b] T(x)

T0 ⊲⊳ R1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn T1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn ⊲⊳ Rn+1 · · · Ti ⊲⊳ · · · ⊲⊳ Rn ⊲⊳ Rn+1 · · · Tn ⊲⊳ Rn+1 ∪ T0 T1 · · · Ti · · · Tn (((T0 ⊲⊳ R1∪ T1) ⊲⊳ R2 ∪ T2) · · · ∪ Ti) ⊲⊳ Ri+1 ⊲⊳ Ri+2 ⊲⊳ · · · ⊲⊳ Rn ⊲⊳ Rn+1 ∪

17

slide-59
SLIDE 59

Sliding Window: R(x) S[a,b] T(x)

T0 ⊲⊳ R1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn T1 ⊲⊳ R2 ⊲⊳ R3 ⊲⊳ · · · ⊲⊳ Rn ⊲⊳ Rn+1 · · · Ti ⊲⊳ · · · ⊲⊳ Rn ⊲⊳ Rn+1 · · · Tn ⊲⊳ Rn+1 Tn+1 ∪ T0 T1 · · · Ti · · · Tn Tn+1 (((T0 ⊲⊳ R1∪ T1) ⊲⊳ R2 ∪ T2) · · · ∪ Ti) ⊲⊳ Ri+1 ⊲⊳ Ri+2 ⊲⊳ · · · ⊲⊳ Rn ⊲⊳ Rn+1 ∪

17

slide-60
SLIDE 60

Benchmark

(([0,30] P(x,y)) ∧ Q(x,z)) ∧ (◊[0,30] R(x,w)) 0.001 0.01 0.1 1 10 10 100 1000 Time [s] Event-rate M

  • n

P

  • l

y VeriMon VeriMon+

18

slide-61
SLIDE 61

Multi-Way Join

(([0,30] P(x,y)) ∧ Q(x,z)) ∧ (◊[0,30] R(x,w))

19

slide-62
SLIDE 62

Multi-Way Join

([0,30] P(x,y))∧Q(x,z)∧(◊[0,30] R(x,w)) 0.001 0.01 0.1 1 10 10 100 1000 Time [s] Event-rate M

  • n

P

  • l

y VeriMon VeriMon+ VeriMon+

19

slide-63
SLIDE 63

Act IV: Ready for Takeoff

Martin Dmitriy Quality assurer Rocket engineer Where: WASA Exhibition Room When: 1 day before the IJCAR deadline

20

slide-64
SLIDE 64

Spec 2: The module with the highest energy consumption within the second to last minute must be reported to ground control.

21

slide-65
SLIDE 65

Spec 2: The module with the highest energy consumption within the second to last minute must be reported to ground control. (e ← MAX e;([60,120] E(e,id))) ∧ ([60,120] E(e,id))

21

slide-66
SLIDE 66

Spec 2: The module with the highest energy consumption within the second to last minute must be reported to ground control. (e ← MAX e;([60,120] E(e,id))) ∧ ([60,120] E(e,id))

21

slide-67
SLIDE 67

Spec 2: The module with the highest energy consumption within the second to last minute must be reported to ground control. (e ← MAX e;([60,120] E(e,id))) ∧ ([60,120] E(e,id))

21

slide-68
SLIDE 68

Spec 2: The module with the highest energy consumption within the second to last minute must be reported to ground control. (e ← MAX e;([60,120] E(e,id))) ∧ ([60,120] E(e,id)) (e <- MAX e; (ONCE[60,120] E(e,id))) AND (ONCE[60,120] E(e,id))

21

slide-69
SLIDE 69

Spec 2: The module with the highest energy consumption within the second to last minute must be reported to ground control. (e ← MAX e;([60,120] E(e,id))) ∧ ([60,120] E(e,id)) (e <- MAX e; (ONCE[60,120] E(e,id))) AND (ONCE[60,120] E(e,id)) Log: @70 E(30,"gps") E(25,"wifi") @100 E(20,"gps") @170 E(20,"wifi") E(20,"bluetooth") @230 E(30,"wifi") @300 E(10,"wifi")

21

slide-70
SLIDE 70

Spec 2: The module with the highest energy consumption within the second to last minute must be reported to ground control. (e ← MAX e;([60,120] E(e,id))) ∧ ([60,120] E(e,id)) (e <- MAX e; (ONCE[60,120] E(e,id))) AND (ONCE[60,120] E(e,id)) Log: @70 E(30,"gps") E(25,"wifi") @100 E(20,"gps") @170 E(20,"wifi") E(20,"bluetooth") @230 E(30,"wifi") @300 E(10,"wifi") Signature: E(int,string)

21

slide-71
SLIDE 71

Correct Expressive Efficient

22

slide-72
SLIDE 72

Correct Expressive Efficient

15 000 lines of

λ → ∀ =

I s a b e l l e

β α H O L

extraction to OCaml

22

slide-73
SLIDE 73

Correct Expressive Efficient

15 000 lines of

λ → ∀ =

I s a b e l l e

β α H O L

extraction to OCaml aggregations regular expressions

22

slide-74
SLIDE 74

Correct Expressive Efficient

15 000 lines of

λ → ∀ =

I s a b e l l e

β α H O L

extraction to OCaml aggregations regular expressions sliding window (S, U) multi-way join

22

slide-75
SLIDE 75

Correct Expressive Efficient

15 000 lines of

λ → ∀ =

I s a b e l l e

β α H O L

extraction to OCaml aggregations regular expressions sliding window (S, U) multi-way join verified parsing extraction to LLVM

22

slide-76
SLIDE 76

Correct Expressive Efficient

15 000 lines of

λ → ∀ =

I s a b e l l e

β α H O L

extraction to OCaml aggregations regular expressions sliding window (S, U) multi-way join verified parsing extraction to LLVM unsafe formulas recursive let

22

slide-77
SLIDE 77

Correct Expressive Efficient

15 000 lines of

λ → ∀ =

I s a b e l l e

β α H O L

extraction to OCaml aggregations regular expressions sliding window (S, U) multi-way join verified parsing extraction to LLVM unsafe formulas recursive let P(x) ∨ ∃y. R(y)

22

slide-78
SLIDE 78

Correct Expressive Efficient

15 000 lines of

λ → ∀ =

I s a b e l l e

β α H O L

extraction to OCaml aggregations regular expressions sliding window (S, U) multi-way join verified parsing extraction to LLVM unsafe formulas recursive let let T(x,y) = P(x,y) ∨ (∃z. T(x,z) ∧ P(z,y)) in ...

22

slide-79
SLIDE 79

Correct Expressive Efficient

15 000 lines of

λ → ∀ =

I s a b e l l e

β α H O L

extraction to OCaml aggregations regular expressions sliding window (S, U) multi-way join verified parsing extraction to LLVM unsafe formulas recursive let sliding window ( , ) moving aggregations

22

slide-80
SLIDE 80

Correct Expressive Efficient

15 000 lines of

λ → ∀ =

I s a b e l l e

β α H O L

extraction to OCaml aggregations regular expressions sliding window (S, U) multi-way join verified parsing extraction to LLVM unsafe formulas recursive let sliding window ( , ) moving aggregations

[a,b] ψ? · (_ · ϕ?)∗

22

slide-81
SLIDE 81

Correct Expressive Efficient

15 000 lines of

λ → ∀ =

I s a b e l l e

β α H O L

extraction to OCaml aggregations regular expressions sliding window (S, U) multi-way join verified parsing extraction to LLVM unsafe formulas recursive let sliding window ( , ) moving aggregations x ← AVG a;u. [0,3600] P(a,u)

22

slide-82
SLIDE 82

23

slide-83
SLIDE 83

A Formally Verified, Optimized Monitor

for Metric First-Order Dynamic Logic

David Basin, Thibault Dardinier, Lukas Heimes, Srđan Krstić, Martin Raszyk, Joshua Schneider and Dmitriy Traytel

Department of Computer Science

merci! questions?

24