Lecture 1: Verification of Concurrent Programs Part 1: Decidability - - PowerPoint PPT Presentation

lecture 1 verification of concurrent programs
SMART_READER_LITE
LIVE PREVIEW

Lecture 1: Verification of Concurrent Programs Part 1: Decidability - - PowerPoint PPT Presentation

Lecture 1: Verification of Concurrent Programs Part 1: Decidability and Complexity Results Ahmed Bouajjani LIAFA, University Paris Diderot Paris 7 VTSA, MPI-Saarbr ucken, September 2012 A. Bouajjani (LIAFA, UP7) Lecture 1: Concurrent


slide-1
SLIDE 1

Lecture 1: Verification of Concurrent Programs

Part 1: Decidability and Complexity Results Ahmed Bouajjani

LIAFA, University Paris Diderot – Paris 7

VTSA, MPI-Saarbr¨ ucken, September 2012

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 1 / 28

slide-2
SLIDE 2

Outline of the lectures

Lecture 1: Concurrent programs: Decidability and complexity Results

◮ Basic models ◮ Limits of the decidability of the reachability problem ◮ Classes of programs/models with a decidable state reachability problem

Lecture 2: Concurrent programs: Under-approximate analysis

◮ Bounded analysis for concurrent programs ◮ Decidability and complexity issues ◮ Compositional reduction to state reachability in sequential programs

Lecture 3: Weak memory models: State reachability problem

◮ Weaker models than Sequential Consistency ◮ (Un)Decidability and complexity of the state reachability problem ◮ Efficient under-approximate analysis: Reduction to SC state reachability

Lecture 4: Weak memory models: Robustness against a WMM

◮ Check that all behaviors are still sequentially consistent ◮ Decidability and complexity ◮ Reduction to SC state reachability

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 2 / 28

slide-3
SLIDE 3

Concurrent Programs

Parallel threads (with/without procedure calls) Static/Dynamic number of threads Communication

◮ Shared memory ⋆ Notion of action atomicity ⋆ Actions by a same threads are executed in the same order

(Sequential Consistency)

⋆ Actions by different threads are interleaved non-deterministically ◮ Message passing ⋆ Channels (queues) ⋆ Unordered/FIFO ... ⋆ Perfect/Lossy

We assume finite data domain (e.g., booleans).

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 3 / 28

slide-4
SLIDE 4

Finite number of threads + Shared variables

Fixed number of threads Iterative processes (no recursive procedure calls) Finite number of variables

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 4 / 28

slide-5
SLIDE 5

Finite number of threads + Shared variables

Fixed number of threads Iterative processes (no recursive procedure calls) Finite number of variables A variable has a finite number of possible values ⇒ Finite product of finite-state systems (threads + variables) ⇒ Decidable

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 4 / 28

slide-6
SLIDE 6

Finite number of threads + Shared variables

Fixed number of threads Iterative processes (no recursive procedure calls) Finite number of variables A variable has a finite number of possible values ⇒ Finite product of finite-state systems (threads + variables) ⇒ Decidable Product grows exponentially in # threads and # variables. Reachability is decidable, and PSPACE-complete.

[Kozen, FOCS’77]

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 4 / 28

slide-7
SLIDE 7

Finite number of threads + bounded queues

Fixed number of threads Iterative processes (no recursive procedure calls) Bounded channels

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 5 / 28

slide-8
SLIDE 8

Finite number of threads + bounded queues

Fixed number of threads Iterative processes (no recursive procedure calls) Bounded channels ⇒ Finite number of possible channel contents ⇒ Finite product of finite-state systems (threads + channels) ⇒ Decidable

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 5 / 28

slide-9
SLIDE 9

Finite number of threads + bounded queues

Fixed number of threads Iterative processes (no recursive procedure calls) Bounded channels ⇒ Finite number of possible channel contents ⇒ Finite product of finite-state systems (threads + channels) ⇒ Decidable Product grows exponentially in # threads and size of channels. Reachability is decidable, and PSPACE-complete.

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 5 / 28

slide-10
SLIDE 10

Facing the state-space explosion

Partial order techniques

◮ Independent actions ⇒ commutable actions ⇒ many interleavings ◮ Explore representatives up to independent actions commutations

Godefroid, Wolper, Peled, Holzman, Valmari, ...

Symbolic techniques

◮ Compact representations of sets of states + fixpoint calculations ◮ Bounded model checking + SAT solvers

Clarke, McMillan, Somenzi, Biere, Cimatti, ...

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 6 / 28

slide-11
SLIDE 11

Beyond the finite-state case

Unbounded (parametric/dynamic) number of threads

◮ Undecidable in general if threads Ids are allowed ◮ ⇒ Anonymous threads

Unbounded channels

◮ Undecidable in general in case of FIFO queues ◮ ⇒ Unordered queues (multisets), lossy queues

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 7 / 28

slide-12
SLIDE 12

Programs with Dynamic Creation of Threads

Finite number of variables Finite data domain ⇒ Threads are anonymous (no way to refer to identities)

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 8 / 28

slide-13
SLIDE 13

Programs with Dynamic Creation of Threads

Finite number of variables Finite data domain ⇒ Threads are anonymous (no way to refer to identities) Iterative processes (no recursive procedure calls) ⇒ Counting abstraction

◮ Finite number of possible local states ℓ1, . . . , ℓm ◮ Count how many threads are in a given local state

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 8 / 28

slide-14
SLIDE 14

Programs with Dynamic Creation of Threads

Finite number of variables Finite data domain ⇒ Threads are anonymous (no way to refer to identities) Iterative processes (no recursive procedure calls) ⇒ Counting abstraction

◮ Finite number of possible local states ℓ1, . . . , ℓm ◮ Count how many threads are in a given local state

Safety is reducible to state reachability in VASS / Coverability in PN

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 8 / 28

slide-15
SLIDE 15

Vector Addtion Systems with States

Finite state machine + finite number of counter C = {c1, . . . , cn}. Operations: (No test to zero)

◮ ci := ci + 1 ◮ ci > 0 / ci := ci − 1

Configuration: (q, V ) where q is a control state and V ∈ Nn Initial configuration: (q0, 0) where 0 = 0n. Transition relation: (q1, V1)

  • p

− − →(q2, V2) iff

◮ op = “ci := ci + 1”, and V2 = V1[ci ← (V1(ci) + 1)] ◮ op = “ci > 0 / ci := ci − 1, and

(V1(ci) > 0 and V2 = V1[ci ← (V1(ci) − 1)])

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 9 / 28

slide-16
SLIDE 16

From Multithreaded Programs to VASS

Associate a control state with each valuation of the globals Associate a counter with each valuation of thread locals A statement moving globals from g to g′ and locals from ℓ to ℓ′: g

cℓ>0/cℓ:=cℓ−1 ; cℓ′:=cℓ′+1

− − − − − − − − − − − − − − − − − → g′ Creation of a new thread at initial state ℓ: g

cℓ:=cℓ+1

− − − − − − → g

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 10 / 28

slide-17
SLIDE 17

VASS: Reachability Problems

State reachability problem:

Given a state q, determine if a configuration (q, V ) is reachable, for some V ∈ Nn (any one).

Coverability problem:

Given a configuration (q, V ), determine if a configuration (q, V ′) is reachable, for some V ′ ≥ V . (We say that (q, V ) is coverable.) EXSPACE-complete [Rackoff 78]

NB: Coverability can be reduced to State reachability and vice-versa. Configuration reachability problem:

Determine if a given configuration (q, V ) is reachable. Decidable [Mayr 81], [Kosaraju 82]. EXPSPACE-hard [Lipton 75]. No upper bound known.

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 11 / 28

slide-18
SLIDE 18

Well Structured Systems

[Abdulla et al. 96], [Finkel, Schnoebelen, 00]

Let U be a universe. Well-quasi ordering over U: ∀c0, c1, c2, . . . , ∃i < j, ci cj ⇒ Each (infinite) set has a finite minor set. Let S ⊆ U. Upward-closure S = minimal subset of U s.t.

◮ S ⊆ S, ◮ ∀x, y. (x ∈ S and x y) ⇒ y ∈ S.

A set is upward closed if S = S Upward closed sets are definable by their minor sets

◮ Assume there is a function Min which associates a minor to each set. ◮ Assume pre(Min(S)) is computable for each set S.

Monotonicity: is a simulation relation ∀c1, c′

1, c2.

  • (c1 −

→ c′

1 and c1 c2) ⇒ ∃c′

  • 2. c2 −

→ c′

2 and c′ 1 c′ 2

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 12 / 28

slide-19
SLIDE 19

Key lemma

Lemma The pre and pre∗ images of upward closed set are upward closed

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)

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 13 / 28

slide-20
SLIDE 20

Key lemma

Lemma The pre and pre∗ images of upward closed set are upward closed

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′

1 ∈ S such that c1 −

→ c′

1

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 13 / 28

slide-21
SLIDE 21

Key lemma

Lemma The pre and pre∗ images of upward closed set are upward closed

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′

1 ∈ S such that c1 −

→ c′

1

5 Monotonicity ⇒ there is a c′

2 such that c2 −

→ c′

2 and c′ 1 c′ 2

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 13 / 28

slide-22
SLIDE 22

Key lemma

Lemma The pre and pre∗ images of upward closed set are upward closed

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′

1 ∈ S such that c1 −

→ c′

1

5 Monotonicity ⇒ there is a c′

2 such that c2 −

→ c′

2 and c′ 1 c′ 2

6 S is upward closed ⇒ c′

2 ∈ S

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 13 / 28

slide-23
SLIDE 23

Key lemma

Lemma The pre and pre∗ images of upward closed set are upward closed

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′

1 ∈ S such that c1 −

→ c′

1

5 Monotonicity ⇒ there is a c′

2 such that c2 −

→ c′

2 and c′ 1 c′ 2

6 S is upward closed ⇒ c′

2 ∈ S

7 ⇒ c2 ∈ pre(S), contradiction.

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 13 / 28

slide-24
SLIDE 24

Key lemma

Lemma The pre and pre∗ images of upward closed set are upward closed

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′

1 ∈ S such that c1 −

→ c′

1

5 Monotonicity ⇒ there is a c′

2 such that c2 −

→ c′

2 and c′ 1 c′ 2

6 S is upward closed ⇒ c′

2 ∈ S

7 ⇒ c2 ∈ pre(S), contradiction. 8 For pre∗: the union of upward closed sets is upward closed.

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 13 / 28

slide-25
SLIDE 25

Backward Reachability Analysis

Consider the increasing sequence X0 ⊆ X1 ⊆ X2 . . . defined by: X0 = Min(S) Xi+1 = Xi ∪ Min(pre(Xi)) Termination: There is a index i ≥ 0 such that Xi+1 = Xi The set pre∗(S) is upward closed ⇒ has a finite minor Wait until a minor is collected How long shall we wait? Non primitive recursive in general

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 14 / 28

slide-26
SLIDE 26

The case of VASS

Usual ≤ order over N is a WQO (Dickson lemma) Product of WQO’s is a WQO. ⇒ ≤ generalized to Nn is a WQO.

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 15 / 28

slide-27
SLIDE 27

The case of VASS

Usual ≤ order over N is a WQO (Dickson lemma) Product of WQO’s is a WQO. ⇒ ≤ generalized to Nn is a WQO. Upward-closed sets = finite disjunctions of n

i=1 li ≤ ci, where li ∈ N

Computation of the Pre:

◮ 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)

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 15 / 28

slide-28
SLIDE 28

The case of VASS

Usual ≤ order over N is a WQO (Dickson lemma) Product of WQO’s is a WQO. ⇒ ≤ generalized to Nn is a WQO. Upward-closed sets = finite disjunctions of n

i=1 li ≤ ci, where li ∈ N

Computation of the Pre:

◮ 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)

No test to zero, only guards of the form c > 0 ⇒ Monotonicity ⇒ Coverability is decidable.

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 15 / 28

slide-29
SLIDE 29

The case of VASS

Usual ≤ order over N is a WQO (Dickson lemma) Product of WQO’s is a WQO. ⇒ ≤ generalized to Nn is a WQO. Upward-closed sets = finite disjunctions of n

i=1 li ≤ ci, where li ∈ N

Computation of the Pre:

◮ 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)

No test to zero, only guards of the form c > 0 ⇒ Monotonicity ⇒ Coverability is decidable. Can we have operation of the following forms? : ci := 0, ci := cj, ci := ci + cj, ci := cj + ck

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 15 / 28

slide-30
SLIDE 30

The case of VASS

Usual ≤ order over N is a WQO (Dickson lemma) Product of WQO’s is a WQO. ⇒ ≤ generalized to Nn is a WQO. Upward-closed sets = finite disjunctions of n

i=1 li ≤ ci, where li ∈ N

Computation of the Pre:

◮ 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)

No test to zero, only guards of the form c > 0 ⇒ Monotonicity ⇒ Coverability is decidable. Can we have operation of the following forms? : ci := 0, ci := cj, ci := ci + cj, ci := cj + ck Coverability is still decidable. (But not reachability. [Dufourd et al. 98])

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 15 / 28

slide-31
SLIDE 31

The case of Lossy Fifo Channel Systems

Subword relation over a finite alphabet is a WQO (Higman’s lemma)

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 16 / 28

slide-32
SLIDE 32

The case of Lossy Fifo Channel Systems

Subword relation over a finite alphabet is a WQO (Higman’s lemma) Upward-closed sets = finite unions of Σ∗a1Σ∗a2 · · · amΣ∗ Computation of the Pre:

◮ Send: Left concatenation + Upward closure ◮ Receive: Right derivation

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 16 / 28

slide-33
SLIDE 33

The case of Lossy Fifo Channel Systems

Subword relation over a finite alphabet is a WQO (Higman’s lemma) Upward-closed sets = finite unions of Σ∗a1Σ∗a2 · · · amΣ∗ Computation of the Pre:

◮ Send: Left concatenation + Upward closure ◮ Receive: Right derivation

Lossyness ⇒ Monotonicity ⇒ Coverability is decidable.

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 16 / 28

slide-34
SLIDE 34

The case of Lossy Fifo Channel Systems

Subword relation over a finite alphabet is a WQO (Higman’s lemma) Upward-closed sets = finite unions of Σ∗a1Σ∗a2 · · · amΣ∗ Computation of the Pre:

◮ Send: Left concatenation + Upward closure ◮ Receive: Right derivation

Lossyness ⇒ Monotonicity ⇒ Coverability is decidable. Is configuration reachability decidable ?

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 16 / 28

slide-35
SLIDE 35

The case of Lossy Fifo Channel Systems

Subword relation over a finite alphabet is a WQO (Higman’s lemma) Upward-closed sets = finite unions of Σ∗a1Σ∗a2 · · · amΣ∗ Computation of the Pre:

◮ Send: Left concatenation + Upward closure ◮ Receive: Right derivation

Lossyness ⇒ Monotonicity ⇒ Coverability is decidable. Is configuration reachability decidable ? Yes, lossyness ⇒ ( reachability ≃ coverability)

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 16 / 28

slide-36
SLIDE 36

Concurrent Programs with Procedures

Procedural program → Pushdown System (finite control + stack) Concurrent program → Concurrent PDS’s (Multistack systems) Two stacks can simulate a Turing tape. Concurrent programs with 2 threads are Turing powerful. ⇒ Restrictions

◮ Classes of programs with particular features ◮ Particular kind of behaviors

(under-approximate analysis for bug detection)

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 17 / 28

slide-37
SLIDE 37

Asynchronous Programs

Synchronous calls Usual procedure calls Asynchronous calls

◮ Calls are stored and dispatched later by the scheduler ◮ They can be executed in any order

Event-driven programming (requests, responses) Useful model: distributed systems, web servers, embedded systems

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 18 / 28

slide-38
SLIDE 38

Formal Models: Multiset Pushdown Systems

A task is a sequential (pushdown) process with dynamic task creation Created tasks are stored in an unordered buffer (multiset) Tasks run until completion If the stack is empty, a task in moved from the multiset to the stack

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 19 / 28

slide-39
SLIDE 39

Difficulties

Unbounded buffer of tasks The buffer is a multiset ⇒ can be encoded as counters Need to combine somehow PDS with VASS Stack ⇒ not Well Structured How to get rid of the stack ?

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 20 / 28

slide-40
SLIDE 40

State Reachability of Multiset PDS

Theorem

The control state reachability problem for MPDS is EXPSPACE-complete. Reduction to/from the coverability problem for Petri. First decidability proof by K. Sen and M. Viswanathan, 2006

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 21 / 28

slide-41
SLIDE 41

Semi-linear Sets

Linear set over Nn is a set of the form { u + k1 v1 + · · · + km vm : k1, . . . , km ∈ N} where u, v1, . . . , vm ∈ Nn Semi-linear set = finite union of linear sets. Examples:

◮ {(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

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 22 / 28

slide-42
SLIDE 42

Semi-linear Sets

Linear set over Nn is a set of the form { u + k1 v1 + · · · + km vm : k1, . . . , km ∈ N} where u, v1, . . . , vm ∈ Nn Semi-linear set = finite union of linear sets. Examples:

◮ {(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

Theorem [Ginsburg, Spanier, 1966] A set is semi-linear iff it is definable in Presburger arithmetics.

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 22 / 28

slide-43
SLIDE 43

Parikh’s image

Let Σ = {a1, . . . , an}. Given a word w ∈ Σ∗, the Parikh image of w is: φ(w) = (#a1(w), . . . , #an(w)) ∈ Nn Given a language L ⊆ Σ∗, φ(L) = {φ(w) : w ∈ L} Examples:

◮ 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}

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 23 / 28

slide-44
SLIDE 44

Semi-linear sets, CFL’s, and RL’s

Parikh’s Theorem (1966) For every Context-Free Language L, φ(L) is a semi-linear set.

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 24 / 28

slide-45
SLIDE 45

Semi-linear sets, CFL’s, and RL’s

Parikh’s Theorem (1966) For every Context-Free Language L, φ(L) is a semi-linear set. Proposition For every semi-linear set S, there exists a Regular Language L such that φ(L) = S. Corollary For every Context-Free Language L, there exists a Regular language L′ such that φ(L) = φ(L′).

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 24 / 28

slide-46
SLIDE 46

From Multiset PDS to VASS

q0 γ0 q1 γ1 q2 PDS computation with tasks creation

Pending tasks Multiset

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 25 / 28

slide-47
SLIDE 47

From Multiset PDS to VASS

q0 γ0 q1 γ1 q2 PDS computation with tasks creation

Pending tasks Multiset

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 25 / 28

slide-48
SLIDE 48

From Multiset PDS to VASS

q0 γ0 q1 γ1 q2 PDS computation with tasks creation

Pending tasks Multiset

M1

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 25 / 28

slide-49
SLIDE 49

From Multiset PDS to VASS

q0 γ0 q1 γ1 q2 PDS computation with tasks creation

Pending tasks Multiset

M1

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 25 / 28

slide-50
SLIDE 50

From Multiset PDS to VASS

q0 γ0 q1 γ1 q2 PDS computation with tasks creation

Pending tasks Multiset

M1 M2

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 25 / 28

slide-51
SLIDE 51

From Multiset PDS to VASS

q0 γ0 q1 γ1 q2

M1 M2

q0, γ0

L1

= ⇒∗ q1, ǫ L1= Set of sequences of created tasks L1 is a Context-Free Language M1 is the Parikh image of L1

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 25 / 28

slide-52
SLIDE 52

From Multiset PDS to VASS

q0 γ0 q1 γ1 q2

M1 M2

Parikh’s Theorem: Mi is definable by a finite state automaton Si

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 25 / 28

slide-53
SLIDE 53

From Multiset PDS to VASS

q0 γ0 q1 γ1 q2

M1 M2

Parikh’s Theorem: Mi is definable by a finite state automaton Si Construction of a VASS: Simulation of Si + task consumption rules

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 25 / 28

slide-54
SLIDE 54

Message-Passing Programs with Procedures

Undecidable even for bounded channels Restrictions on

◮ Interaction between recursion and communication

(e.g., communication with empty stack)

◮ Kind of channels (e.g., lossy, unordered) ◮ Topology of the network

Decidable classes

[La Torre et al. TACAS’08], [Atig et al., CONCUR’08], ...

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 26 / 28

slide-55
SLIDE 55

A simple case: Acyclic Lossy Channel Pushdown Networks

Consider the system P1

c1

− − → P2

c2

− − → P3 · · · Pn−1

cn−1

− − − → Pn Problem: Is it possible to reach the global state (q1, q2, . . . , qn) ?

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 27 / 28

slide-56
SLIDE 56

A simple case: Acyclic Lossy Channel Pushdown Networks

Consider the system P1

c1

− − → P2

c2

− − → P3 · · · Pn−1

cn−1

− − − → Pn Problem: Is it possible to reach the global state (q1, q2, . . . , qn) ? Consider the set L(c1) of all possible contents of c1 resulting from P1 computations reaching q1

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 27 / 28

slide-57
SLIDE 57

A simple case: Acyclic Lossy Channel Pushdown Networks

Consider the system P1

c1

− − → P2

c2

− − → P3 · · · Pn−1

cn−1

− − − → Pn Problem: Is it possible to reach the global state (q1, q2, . . . , qn) ? Consider the set L(c1) of all possible contents of c1 resulting from P1 computations reaching q1 This set is downward closed w.r.t. the subword relation. Downward closed sets are regular: unions of Σ∗

1(a1 + ǫ) · · · (am + ǫ)Σ∗ m+1

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 27 / 28

slide-58
SLIDE 58

A simple case: Acyclic Lossy Channel Pushdown Networks

Consider the system P1

c1

− − → P2

c2

− − → P3 · · · Pn−1

cn−1

− − − → Pn Problem: Is it possible to reach the global state (q1, q2, . . . , qn) ? Consider the set L(c1) of all possible contents of c1 resulting from P1 computations reaching q1 This set is downward closed w.r.t. the subword relation. Downward closed sets are regular: unions of Σ∗

1(a1 + ǫ) · · · (am + ǫ)Σ∗ m+1

The downward closure of a CFL is effectively constructible [Courcelle, 91]

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 27 / 28

slide-59
SLIDE 59

A simple case: Acyclic Lossy Channel Pushdown Networks

Consider the system P1

c1

− − → P2

c2

− − → P3 · · · Pn−1

cn−1

− − − → Pn Problem: Is it possible to reach the global state (q1, q2, . . . , qn) ? Consider the set L(c1) of all possible contents of c1 resulting from P1 computations reaching q1 This set is downward closed w.r.t. the subword relation. Downward closed sets are regular: unions of Σ∗

1(a1 + ǫ) · · · (am + ǫ)Σ∗ m+1

The downward closure of a CFL is effectively constructible [Courcelle, 91] Compose L(c1) with P2 to get a new PDS P2 Solve the same problem for P2

c2

− − → P3

c3

− − → · · · Pn−1

cn−1

− − − → Pn

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 27 / 28

slide-60
SLIDE 60

A simple case: Acyclic Lossy Channel Pushdown Networks

Consider the system P1

c1

− − → P2

c2

− − → P3 · · · Pn−1

cn−1

− − − → Pn Problem: Is it possible to reach the global state (q1, q2, . . . , qn) ? Consider the set L(c1) of all possible contents of c1 resulting from P1 computations reaching q1 This set is downward closed w.r.t. the subword relation. Downward closed sets are regular: unions of Σ∗

1(a1 + ǫ) · · · (am + ǫ)Σ∗ m+1

The downward closure of a CFL is effectively constructible [Courcelle, 91] Compose L(c1) with P2 to get a new PDS P2 Solve the same problem for P2

c2

− − → P3

c3

− − → · · · Pn−1

cn−1

− − − → Pn At the end, we need to solve reachability in one pushdown system Pn

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 27 / 28

slide-61
SLIDE 61

End of Lecture 1:

Dynamic networks of processes can be represented using VASS Procedures make things more difficult Constraints on interaction between concurrency and recursion are necessary to get decidable classes Asynchronous is an important class of programs for which verification problems are decidable Reasoning about interfaces/summaries is an important tool for the design of decision procedures Still, complexity is high. Need of efficient techniques.

  • A. Bouajjani (LIAFA, UP7)

Lecture 1: Concurrent Programs I September 2012 28 / 28