The Relational Database Engine: An Efficient Validator of T emporal - - PowerPoint PPT Presentation

the relational database engine
SMART_READER_LITE
LIVE PREVIEW

The Relational Database Engine: An Efficient Validator of T emporal - - PowerPoint PPT Presentation

The Relational Database Engine: An Efficient Validator of T emporal Properties on Event T races Jason Vallet, Aouatef Mrad, Sylvain Hall*, ric Beaudet Universit du Qubec Chicoutimi Novum Solutions CANADA CANADA Fonds de


slide-1
SLIDE 1

Sylvain Hallé

Jason Vallet, Aouatef Mrad, Sylvain Hallé*, Éric Beaudet

Fonds de recherche sur la nature et les technologies

CRSNG NSERC

The Relational Database Engine:

An Efficient Validator of T emporal Properties

  • n Event T

races

Université du Québec à Chicoutimi CANADA Novum Solutions CANADA

slide-2
SLIDE 2

Sylvain Hallé

How high is this building? How high is this building?

?

slide-3
SLIDE 3

Sylvain Hallé

How high is this building?

slide-4
SLIDE 4

Sylvain Hallé

h = 4.9 t 2

How high is this building?

slide-5
SLIDE 5

Sylvain Hallé

T = 2π 9.8 h

How high is this building?

slide-6
SLIDE 6

Sylvain Hallé

2h = T c

How high is this building?

slide-7
SLIDE 7

Sylvain Hallé

p

p = p 1 - L h T0

( (

g M R L

How high is this building?

slide-8
SLIDE 8

Sylvain Hallé

How high is this building?

Answer derived from indirect measurements No single "best" solution

Sylvain Hallé

How high is this building?

slide-9
SLIDE 9

Sylvain Hallé

τ ⊧ φ ?

A sequence of events Some assertion

  • n that sequence

satisfies Web server log Execution trace . . . FSM LTL . . .

Sylvain Hallé

T race validation

Algos Tools

slide-10
SLIDE 10

I t e r a t

  • r

< T >

slide-11
SLIDE 11

I t e r a t

  • r

< T >

hasNext next

slide-12
SLIDE 12

I t e r a t

  • r

< T >

hasNext next A call to next must be preceded by a call to hasNext

slide-13
SLIDE 13

B A

slide-14
SLIDE 14

B A

No CartCreate request can occur before a LoginResponse message

slide-15
SLIDE 15

Login

slide-16
SLIDE 16

Login

Three successive login attempts should trigger an alarm

slide-17
SLIDE 17
slide-18
SLIDE 18

Receive order

slide-19
SLIDE 19

Receive order Ready?

slide-20
SLIDE 20

Receive order Ready? Yes

slide-21
SLIDE 21

Receive order Ready? Yes File order No Ship

slide-22
SLIDE 22

Receive order Ready? Yes File order No Ship

A received order must eventually be shipped

slide-23
SLIDE 23

A

1 2 3 4 . . .

a a b c b

ℕ A trace m is a mapping from ℕ to the set of events :

A

Let be a set of event symbols.

slide-24
SLIDE 24

A

Ground terms

→ ¬ ∧

→ ¬ ∧ Boolean connectives Temporal

  • perators

X G F U next globally eventually until

+ + = Linear Temporal Logic

slide-25
SLIDE 25

A

1 2 3 4 . . .

a a b c b

Φ

Let be the set of all possible LTL formulas. The function ℒ : Φ → 2 labels each state with a set of LTL formulas

slide-26
SLIDE 26

a ∧ b a ∧ b

G (a→b)

b ∨ c b∨c a ∧ b

G (a→b)

ℒ(a∧b) = {0,1,4,...} Example: ℒ

A

1 2 3 4 . . .

a a b c b

Φ

Let be the set of all possible LTL formulas. The function ℒ : Φ → 2 labels each state with a set of LTL formulas

slide-27
SLIDE 27

i ∈ ℒ(φ∨ψ) ⇔ i ∈ ℒ(φ) or i ∈ ℒ(ψ) i ∈ ℒ(φ∧ψ) ⇔ i ∈ ℒ(φ) and i ∈ ℒ(ψ) i ∈ ℒ(¬φ) ⇔ i ∉ ℒ(φ) i ∈ ℒ(G φ) ⇔ j ∈ ℒ(φ) for all j ≥ i i ∈ ℒ(X φ) ⇔ i+1 ∈ ℒ(φ) i ∈ ℒ(F φ) ⇔ j ∈ ℒ(φ) for some j ≥ i i ∈ ℒ(φ U ψ) ⇔ j ∈ ℒ(ψ) for some j ≥ i and k ∈ ℒ(φ) for all j ≥ k ≥ i i ∈ ℒ(a) ⇔ m(i) = a

slide-28
SLIDE 28

i ∈ ℒ(φ) exactly when the trace m(i), m(i+1), ... satisfies φ Theorem

ψ φ σ

1 2 3 4 . . .

ψ φ σ

slide-29
SLIDE 29

i ∈ ℒ(φ) exactly when the trace m(i), m(i+1), ... satisfies φ Theorem

ψ φ σ

1 2 3 4 . . .

ψ φ σ

0 ∈ ℒ(φ) ⇔ m ⊧ φ Therefore...

slide-30
SLIDE 30

A call to next must be followed by a call to hasNext No CartCreate request can occur before a LoginResponse message A received order must eventually be shipped Three successive login attempts should trigger an alarm

slide-31
SLIDE 31

A call to next must be followed by a call to hasNext No CartCreate request can occur before a LoginResponse message A received order must eventually be shipped Three successive login attempts should trigger an alarm G (next → X hasNext)

slide-32
SLIDE 32

A call to next must be followed by a call to hasNext No CartCreate request can occur before a LoginResponse message A received order must eventually be shipped Three successive login attempts should trigger an alarm G (next → X hasNext) ¬ CartCreate U hasNext

slide-33
SLIDE 33

A call to next must be followed by a call to hasNext No CartCreate request can occur before a LoginResponse message A received order must eventually be shipped Three successive login attempts should trigger an alarm G (next → X hasNext) ¬ CartCreate U hasNext G (receive → F ship)

slide-34
SLIDE 34

A call to next must be followed by a call to hasNext No CartCreate request can occur before a LoginResponse message A received order must eventually be shipped Three successive login attempts should trigger an alarm G (next → X hasNext) ¬ CartCreate U hasNext G (receive → F ship) G ¬(fail ∧ (X (fail ∧ X fail)))

slide-35
SLIDE 35

Sylvain Hallé

Four types of traces

τ : a mapping from ℕ to events in E = {e₀, e₁, ...}

Multi-valued eᵢ : Pᵢ → 2V

Parameters Values <event> <p>13</p> <q>8</q> <q>6</q> </event>

1

Single-valued eᵢ : Pᵢ → V

<event> <p>13</p> <q>8</q> <r>6</r> </event>

2 3

Fixed schema eᵢ : P → V

p 13 12 9 q 8 4 2 r 6 10 8

4

Atomic eᵢ = a

slide-36
SLIDE 36

Sylvain Hallé

Specification languages

φ : an expression in some specification language

Linear Temporal Logic (LTL) G p₀ ≠ 0 First-order Linear Temporal Logic (LTL-FO+) F (∀x ∈ /event/p₀ : x = 0) Regular expressions

^a+b.*b?c$

SQL

SELECT * FROM events WHERE p0=0...

slide-37
SLIDE 37

Sylvain Hallé

Software and algorithms

⊧ : an algorithm to evaluate satisfiability

for inputs in format T against assertions in language L BeepBeep, Monid, Logscope, MySQL, ProM, NuSMV , Spin, SEQ.OPEN, . . . 〈T,L〉

slide-38
SLIDE 38

Sylvain Hallé

Islands?

〈LTL-FO+, multi-valued〉 〈SQL, fixed schema〉 〈XQuery, multi-valued〉 〈MFOTL, single-valued〉 Saxon BeepBeep NuSMV Spin MySQL Maude MonPoly 〈LTL, atomic〉 〈LTL, single-valued〉

slide-39
SLIDE 39

Sylvain Hallé

BabelT race

XML CSV XES

Reader T ranslator

τ File

φ

Launcher Application

T/F

slide-40
SLIDE 40

Sylvain Hallé

T ransduction

T ransducer

(τ,φ) ∈ 〈T,L〉 (τ',φ') ∈ 〈T ',L'〉

⊧〈T,L〉

τ φ

⊧〈T ',L'〉

τ' φ'

Transduction preserves logical equivalence Chaining transducers allows an application to verify a property on a trace expressed in a different format/language pair

slide-41
SLIDE 41

Sylvain Hallé

Islands?

〈LTL-FO+, multi-valued〉 〈SQL, fixed schema〉 〈XQuery, multi-valued〉 〈MFOTL, single-valued〉 Saxon BeepBeep NuSMV Spin MySQL Maude MonPoly ⊆

*

〈LTL, atomic〉 〈LTL, single-valued〉 〈LTL-FO+, single-valued〉 ⊆ ⊆

*

slide-42
SLIDE 42

Sylvain Hallé

Islands?

〈LTL-FO+, multi-valued〉 〈SQL, fixed schema〉 〈XQuery, multi-valued〉 〈MFOTL, single-valued〉 Saxon BeepBeep NuSMV Spin MySQL Maude MonPoly ⊆

*

〈LTL, atomic〉 〈LTL, single-valued〉 〈LTL-FO+, single-valued〉 ⊆ ⊆

*

slide-43
SLIDE 43

Sylvain Hallé

Islands?

〈LTL-FO+, multi-valued〉 〈SQL, fixed schema〉 〈XQuery, multi-valued〉 〈MFOTL, single-valued〉 Saxon BeepBeep NuSMV Spin MySQL Maude MonPoly ⊆

*

〈LTL, atomic〉 〈LTL, single-valued〉 〈LTL-FO+, single-valued〉 ⊆ ⊆

*

slide-44
SLIDE 44

Sylvain Hallé

Islands?

〈LTL-FO+, multi-valued〉 〈SQL, fixed schema〉 〈XQuery, multi-valued〉 〈MFOTL, single-valued〉 Saxon BeepBeep NuSMV Spin MySQL Maude MonPoly ⊆

*

〈LTL, atomic〉 〈LTL, single-valued〉 〈LTL-FO+, single-valued〉 ⊆ ⊆

*

slide-45
SLIDE 45

Sylvain Hallé

Islands?

〈LTL-FO+, multi-valued〉 〈SQL, fixed schema〉 〈XQuery, multi-valued〉 〈MFOTL, single-valued〉 Saxon BeepBeep NuSMV Spin MySQL Maude MonPoly ⊆

*

〈LTL, atomic〉 〈LTL, single-valued〉 〈LTL-FO+, single-valued〉 ⊆ ⊆

*

slide-46
SLIDE 46

Sylvain Hallé

Islands?

〈LTL-FO+, multi-valued〉 〈SQL, fixed schema〉 〈XQuery, multi-valued〉 〈MFOTL, single-valued〉 Saxon BeepBeep NuSMV Spin MySQL Maude MonPoly ⊆

*

〈LTL, atomic〉 〈LTL, single-valued〉 〈LTL-FO+, single-valued〉 ⊆ ⊆

*

slide-47
SLIDE 47

Sylvain Hallé

Format of an event trace

n Action SessionId CartId ItemId CartCreate 1234 null null 1 CartCreateResponse 1234 45603 null 2 CartAdd 1234 45603 005-40958 3 CartClear 1234 45603 null

Event attributes Event Sequential number

slide-48
SLIDE 48

Sylvain Hallé

From LTL to SQL

Recursive function

ω

LTL formula SQL query

n

2 ...

φ

i ∈ T

Evaluate

T : if and only if τ ⊧ φ

i

slide-49
SLIDE 49

Sylvain Hallé

From LTL to SQL

ω (x = y) ≡

SELECT n FROM T WHERE x = y

Base case: assertions of the form x=y Create a table containing event numbers n that satisfy the assertion

slide-50
SLIDE 50

Sylvain Hallé

From LTL to SQL

ω (ϕ ∨ψ) ≡ ω +1(ϕ) UNION ω +1(ψ) ω (ϕ ∧ψ) ≡ ω +1(ϕ) INTERSECT ω +1(ψ) ω (¬ ϕ) ≡ T MINUS ω +1(ϕ)

ℓ ℓ ℓ ℓ ℓ ℓ ℓ ℓ

Boolean connectives: combine tables computed at a previous step

slide-51
SLIDE 51

Sylvain Hallé

From LTL to SQL

ω (X ϕ) ≡

SELECT n−1 FROM ω +1(ϕ)

ℓ ℓ

X φ: put n-1 in the output table if n is in the table computed for φ

slide-52
SLIDE 52

Sylvain Hallé

From LTL to SQL

ω (F ϕ) ≡

SELECT DISTINCT T

A, .n

FROM T AS T

A, JOIN ω +1(ϕ) AS T B,

WHERE T

A, .n ≤ T B, .n ℓ ℓ ℓ ℓ ℓ ℓ

F φ: put in the output table all values of T that are smaller than some value n is in the table computed for φ (can be optimized)

slide-53
SLIDE 53

Sylvain Hallé

From LTL to SQL

T ≡

SELECT MAX(T

A, .n) AS n1, T B, .n AS n2

FROM ω +1(¬

ϕ) AS T

A, JOIN ω +1(ψ) AS T B,

WHERE n1 < n GROUP BY T

B, .n

ω (ϕ U ψ) ≡

SELECT T.n FROM T JOIN T WHERE T.n > T .n1 AND T.n ≤ T .n2

ℓ ℓ ℓ ℓ ℓ ℓ ℓ ℓ'

'

'

.

'

φ U ψ: done in two steps Most expensive translation (two joins)

slide-54
SLIDE 54

Sylvain Hallé

Experimental evaluation

Using BabelTrace, compared SQL translation with 7 other tools using the same inputs

Tool Input language Available? BeepBeep [12] LTL-FO+ Yes Logscope [7] Logscope — Maude [20] LTL Yes Monid [19] EAGLE — MonPoly [4] MFOTL Yes NuSMV [5] LTL Yes ProM [24] LTL Yes RuleR [3] RuleR — Saxon [11] XQuery Yes SEQ.OPEN [6] µ-calculus2 Yes SPIN [14] LTL Yes

slide-55
SLIDE 55

Sylvain Hallé

Experimental evaluation

2 4 6 8 10 12 14 1000 2000 3000 4000 5000 6000 7000 8000 9000 10000 Time (s) Trace length Scenario Random property P9 BeepBeep Filter Monpoly MySQL MySQL-Opt ProMLTL Saxon

slide-56
SLIDE 56

Sylvain Hallé Sylvain Hallé

Experimental evaluation

Surprise! When used as a trace validator, a relational database engine outperforms most software designed for that purpose ⇒ Trace validation capabilities are available through commodity software

slide-57
SLIDE 57

Sylvain Hallé

Future work

Event data stored across multiple tables (n:1 or n:n relations) Optimize translation Handle past operators Row vs. column-oriented storage

slide-58
SLIDE 58

Sylvain Hallé

The end

Thank you! Questions?