Verification of Concurrent Systems
Ahmed Bouajjani
LIAFA, University Paris Diderot – Paris 7
MOVEP’12, CIRM, December 2012
- A. Bouajjani (LIAFA, UP7)
Verification of Concurrent Systems December 2012 1 / 42
Verification of Concurrent Systems Ahmed Bouajjani LIAFA, - - PowerPoint PPT Presentation
Verification of Concurrent Systems Ahmed Bouajjani LIAFA, University Paris Diderot Paris 7 MOVEP12, CIRM, December 2012 A. Bouajjani (LIAFA, UP7) Verification of Concurrent Systems December 2012 1 / 42 Concurrent Programs Parallel
Verification of Concurrent Systems December 2012 1 / 42
Verification of Concurrent Systems December 2012 2 / 42
◮ Shared memory ⋆ Notion of action atomicity ⋆ Actions by a same threads are executed in the same order
⋆ Actions by different threads are interleaved non-deterministically
Verification of Concurrent Systems December 2012 2 / 42
◮ Shared memory ⋆ Notion of action atomicity ⋆ Actions by a same threads are executed in the same order
⋆ Actions by different threads are interleaved non-deterministically ◮ Message passing ⋆ Channels (queues) ⋆ Unordered/FIFO ... ⋆ Perfect/Lossy
Verification of Concurrent Systems December 2012 2 / 42
◮ Shared memory ⋆ Notion of action atomicity ⋆ Actions by a same threads are executed in the same order
⋆ Actions by different threads are interleaved non-deterministically ◮ Message passing ⋆ Channels (queues) ⋆ Unordered/FIFO ... ⋆ Perfect/Lossy
Verification of Concurrent Systems December 2012 2 / 42
Verification of Concurrent Systems December 2012 3 / 42
Verification of Concurrent Systems December 2012 3 / 42
Verification of Concurrent Systems December 2012 3 / 42
Verification of Concurrent Systems December 2012 4 / 42
Verification of Concurrent Systems December 2012 4 / 42
Verification of Concurrent Systems December 2012 4 / 42
◮ Independent actions ⇒ commutable actions ⇒ many interleavings ◮ Explore representatives up to independent actions commutations ◮ Compact representations of sets of behaviors (Unfoldings)
◮ Compact representations of sets of states (e.g., BDD) ◮ Encoding bounded-length computation + SAT solvers
Verification of Concurrent Systems December 2012 5 / 42
◮ Undecidable in general if threads Ids are allowed ◮ ⇒ Anonymous threads
◮ Undecidable in general in case of FIFO queues ◮ ⇒ Unordered queues (multisets), lossy queues
Verification of Concurrent Systems December 2012 6 / 42
Verification of Concurrent Systems December 2012 7 / 42
◮ Finite number of possible local states ℓ1, . . . , ℓm ◮ Count how many threads are in a given local state
Verification of Concurrent Systems December 2012 7 / 42
◮ Finite number of possible local states ℓ1, . . . , ℓm ◮ Count how many threads are in a given local state
Verification of Concurrent Systems December 2012 7 / 42
◮ ci := ci + 1 ◮ ci > 0 / ci := ci − 1
◮ op = “ci := ci + 1”, and V2 = V1[ci ← (V1(ci) + 1)] ◮ op = “ci > 0 / ci := ci − 1, and
Verification of Concurrent Systems December 2012 8 / 42
Verification of Concurrent Systems December 2012 9 / 42
Verification of Concurrent Systems December 2012 10 / 42
◮ S ⊆ S, ◮ ∀x, y. (x ∈ S and x y) ⇒ y ∈ S.
◮ Assume there is a function Min which associates a minor to each set. ◮ Assume pre(Min(S)) is computable for each set S.
Verification of Concurrent Systems December 2012 11 / 42
Verification of Concurrent Systems December 2012 12 / 42
1 Let S be an upward closed set. 2 Assume pre(S) is not upward closed. 3 Let c1 ∈ pre(S), and let c2 ∈ U such that c1 c2 and c2 ∈ pre(S)
Verification of Concurrent Systems December 2012 12 / 42
1 Let S be an upward closed set. 2 Assume pre(S) is not upward closed. 3 Let c1 ∈ pre(S), and let c2 ∈ U such that c1 c2 and c2 ∈ pre(S) 4 Let c′
Verification of Concurrent Systems December 2012 12 / 42
1 Let S be an upward closed set. 2 Assume pre(S) is not upward closed. 3 Let c1 ∈ pre(S), and let c2 ∈ U such that c1 c2 and c2 ∈ pre(S) 4 Let c′
5 Monotonicity ⇒ there is a c′
Verification of Concurrent Systems December 2012 12 / 42
1 Let S be an upward closed set. 2 Assume pre(S) is not upward closed. 3 Let c1 ∈ pre(S), and let c2 ∈ U such that c1 c2 and c2 ∈ pre(S) 4 Let c′
5 Monotonicity ⇒ there is a c′
6 S is upward closed ⇒ c′
Verification of Concurrent Systems December 2012 12 / 42
1 Let S be an upward closed set. 2 Assume pre(S) is not upward closed. 3 Let c1 ∈ pre(S), and let c2 ∈ U such that c1 c2 and c2 ∈ pre(S) 4 Let c′
5 Monotonicity ⇒ there is a c′
6 S is upward closed ⇒ c′
7 ⇒ c2 ∈ pre(S), contradiction.
Verification of Concurrent Systems December 2012 12 / 42
1 Let S be an upward closed set. 2 Assume pre(S) is not upward closed. 3 Let c1 ∈ pre(S), and let c2 ∈ U such that c1 c2 and c2 ∈ pre(S) 4 Let c′
5 Monotonicity ⇒ there is a c′
6 S is upward closed ⇒ c′
7 ⇒ c2 ∈ pre(S), contradiction. 8 For pre∗: the union of upward closed sets is upward closed.
Verification of Concurrent Systems December 2012 12 / 42
Verification of Concurrent Systems December 2012 13 / 42
Verification of Concurrent Systems December 2012 13 / 42
Verification of Concurrent Systems December 2012 13 / 42
Verification of Concurrent Systems December 2012 14 / 42
◮ op = “cj := cj + 1” :
i=j li ≤ ci) ∧ (max(lj − 1, 0) ≤ cj)
◮ op = “cj > 0/cj − 1”: (
i=j li ≤ ci) ∧ (lj + 1 ≤ cj)
Verification of Concurrent Systems December 2012 14 / 42
◮ op = “cj := cj + 1” :
i=j li ≤ ci) ∧ (max(lj − 1, 0) ≤ cj)
◮ op = “cj > 0/cj − 1”: (
i=j li ≤ ci) ∧ (lj + 1 ≤ cj)
Verification of Concurrent Systems December 2012 14 / 42
Verification of Concurrent Systems December 2012 15 / 42
◮ Send: Left concatenation + Upward closure ◮ Receive: Right derivation
Verification of Concurrent Systems December 2012 15 / 42
◮ Send: Left concatenation + Upward closure ◮ Receive: Right derivation
Verification of Concurrent Systems December 2012 15 / 42
Verification of Concurrent Systems December 2012 16 / 42
Verification of Concurrent Systems December 2012 16 / 42
◮ Classes of programs with particular features ◮ Particular kind of behaviors
Verification of Concurrent Systems December 2012 16 / 42
◮ Calls are stored and dispatched later by the scheduler ◮ They can be executed in any order
Verification of Concurrent Systems December 2012 17 / 42
Verification of Concurrent Systems December 2012 18 / 42
Verification of Concurrent Systems December 2012 19 / 42
Verification of Concurrent Systems December 2012 20 / 42
◮ {(0, 0) + k(1, 1) : k ≥ 0} ≡ x1 = x2 ◮ {(0, 0) + k(1, 2) : k ≥ 0} ≡ 2x1 = x2 ◮ {(0, 3) + k(1, 1) : k ≥ 0} ≡ x1 + 3 = x2 ◮ {(0, 3) + k1(0, 1) + k2(1, 1) : k ≥ 0} ≡ x1 + 3 ≤ x2 ◮ {(0, 0, 0) + k1(1, 0, 1) + k2(0, 1, 1) : k1, k2 ≥ 0} ≡ x1 + x2 = x3 ◮ {(0, 0, 3) + k1(1, 0, 2) + k2(0, 1, 1) : k1, k2 ≥ 0} ≡ 2x1 + x2 + 3 = x3
Verification of Concurrent Systems December 2012 21 / 42
◮ {(0, 0) + k(1, 1) : k ≥ 0} ≡ x1 = x2 ◮ {(0, 0) + k(1, 2) : k ≥ 0} ≡ 2x1 = x2 ◮ {(0, 3) + k(1, 1) : k ≥ 0} ≡ x1 + 3 = x2 ◮ {(0, 3) + k1(0, 1) + k2(1, 1) : k ≥ 0} ≡ x1 + 3 ≤ x2 ◮ {(0, 0, 0) + k1(1, 0, 1) + k2(0, 1, 1) : k1, k2 ≥ 0} ≡ x1 + x2 = x3 ◮ {(0, 0, 3) + k1(1, 0, 2) + k2(0, 1, 1) : k1, k2 ≥ 0} ≡ 2x1 + x2 + 3 = x3
Verification of Concurrent Systems December 2012 21 / 42
◮ L1 = {anbn : n ≥ 0}, φ(L1) = {(x1, x2) : x1 = x2} ◮ L2 = {anbncn : n ≥ 0}, φ(L2) = {(x1, x2, x3) : x1 = x2 ∧ x2 = x3} ◮ L3 = (ab)∗ = {(ab)n : n ≥ 0}, φ(L3) = {(x1, x2) : x1 = x2}
Verification of Concurrent Systems December 2012 22 / 42
Verification of Concurrent Systems December 2012 23 / 42
Verification of Concurrent Systems December 2012 23 / 42
Verification of Concurrent Systems December 2012 24 / 42
Verification of Concurrent Systems December 2012 24 / 42
Verification of Concurrent Systems December 2012 24 / 42
Verification of Concurrent Systems December 2012 24 / 42
Verification of Concurrent Systems December 2012 24 / 42
Verification of Concurrent Systems December 2012 24 / 42
Verification of Concurrent Systems December 2012 24 / 42
Verification of Concurrent Systems December 2012 24 / 42
◮ Interaction between recursion and communication
◮ Kind of channels (e.g., lossy, unordered) ◮ Topology of the network
Verification of Concurrent Systems December 2012 25 / 42
Verification of Concurrent Systems December 2012 26 / 42
Verification of Concurrent Systems December 2012 26 / 42
Verification of Concurrent Systems December 2012 26 / 42
Verification of Concurrent Systems December 2012 27 / 42
Verification of Concurrent Systems December 2012 27 / 42
Verification of Concurrent Systems December 2012 28 / 42
Verification of Concurrent Systems December 2012 28 / 42
Verification of Concurrent Systems December 2012 29 / 42
Verification of Concurrent Systems December 2012 29 / 42
Verification of Concurrent Systems December 2012 29 / 42
◮ A′
j+1 = pre∗ ij+1(Xj+1[ij+1]) ∩ qjΓ∗ i
◮ Xj = (qj, Aj+1
1
j+1, . . . , Aj+1 n
Verification of Concurrent Systems December 2012 29 / 42
Verification of Concurrent Systems December 2012 30 / 42
Verification of Concurrent Systems December 2012 30 / 42
Verification of Concurrent Systems December 2012 31 / 42
Verification of Concurrent Systems December 2012 31 / 42
◮ I i = (I i
1, . . . I i K), the global states when Ti starts/is resumed
◮ Oi = (Oi
1, . . . Oi K), the global states when Ti terminates/is interrupted
Verification of Concurrent Systems December 2012 31 / 42
◮ I i = (I i
1, . . . I i K), the global states when Ti starts/is resumed
◮ Oi = (Oi
1, . . . Oi K), the global states when Ti terminates/is interrupted
Verification of Concurrent Systems December 2012 31 / 42
◮ I i = (I i
1, . . . I i K), the global states when Ti starts/is resumed
◮ Oi = (Oi
1, . . . Oi K), the global states when Ti terminates/is interrupted
Verification of Concurrent Systems December 2012 31 / 42
◮ I i = (I i
1, . . . I i K), the global states when Ti starts/is resumed
◮ Oi = (Oi
1, . . . Oi K), the global states when Ti terminates/is interrupted
◮ O1
j = I 2 j for every j ∈ {1, . . . , K}
◮ O2
j = I 1 j+1 for every j ∈ {1, . . . , K − 1}
Verification of Concurrent Systems December 2012 31 / 42
Verification of Concurrent Systems December 2012 32 / 42
j , for j ∈ {1, . . . , K}
1
j )
2
j , and runs by using X ′ j as global variables
3
4
j+1).
5
Verification of Concurrent Systems December 2012 32 / 42
j , for j ∈ {1, . . . , K}
1
j )
2
j , and runs by using X ′ j as global variables
3
4
j+1).
5
1
j that was produced by T1 in its j-th round
2
j as global variables
3
4
j = Xj+1 (composability check), and move to round j + 1
5
Verification of Concurrent Systems December 2012 32 / 42
Verification of Concurrent Systems December 2012 33 / 42
Verification of Concurrent Systems December 2012 33 / 42
Verification of Concurrent Systems December 2012 34 / 42
Verification of Concurrent Systems December 2012 34 / 42
Verification of Concurrent Systems December 2012 35 / 42
Verification of Concurrent Systems December 2012 35 / 42
Verification of Concurrent Systems December 2012 35 / 42
Verification of Concurrent Systems December 2012 35 / 42
Verification of Concurrent Systems December 2012 36 / 42
◮ Unbounded number of pending local contexts ◮ Can not use the same construction as for the case of finite state
Verification of Concurrent Systems December 2012 36 / 42
◮ Unbounded number of pending local contexts ◮ Can not use the same construction as for the case of finite state
Verification of Concurrent Systems December 2012 36 / 42
γ1
1
γ2
2
γ3
Verification of Concurrent Systems December 2012 37 / 42
γ1
1
γ2
2
γ3
◮ Guesses the effect of the environment on the states
1
2
Verification of Concurrent Systems December 2012 37 / 42
γ1
1
γ2
2
γ3
◮ Guesses the effect of the environment on the states
1
2
1)
2)
Verification of Concurrent Systems December 2012 37 / 42
γ1
1
γ2
2
γ3
◮ Makes visible (as transition labels) the created threads
1
2
1)
2)
Verification of Concurrent Systems December 2012 37 / 42
γ1
1
γ2
2
γ3
◮ Makes visible (as transition labels) the created threads
1
2
1)
2)
Verification of Concurrent Systems December 2012 37 / 42
1
2
1)
2)
Verification of Concurrent Systems December 2012 38 / 42
1
2
1)
2)
Verification of Concurrent Systems December 2012 38 / 42
1
2
1)
2)
Verification of Concurrent Systems December 2012 38 / 42
1
2
1)
2)
Verification of Concurrent Systems December 2012 38 / 42
Verification of Concurrent Systems December 2012 39 / 42
Verification of Concurrent Systems December 2012 40 / 42
Verification of Concurrent Systems December 2012 41 / 42
Verification of Concurrent Systems December 2012 41 / 42
Verification of Concurrent Systems December 2012 41 / 42
Verification of Concurrent Systems December 2012 41 / 42
◮ Transform thread creation into procedure calls ◮ Allow some reordering using the idea of bounded interfaces
Verification of Concurrent Systems December 2012 41 / 42
Verification of Concurrent Systems December 2012 42 / 42
Verification of Concurrent Systems December 2012 42 / 42
Verification of Concurrent Systems December 2012 42 / 42
Verification of Concurrent Systems December 2012 42 / 42
Verification of Concurrent Systems December 2012 42 / 42
◮ K-context-bounded ultimately periodic behaviors
◮ Scope-bounded analysis
Verification of Concurrent Systems December 2012 42 / 42