• Nie Znaleziono Wyników

CTL symbolic model-checking

N/A
N/A
Protected

Academic year: 2022

Share "CTL symbolic model-checking"

Copied!
105
0
0

Pełen tekst

(1)

Computer aided verification

Lecture 6:

CTL symbolic model-checking

Sławomir Lasota University of Warsaw

(2)

Idea of SMC: EF p

– Compute the set of all states satisfying EF p by iterating predecessor EX _.

– p. 2/65

(3)

Idea of SMC: EF p

– Compute the set of all states satisfying EF p by iterating predecessor EX _.

– Instead of enumerating all states individually...

compute symbolic description of the set

(4)

Symbolic model checking

model description

boolean encoding

**

U U U U U U U U U U U U U U U U U U U U U

QBF

implementation

G ##G G G G G G G

model checking = operations on OBDDs OBDD

– p. 3/65

(5)

Symbolic model checking

model description

boolean encoding

**

U U U U U U U U U U U U U U U U U U U U U

QBF

implementation

G ##G G G G G G G

model checking = operations on OBDDs OBDD

Plan:

– OBDDs

(6)

Symbolic model checking

model description

boolean encoding

**

U U U U U U U U U U U U U U U U U U U U U

QBF

implementation

G ##G G G G G G G

model checking = operations on OBDDs OBDD

Plan:

– OBDDs

– Boolean encoding

– p. 3/65

(7)

Symbolic model checking

model description

boolean encoding

**

U U U U U U U U U U U U U U U U U U U U U

QBF

implementation

G ##G G G G G G G

model checking = operations on OBDDs OBDD

Plan:

– OBDDs

– Boolean encoding

– CTL Symbolic model-checking

(8)

Symbolic model checking

model description

boolean encoding

**

U U U U U U U U U U U U U U U U U U U U U

QBF

implementation

G ##G G G G G G G

model checking = operations on OBDDs OBDD

Plan:

– OBDDs

– Boolean encoding

– CTL Symbolic model-checking – Fairness

– p. 3/65

(9)

Symbolic model checking

model description

boolean encoding

**

U U U U U U U U U U U U U U U U U U U U U

QBF

implementation

G ##G G G G G G G

model checking = operations on OBDDs OBDD

Plan:

– OBDDs

– Boolean encoding

– CTL Symbolic model-checking – Fairness

(10)

OBDDs

– p. 4/65

(11)

Ordered Binary Decision Trees

[Bryant 1992]

– f : {0, 1}3 → {0, 1}

– Z ⊆ {0, 1}3

– fixed order on variables: x1 < x2 < x3

(12)

Ordered Binary Decision Diagrams

OBDD = rooted directed acyclic graph

Attributes of a node v:

– when v is a leaf

– a value val(v) ∈ {0, 1}

– when v is not a leaf

– a variable var(v) ∈ {x1, x2, . . .}

– 2 successor nodes s0(v), s1(v)

The order of variables must be obeyed on every path.

[Bryant 1992]

– p. 6/65

(13)

Reduced OBDD

– remove redundant leaves

– remove redundant non-leaves OBDD 7−→ ROBDD

– remove redundant tests

(14)

Reduced OBDD = canonical form

Canonical form for a boolean function:

– independent from the initial OBDD

– (strongly) dependent on the order of variables

Naive construction of an OBDD for a boolean formula φ:

φ

 //

decision tree

 //

canonical OBDD

Finding an appropriate order of variables is crucial!

– p. 8/65

(15)

Order of variables is crucial

a1 ∧ b1 ∨ a2 ∧ b2 ∨ a3 ∧ b3

(16)

Order of variables is crucial

a1 ∧ b1 ∨ a2 ∧ b2 ∨ a3 ∧ b3

a1 ∧ b1 ∨ a2 ∧ b2 ∨ . . . ∨ an ∧ bn

2 · n 2 · (2n − 1)

– p. 9/65

(17)

OBDD size

Heuristic: closely related variables should be close in the order

example of a boolean function lower bound upper bound

symmetric functions O(n) O(n2)

addition (oldest bits) O(n) O(2n) multiplication (middle bits) O(2n) O(2n)

(18)

Shannon’s expansion

f = ¬x ∧ f | x←0 ∨ x ∧ f | x←1

f|xi←b(x1, . . . , xn) = f (x1, . . . , xi−1, b, xi+1, . . . , xn)

– p. 11/65

(19)

Shannon’s expansion

f = ¬x ∧ f | x←0 ∨ x ∧ f | x←1

f|xi←b(x1, . . . , xn) = f (x1, . . . , xi−1, b, xi+1, . . . , xn)

v = ¬x ∧ s 0 (v) ∨ x ∧ s 1 (v)

v

~~| |

|

|

B B B B B B

B B

x = var(v)

s0(v) s1(v)

(20)

OBDDs as an abstract data type

the order of variables the same in all OBDDs

– p. 12/65

(21)

OBDDs as an abstract data type

the order of variables the same in all OBDDs

Operations:

f ∨ g, f ∧ g, ¬f , false, true BF 7→ OBDD

f|x←0, f|x←1

(22)

OBDDs as an abstract data type

the order of variables the same in all OBDDs

Operations:

f ∨ g, f ∧ g, ¬f , false, true BF 7→ OBDD

f|x←0, f|x←1

∃x. f , ∀x. f QBF 7→ OBDD

– p. 12/65

(23)

OBDDs as an abstract data type

the order of variables the same in all OBDDs

Operations:

f ∨ g, f ∧ g, ¬f , false, true BF 7→ OBDD

f|x←0, f|x←1

∃x. f , ∀x. f QBF 7→ OBDD

f = g

(24)

OBDDs as an abstract data type

the order of variables the same in all OBDDs

Operations:

f ∨ g, f ∧ g, ¬f , false, true BF 7→ OBDD

f|x←0, f|x←1

∃x. f , ∀x. f QBF 7→ OBDD

f = g

Note: operations on boolean functions, not on values {0, 1}.

– p. 12/65

(25)

Implementation of unary operations

– f|x←b

traverse nodes n of OBDD representing f :

– if x > var(n) then recursively traverse s0(n) and s1(n);

– if x < var(n) then stop;

– otherwise replace n by:

s0(n) if b = 0 s1(n) if b = 1

(26)

Implementation of unary operations (cont.)

– ∃x. f = f |x←0 ∨ f |x←1 the order of variables remains the same!

(27)

Implementation of unary operations (cont.)

– ∃x. f = f |x←0 ∨ f |x←1 the order of variables remains the same!

– ¬f ?

[Bryant 1992]

(28)

Implementation of binary operations

the order of variables the same in all OBDDs

• : {0, 1}2 → {0, 1}

for two given OBDDs representing f and g, compute an OBDD representing f • g

f • g = ¬x ∧ (f • g)|x←0 ∨ x ∧ (f • g)|x←1

f • g = ¬x ∧ (f |x←0 • g|x←0) ∨ x ∧ (f |x←1 • g|x←1)

– p. 15/65

(29)

Implementation of binary operations

Apply( f, g, • ) f • g (think of f, g as roots of OBDDs ) – f, g leaves: val(f • g) := val(f ) • val(g)

– f leaf, g not: f • g := op(g) – var(f ) = var(g) = x:

var(f • g) := x s0(f • g) := s0(f ) • s0(g) s1(f • g) := s1(f ) • s1(g) – var(f ) = x < y = var(g):

var(f • g) := x s0(f • g) := s0(f ) • g s1(f • g) := s1(f ) • g

f • g = ¬x ∧ (f • g)|x←0 ∨ x ∧ (f • g)|x←1

f • g = ¬x ∧ (f |x←0 • g|x←0) ∨ x ∧ (f |x←1 • g|x←1)

(30)

Example: input OBDDs

[Bryant 1992]

(a ∨ b) ∧ c ∨ d a ∧ ¬c ∨ d

– p. 17/65

(31)

Example: recursive calls

[Bryant 1992]

(32)

Example: result = a ∨ b ∧ c ∨ d

[Bryant 1992]

– p. 19/65

(33)

Example: reduced result = a ∨ b ∧ c ∨ d

[Bryant 1992]

(34)

Implementation of binary operations

Apply( f, g, • )

– running time: O(|f | · |g|) – result in the canonical form

– p. 21/65

(35)

Implementation of binary operations

Apply( f, g, • )

– running time: O(|f | · |g|) – result in the canonical form

Question: f ⇐⇒ g ?

(36)

Implementation of binary operations

Apply( f, g, • )

– running time: O(|f | · |g|) – result in the canonical form

Question: f ⇐⇒ g ? Question: f = g ?

– p. 21/65

(37)

Variations and extensions

– one OBDD shared by all functions 7→ f = g in constant time

(38)

Variations and extensions

– one OBDD shared by all functions 7→ f = g in constant time – edges representing ¬

– p. 22/65

(39)

Variations and extensions

– one OBDD shared by all functions 7→ f = g in constant time – edges representing ¬

– OZBDDs (Ordered Zero-supressed BDDs)

(40)

Variations and extensions

– one OBDD shared by all functions 7→ f = g in constant time – edges representing ¬

– OZBDDs (Ordered Zero-supressed BDDs) – . . .

– p. 22/65

(41)

Boolean encoding

model description

boolean encoding

**

U U U U U U U U U U U U U U U U U U U U U

QBF

implementation

G ##G G G G G G G

model checking = operations on OBDDs OBDD

(42)

Model description

– Kripke structure M = (S, S0, R, L)

– p. 24/65

(43)

Model description

– Kripke structure M = (S, S0, R, L)

– S described by m boolean variables: S ≡ {0, 1}m

(44)

Model description

– Kripke structure M = (S, S0, R, L)

– S described by m boolean variables: S ≡ {0, 1}m

– transition relation R : {0, 1}m × {0, 1}m → {0, 1}

R(x1, . . . , xm, x1, . . . , xm) ∈ {0, 1}

– p. 24/65

(45)

Model description

– Kripke structure M = (S, S0, R, L)

– S described by m boolean variables: S ≡ {0, 1}m

– transition relation R : {0, 1}m × {0, 1}m → {0, 1}

R(x1, . . . , xm, x1, . . . , xm) ∈ {0, 1}

– initial states S0 : {0, 1}m → {0, 1}

S0(x1, . . . , xm) ∈ {0, 1}

(46)

Model description

– Kripke structure M = (S, S0, R, L)

– S described by m boolean variables: S ≡ {0, 1}m

– transition relation R : {0, 1}m × {0, 1}m → {0, 1}

R(x1, . . . , xm, x1, . . . , xm) ∈ {0, 1}

– initial states S0 : {0, 1}m → {0, 1}

S0(x1, . . . , xm) ∈ {0, 1}

– atomic properties Lp = {s | p ∈ L(s)} : {0, 1}m → {0, 1}

Lp(x1, . . . , xm) ∈ {0, 1}

– p. 24/65

(47)

Example

ONML HIJK

¬x y

 // GFED @ABC ?>=< 89:;

x y

''ONML HIJK

x ¬y

gg FED ABC

__

(reachable states)

variables = {x, y}

R = (x ∧ y ∧ x ∧ ¬y) ∨ (x ∧ ¬y ∧ x ∧ ¬y) ∨ (x ∧ ¬y ∧ x ∧ y) S0 = x ∧ y

Lp = y

(48)

SMV model – example

MODULE main VAR

request : {Tr, Fa};

state : {ready, busy};

ASSIGN

init(state) := ready;

next(state) := case

state = ready & (request = Tr): busy;

TRUE : {ready,busy};

esac;

SPEC

AG((request = Tr) -> AF state = busy)

– p. 26/65

(49)

From a model to OBDD

description of a Kripke structure

_



Kripke structure

 //

OBDD

NO!

(50)

From a model to OBDD

description of a Kripke structure

_



Kripke structure

 //

OBDD

NO!

description of a Kripke structure

 //

OBDD

YES!

– p. 27/65

(51)

Compositional model desciption

Synchronous processes:

R = R1 ∧ R2 ∧ . . . ∧ Rn

(52)

Compositional model desciption

Synchronous processes:

R = R1 ∧ R2 ∧ . . . ∧ Rn

Asynchronous processes (interleaving):

R = R1 ∨ R2 ∨ . . . ∨ Rn

Ri = Ri ∧ (V

j6=i Idj)

– p. 28/65

(53)

Compositional model desciption

Synchronous processes:

R = R1 ∧ R2 ∧ . . . ∧ Rn

Asynchronous processes (interleaving):

R = R1 ∨ R2 ∨ . . . ∨ Rn

Ri = Ri ∧ (V

j6=i Idj) Asynchronous processes (simultaneous execution):

R = R1 ∧ R2 ∧ . . . ∧ Rn

Ri = Ri ∨ Idi

(54)

Restriction to reachable states

R(xb 1, . . . , xm, x1, . . . , xm) = 1 m

R(x1, . . . , xm, x1, . . . , xm) ∧ (x1, . . . , xm) reachable

Should we restrict to reachable states?

– p. 29/65

(55)

CTL Symbolic model-checking

(56)

Reminder

Fixed points in a complete lattice hA, ≤i. Assume A is finite.

Let f : A → A monotonic.

– p. 31/65

(57)

Reminder

Fixed points in a complete lattice hA, ≤i. Assume A is finite.

Let f : A → A monotonic.

– the least f.p.: ⊥ ≤ f (⊥) ≤ f2(⊥) ≤ . . . µZ. f(Z)

– the greatest f.p.: ⊤ ≥ f (⊤) ≥ f2(⊤) ≥ . . . νZ. f(Z)

When A finite, the fixed points are reached after ≤ |A| iterations.

(58)

Reminder

Fixed points in a complete lattice hA, ≤i. Assume A is finite.

Let f : A → A monotonic.

– the least f.p.: ⊥ ≤ f (⊥) ≤ f2(⊥) ≤ . . . µZ. f(Z)

– the greatest f.p.: ⊤ ≥ f (⊤) ≥ f2(⊤) ≥ . . . νZ. f(Z)

When A finite, the fixed points are reached after ≤ |A| iterations.

Example: hA, ≤i = hP(S), ⊆i EXZ = {s : R(s, s) for some s ∈ Z}

– p. 31/65

(59)

Reminder

Fixed points in a complete lattice hA, ≤i. Assume A is finite.

Let f : A → A monotonic.

– the least f.p.: ⊥ ≤ f (⊥) ≤ f2(⊥) ≤ . . . µZ. f(Z)

– the greatest f.p.: ⊤ ≥ f (⊤) ≥ f2(⊤) ≥ . . . νZ. f(Z)

When A finite, the fixed points are reached after ≤ |A| iterations.

Example: hA, ≤i = hP(S), ⊆i EXZ = {s : R(s, s) for some s ∈ Z}

Z 7→ EX Z µZ. EX Z = ⊥ = ∅ νZ. EX Z = ?

(60)

Reminder

Fixed points in a complete lattice hA, ≤i. Assume A is finite.

Let f : A → A monotonic.

– the least f.p.: ⊥ ≤ f (⊥) ≤ f2(⊥) ≤ . . . µZ. f(Z)

– the greatest f.p.: ⊤ ≥ f (⊤) ≥ f2(⊤) ≥ . . . νZ. f(Z)

When A finite, the fixed points are reached after ≤ |A| iterations.

Example: hA, ≤i = hP(S), ⊆i EXZ = {s : R(s, s) for some s ∈ Z}

Z 7→ EX Z µZ. EX Z = ⊥ = ∅ νZ. EX Z = ?

Z 7→ p ∨ EX Z µZ. p ∨ EX Z = ?

– p. 31/65

(61)

Example

EFp = µZ. p ∨ EX Z Z 7→ p ∨ EX Z

false

7654 0123 //?>=< 89:;

p

// 7654 0123 //

__ 7654 0123

p ∨ EX false ≡ p

7654 0123 //?>=< 89:; /.-, ()*+

p

// 7654 0123 //

__ 7654 0123

p ∨ EX p

7654 0123 '&%$ !"# //?>=< 89:; /.-, ()*+

p

// 7654 0123 //

__ 7654 0123

p ∨ EX (p ∨ EX p)

7654 0123 '&%$ !"# //?>=< 89:; /.-, ()*+

p

// 7654 0123 '&%$ !"# //

__ 7654 0123

(62)

CTL via fixed points

– EFφ = µZ. φ ∨ EX Z Z 7→ φ ∨ EX Z

– AFφ = µZ. φ ∨ AX Z Z 7→ φ ∨ AX Z

– EGφ = νZ. φ ∧ EX Z Z 7→ φ ∧ EX Z

– AGφ = νZ. φ ∧ AX Z Z 7→ φ ∧ AX Z

– Eφ U ψ = µZ. ψ ∨ (φ ∧ EX Z) Z 7→ ψ ∨ (φ ∧ EX Z) – Aφ U ψ = µZ. ψ ∨ (φ ∧ AX Z) Z 7→ ψ ∨ (φ ∧ AX Z) – . . .

– p. 33/65

(63)

Example

EGp = νZ. p ∧ EX Z Z 7→ p ∧ EX Z

true

@AB GFE ?>=< 89:; /.-, ()*+

p

//?>=< 89:; /.-, ()*+

p

//?>=< 89:; /.-, ()*+

p

// 7654 0123 '&%$ !"#FED XX ABC

p ∧ EX true ≡ p

@AB GFE ?>=< 89:; /.-, ()*+

p

//?>=< 89:; /.-, ()*+

p

//?>=< 89:; /.-, ()*+

p

// 7654 0123FED XX ABC

p ∧ EX p

@AB GFE ?>=< 89:; /.-, ()*+

p

//?>=< 89:; /.-, ()*+

p

//?>=< 89:;

p

// 7654 0123FED XX ABC

p ∧ EX (p ∧ EX p)

@AB GFE ?>=< 89:; /.-, ()*+

p

//?>=< 89:;

p

//?>=< 89:;

p

// 7654 0123FED XX ABC

(64)

CTL Symbolic model checking

CTL (¬, ∧, EX, E _ U _ , EG ) (these connectives are sufficient)

OBDD : CTL 7→ OBDD

OBDD(φ) represents {s | s  φ}

– p. 35/65

(65)

CTL Symbolic model checking

CTL (¬, ∧, EX, E _ U _ , EG ) (these connectives are sufficient)

OBDD : CTL 7→ OBDD

OBDD(φ) represents {s | s  φ}

– OBDD(p) := OBDD representing Lp

(66)

CTL Symbolic model checking

CTL (¬, ∧, EX, E _ U _ , EG ) (these connectives are sufficient)

OBDD : CTL 7→ OBDD

OBDD(φ) represents {s | s  φ}

– OBDD(p) := OBDD representing Lp

– OBDD(¬φ) := ¬OBDD(φ)

– p. 35/65

(67)

CTL Symbolic model checking

CTL (¬, ∧, EX, E _ U _ , EG ) (these connectives are sufficient)

OBDD : CTL 7→ OBDD

OBDD(φ) represents {s | s  φ}

– OBDD(p) := OBDD representing Lp

– OBDD(¬φ) := ¬OBDD(φ)

– OBDD(φ ∧ ψ) := OBDD(φ) ∧ OBDD(ψ)

(68)

Symbolic model checking ( EX _ )

OBDD : CTL → OBDD OBDD(φ) represents {s | s  φ}

OBDD( EX φ) := ∃~x. R(~x, ~x) ∧ f [~x/~x] where f = OBDD(φ) OBDD( EX φ) := EXf = EXOBDD(φ)

EXφ EXZ EXf

– p. 36/65

(69)

Order of variables

∃~x. R(~x, ~x) ∧ f [~x/~x])

~x = x1, x2, . . . , xm

x1 < x2 < . . . < xm

x1 < x1 < x2 < x2 < . . . < xm < xm xi < xj if and only if xi < xj

(70)

Symbolic model checking ( E _ U _ )

OBDD : CTL → OBDD OBDD(φ) represents {s | s  φ}

OBDD( E φ U ψ) := µZ. g ∨ (f ∧ EXZ) where f = OBDD(φ) g = OBDD(ψ) h 7→ g ∨ (f ∧EXh)

h 7→ g ∨ (f ∧∃~x. R(~x, ~x) ∧ h[~x/~x])

– p. 38/65

(71)

Symbolic model checking ( E _ U _ )

OBDD : CTL → OBDD OBDD(φ) represents {s | s  φ}

OBDD( E φ U ψ) := µZ. g ∨ (f ∧ EXZ) where f = OBDD(φ) g = OBDD(ψ) h 7→ g ∨ (f ∧EXh)

h 7→ g ∨ (f ∧∃~x. R(~x, ~x) ∧ h[~x/~x])

Implement computation of the approximations of lfp by OBDDs:

h0 ≡ false

h1 ≡ g ∨ (f ∧ EXh0) ≡ g

h2 ≡ g ∨ (f ∧ EXh1) ≡ g ∨ (f ∧ EXg)

h3 ≡ . . . ≡ g ∨ (f ∧ EX(g ∨ (f ∧ EXg)))

(72)

Symbolic model checking ( EG _ )

OBDD : CTL → OBDD OBDD(φ) represents {s | s  φ}

OBDD( EG φ) := νZ. f ∧ EXZ where f = OBDD(φ)

h 7→ f ∧ EXh

h 7→ f ∧ ∃~x. R(~x, ~x) ∧ h[~x/~x]

– p. 39/65

(73)

Symbolic model checking ( EG _ )

OBDD : CTL → OBDD OBDD(φ) represents {s | s  φ}

OBDD( EG φ) := νZ. f ∧ EXZ where f = OBDD(φ)

h 7→ f ∧ EXh

h 7→ f ∧ ∃~x. R(~x, ~x) ∧ h[~x/~x]

Implement computation of the approximations of gfp by OBDDs, as bofore.

(74)

EXφ EφUψ EGφ

EXZ EZ UZ EGZ

EXf Ef Ug EGf

– p. 40/65

(75)

Graph diameter

Efficiency of SMC depends on the diameter of M .

(76)

Fairness

– p. 42/65

(77)

Fair CTL

F = {ψ1, . . . , ψn}, ψi ∈ CTL 7→ F = {Z1, . . . , Zn}

s F p ⇐⇒ p ∈ L(s) ∧ ∃ fair Π from s s F Aφ U ψ ⇐⇒ ∀ fair Π from s . Π  φ U ψ s F Eφ U ψ ⇐⇒ ∃ fair Π from s . Π  φ U ψ s F AXφ ⇐⇒ ∀ fair Π from s . Π  X φ s F EXφ ⇐⇒ ∃ fair Π from s . Π  X φ

F = {h1, . . . , hn}, hi ∈ OBDD

(78)

Fair EG

F = {ψ1, . . . , ψn}, ψi ∈ CTL 7→ F = {Z1, . . . , Zn}

EGφ = {s | s F EGφ} = the greatest Z s.t. if s ∈ Z then – s  φ

– ∀i ≤ n . ∃s . s −→ . . . −→ s ∈ Zi ∩ Z, s 6= s, all intermediate states satisfy φ

– p. 44/65

(79)

Fair EG

F = {ψ1, . . . , ψn}, ψi ∈ CTL 7→ F = {Z1, . . . , Zn}

EGφ = {s | s F EGφ} = the greatest Z s.t. if s ∈ Z then – s  φ

– ∀i ≤ n . ∃s . s −→ . . . −→ s ∈ Zi ∩ Z, s 6= s, all intermediate states satisfy φ

EGφ = νZ. φ ∧ Vn

i=1 EX Eφ U (ψi ∧ Z)

(80)

Fair EG

F = {ψ1, . . . , ψn}, ψi ∈ CTL 7→ F = {Z1, . . . , Zn}

EGφ = {s | s F EGφ} = the greatest Z s.t. if s ∈ Z then – s  φ

– ∀i ≤ n . ∃s . s −→ . . . −→ s ∈ Zi ∩ Z, s 6= s, all intermediate states satisfy φ

EGφ = νZ. φ ∧ Vn

i=1 EX Eφ U (ψi ∧ Z) EGφ = νZ. φ ∧ Vn

i=1 EXµY.(ψi ∧ Z) ∨ (φ ∧ EX Y ) alternation!

– p. 44/65

(81)

Fair EG

Thm:

EGφ = νZ. φ ∧

^n i=1

EX Eφ U (ψi ∧ Z)

Proof:

EGφ = φ ∧

^n i=1

EX Eφ U (ψi ∧ EGφ)

Z = φ ∧

^n i=1

EX Eφ U (ψi ∧ Z) =⇒ Z ⊆ EGφ

(82)

Fair symbolic model checking ( EG _ )

OBDD : CTL → OBDD OBDD(φ) represents {s | s F φ}

F = {ψ1, . . . , ψn}, ψi ∈ CTL 7→ F = {h1, . . . , hn}, hi ∈ OBDD

OBDD( EG φ) := νZ. f ∧ Vn

i=1 EX Ef U (hi ∧ Z)

where f = OBDD(φ)

Z 7→ f ∧

^n i=1

EX Ef U (hi ∧ Z)

– p. 46/65

(83)

Fair CTL symbolic model checking

fair := OBDD( EG true)

OBDD( EX φ) := ∃~x. R(~x, ~x) ∧ f (~x) ∧ fair(~x)

where f = OBDD(φ)

OBDD( E φ U ψ) := µZ. (g ∧ fair) ∨ (f ∧ EXZ)

where f = OBDD(φ) g = OBDD(ψ)

(84)

How to compute EX f ?

– p. 48/65

(85)

EX f by AndExist

EXf := ∃~x. R(~x, ~x) ∧ f (~x)

operation ∃∧(g, h, V ) := ∃V. g ∧ h (V – set of variables)

R(x1, . . . , xm, x1, . . . , xm)

f (x1, . . . , xm) 7→ f(x1, . . . , xm) xi ≤ xj ⇐⇒ xi ≤ xj

EXf = ∃∧(R, f,{x1, . . . , xm})

(86)

AndExist

∃∧( f, g, V ) ( ∃V. f ∧ g )

– f, g leaves: val(∃∧(f, g, V )) := val(f ) ∧ val(g) – f a leaf, g not: ∃∧(f, g, V ) := false or ∃V. g – x = var(f ) = var(g):

l := ∃∧(s0(f ), s0(g), V ), h := ∃∧(s1(f ), s1(g), V ) – x ∈ V : ∃∧(f, g, V ) := l ∨ h

– x /∈ V : s0(∃∧(f, g, V )) := l s1(∃∧(f, g, V )) := h – x = var(f ) < var(g): . . .

f • g = ¬x ∧ (f |x←0 • g|x←0) ∨ x ∧ (f |x←1 • g|x←1)

– p. 50/65

(87)

R is not monolytic

EXf := ∃~x. R(~x, ~x) ∧ f (~x)

Asynchronous model: R = R1 ∨ R2 ∨ . . . ∨ Rn

Ri = Ri ∧ V

j6=i Idj

Synchronous model: R = R1 ∧ R2 ∧ . . . ∧ Rn

Can one profit from this additional structure ?

(88)

Asynchronous model: R = R1 ∨ R2 ∨ . . . ∨ Rn

Ri = Ri ∧ V

j6=i xj = xj

∃~x. R ∧ f (~x) ≡ ∃~x. (R1 ∧ f (~x)) ∨ . . . ∨ (Rn ∧ f (~x))

≡ ∃~x. R1 ∧ f (~x)

∨ . . . ∨ ∃~x. Rn ∧ f (~x)

∃~x. Ri ∧ f (~x) ≡ ∃~x. Ri ∧ (V

j6=i xj = xj) ∧ f (~x)

≡ ∃xi. Ri(~x, xi) ∧ f (x1, . . . , xi−1, xi, xi+1, . . . , xm)

– p. 52/65

(89)

Synchronous model: R = R1 ∧ R2 ∧ . . . ∧ Rn

∃~x. R1(~x, ~x) ∧ . . . ∧ Rn(~x, ~x) ∧ f (~x)

– relations Ri are local – „early” quantification – heuristics

(90)

Example: 3-bit counter

R0(~x, x0) = (x0 = ¬x0)

R1(~x, x1) = (x1 = x0 xor x1)

R2(~x, x2) = (x2 = (x0 ∧ x1) xor x2)

∃x2∃x1∃x0. f (x0, x1, x2) ∧ R0(~x, x0) ∧ R1(~x, x1) ∧ R2(~x, x2)

∃x2 ∃x1∃x0. f (x0, x1, x2) ∧ R0(~x, x0) ∧ R1(~x, x1)

∧ R2(~x, x2)

∃x2 ∃x1 ∃x0. f (x0, x1, x2) ∧ R0(~x, x0)

∧ R1(~x, x1)

∧ R2(~x, x2)

∃x2 ∃x1 ∃x0. f (x0, x1, x2) ∧ R0(x0, x0)

∧ R1(x0, x1, x1)

∧ R2(x0, x1, x2, x2)

– p. 54/65

(91)

Example: 3-bit counter

∃x2 ∃x1 ∃x0 f (x0, x1, x2) ∧ R0(x0, x0)

∧ R1(x0, x1, x1)

∧ R2(x0, x1, x2, x2)

– sequence of ∃∧ operations

– optimal order of processes (not variables this time):

– early elimination of variables (∃) – late introducing of variables

(92)

(Counter)examples

– p. 56/65

(93)

Counterexample

counterexample for AFφ = example for EG¬φ

(94)

Counterexample

counterexample for AFφ = example for EG¬φ counterexample for AGφ = example for EF¬φ ( fair counterexample is always an infinite path )

(95)

Counterexample

counterexample for AFφ = example for EG¬φ counterexample for AGφ = example for EF¬φ ( fair counterexample is always an infinite path )

counterexample for EFφ = ? counterexample for EGφ = ?

(96)

Symbolic counterexample

How to compute an example for:

– EGφ – Eφ U ψ – EXφ

symbolically ?

– p. 58/65

(97)

Example for E _ U _

Computation of Ef U g:

Q0 ⊆ Q1 ⊆ . . . (1 ≤ i ≤ n)

s ∈ Qj ⇐⇒ g may be reached from s "via f " by ≤ j transitions

Computing an example for s  E f U g:

– let j minimal s.t. s ∈ Qj

– reconstruct s = sj −→ sj−1 −→ . . . −→ s0 ∈ g

(98)

Symbolic counterexample

How to compute a fair example for:

– EGφ – Eφ U ψ – EXφ

symbolically ?

[Clarke, Grumberg, Long 1994]

– p. 60/65

(99)

Fair example for EG _

EGf = νZ. f ∧

^n i=1

EX Ef U (hi ∧ Z)

last iteration Z 7→ f ∧ Vn

i=1 EX Ef U (hi ∧ Z):

computation of Ef U (hi ∧ Z): Z = EGf Qi0 ⊆ Qi1 ⊆ . . . (1 ≤ i ≤ n)

(100)

Fair example for EG _

EGf = νZ. f ∧

^n i=1

EX Ef U (hi ∧ Z)

s := s0 initial state I := {1, . . . , n}

repeat

find t s.t. s −→ t, t ∈ Qij, i ∈ I, j minimal

reconstruct t = tj −→ tj−1 −→ . . . −→ t0 ∈ (hi ∧ EGf) I := I \ {i | t0 ∈ hi}

s := t0 I := I \ {i | t ∈ Qij}

until I = ∅

s := s 7→ path s0 −→ . . . −→ s

– p. 61/65

(101)

Fair example for EG _

[Clarke, Grumberg, Long 1994]

(102)

Fair example for EG _

EGf = νZ. f ∧

^n i=1

EX Ef U (hi ∧ Z)

we have a path s0 −→ . . . −→ s let t = the first t0

(a) if s  EX E f U {t} stop

otherwise restart: s0 := s, I := {1, . . . , n}

improvement:

(b) compute Ef U{t}

as long as ¬(s  E f U {t}), restart: s0 := s, I := {1, . . . , n}

– p. 63/65

(103)

Fair example for E _ U _, EX _

Example for Eφ U (ψ ∧ fair) or EX (φ ∧ fair) extend with a fair example for EG true.

(104)

What else can be computed using OBDDs ?

– Lω(A) 6= ∅ fair EG true

– LTL model checking

– Lω(A1) ⊆ Lω(A2) A1 × A2  A ( G F q1 =⇒ G F q2) – µ-calculus model checking

– reachable states – deadlocks

– (bi)simulation equivalence – . . .

– p. 65/65

(105)

What else can be computed using OBDDs ?

– Lω(A) 6= ∅ fair EG true

– LTL model checking

– Lω(A1) ⊆ Lω(A2) A1 × A2  A ( G F q1 =⇒ G F q2) – µ-calculus model checking

– reachable states – deadlocks

– (bi)simulation equivalence – . . .

OBDDs are routinely used in hardware

industry nowadays

Cytaty

Powiązane dokumenty

dla IV roku matematyki, zastosowania rach, prob i stat. Przy za lo˙zeniach zad. Przy za lo˙zeniach zad. Niech spe lnione be.

Wiemy, że przekształcenia elementarne macie- rzy polegające na dodaniu do wiersza innego wiersza pomnożonego przez liczbę nie zmieniają wartości wyznacznika, zaś

In this paper, we give some evidence that (2) may hold for all positive integers n, by showing in Theorem 2 that the lower density of the set of all integers satisfying (2) is

We prove that, as in the measurable case, a typical continuous Anzai cocycle of topological degree zero is both rank-1 and weakly mixing.. Definitions and

[r]

[r]

Norma operatora (jako pewien kres górny i jako kres dolny), porównanie silnej zbieżności ciągu operatorów ze zbieżnością w normie.. euklidesową, automatyczna

Keywords and phrases: differential inclusions, boundary value prob- lem, fixed point, compact, convex, nonconvex, decomposable, continu- ous selection, controllability..