Probabilistic Contracts for Component-based Design Gregor G ossler - - PowerPoint PPT Presentation

probabilistic contracts for component based design
SMART_READER_LITE
LIVE PREVIEW

Probabilistic Contracts for Component-based Design Gregor G ossler - - PowerPoint PPT Presentation

Probabilistic Contracts for Component-based Design Gregor G ossler Alain Girault Dana N. Xu INRIA, France ATVA 2010 D.N. Xu, G. G ossler, A. Girault (INRIA, France) Probabilistic contracts ATVA 2010 1 / 18 Probabilistic Contracts


slide-1
SLIDE 1

Probabilistic Contracts for Component-based Design

Dana N. Xu Gregor G¨

  • ssler

Alain Girault

INRIA, France

ATVA 2010

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 1 / 18

slide-2
SLIDE 2

Probabilistic Contracts

System designers have to cope with multiple sources of uncertainty: Embedded and distributed systems usually encompass unreliable components. Behaviors of (black-box) components and the environment may be uncertain. Abstraction from complex deterministic behavior (“network access is available with p=95%”). We want to describe properties such as:

“The probability that this component fails at this point of its behavior is ≤ 0.1%.” We introduce probabilistic contracts, which distinguish assumptions on how a component is used from guarantees on the component behavior.

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 2 / 18

slide-3
SLIDE 3

Interactive Markov Chain (IMC)

Example: client – link – server.

Client (C) Link (L) req rec res del Server (S) del’ req’ rec’ res’

An IMC is an LTS with action states/transitions and probabilistic states/transitions [Hermanns 2002]. IMC used to model component behaviors:

l2 l3 l0 l1 l6 l7 l4 l5 l9 l8 del′ 0.05 rec′ 0.95 del′ fail1 0.98 rec rec′ fail2 del 0.02

The IMC Mℓ of the Link.

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 3 / 18

slide-4
SLIDE 4

Probabilistic Contracts

Client (C) Link (L) req rec res del Server (S) del’ req’ rec’ res’

A probabilistic contract is an IMC with probability intervals and a special ⊤ state: ⊤ t2 t3 t0 t1 req′ req′ [0.9, 1] [0, 0.1] res′ Contract Cs for Server action transitions leading to ⊤ are assumed not to be synchronized. action transitions not leading to ⊤ are guaranteed to be offered. actions not labelling any transition at a state are guaranteed not to be offered.

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 4 / 18

slide-5
SLIDE 5

Operations for Contract-based Design Flow

Essential operations: refinement and satisfaction; parallel composition (C1||IC2): E.g. I = {a|d, b|e, c|f, g, u, v} conjunction of contracts (C1 ∧ C2): Additional definitions: bisimulation, reduction, projection

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 5 / 18

slide-6
SLIDE 6

Contract Refinement

s1 s3 s2 s0 a b [0.2, 0.4] a [0.6, 0.8] ⊤ t2 t3 t0 t1 a [0.5, 0.9] [0.1, 0.5] b a b

C1 C3

u3 u2 u1 u0 u4 a c [0.6, 0.8] [0.2, 0.4] b b a

C1 ≤ C3 C2 C2 ≤ C3

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 6 / 18

slide-7
SLIDE 7

Contract refinement for probabilistic states

s1 s3 s2 s4 t2 t3 t1 t4 [0.2, 0.5] d1 [0.1, 0.6] d4 d3 [0.2, 0.4] [0.5, 0.7] d2 [0, 0.2] [0.1, 0.3] [Jonsson and Larsen : LICS’91]

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 7 / 18

slide-8
SLIDE 8

Contract Satisfaction

s1 s0 s3 s2 s4 er2 res′ 0.7 res′ 0.2 handle res′ 0.1 req′ req′ s1 s0 s3 s2 s4 er2 res′ [0.7, 0.7] res′ [0.2, 0.2] handle res′ [0.1, 0.1] req′ req′

IMC Ms Lifted IMC ⌊Ms⌋

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 8 / 18

slide-9
SLIDE 9

Contract Satisfaction

s1 s0 s3 s2 s4 er2 res′ 0.7 res′ 0.2 handle res′ 0.1 req′ req′ s1 s0 s3 s2 s4 er2 res′ [0.7, 0.7] res′ [0.2, 0.2] handle res′ [0.1, 0.1] req′ req′

IMC Ms Lifted IMC ⌊Ms⌋

Definition (Contract satisfaction)

An IMC M satisfies a contract C (written M | = C) iff ⌊M⌋ ≤ C.

⊤ t2 t3 t0 t1 req′ req′ [0.9, 1] [0, 0.1] res′

That is to check: s0 ≤ t0 Contract Cs for Server

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 8 / 18

slide-10
SLIDE 10

Contract Satisfaction

Definition (Models of contracts)

The set of models of a contract C (written M(C)) is the set of IMCs that satisfy C: M(C) = {M | M | = C}.

Definition (Semantical equivalence)

Contracts C1 and C2 are semantically equivalent (written C1 ≡ C2) iff M(C1) = M(C2).

Lemma (Refinement and model inclusion)

For all contracts C1 and C2, if C1 ≤ C2, then M(C1) ⊆ M(C2).

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 9 / 18

slide-11
SLIDE 11

Parallel Composition of contracts over two components

A probabilistic transition has higher priority than an action transition. Interaction set I: only transitions labeled with interactions in I can occur. Synchronize two probabilistic transitions. If one contract reaches ⊤, the composed contract reaches ⊤.

s1 s0 s3 s2 s6 s5 [0.9, 1] b b [0.5, 0.8] a [0, 0.1] [0.2, 0.5] a ⊤ t2 t3 t0 t1 c c [0.7, 0.9] [0.1, 0.3] d c

C1 C2 C1||IC2 where I={a|c, b, d}

slide-12
SLIDE 12

Parallel Composition of contracts over two components

A probabilistic transition has higher priority than an action transition. Interaction set I: only transitions labeled with interactions in I can occur. Synchronize two probabilistic transitions. If one contract reaches ⊤, the composed contract reaches ⊤.

s1 s0 s3 s2 s6 s5 [0.9, 1] b b [0.5, 0.8] a [0, 0.1] [0.2, 0.5] a ⊤ t2 t3 t0 t1 c c [0.7, 0.9] [0.1, 0.3] d c

C1 C2

(s0, t0)

C1||IC2 where I={a|c, b, d}

slide-13
SLIDE 13

Parallel Composition of contracts over two components

A probabilistic transition has higher priority than an action transition. Interaction set I: only transitions labeled with interactions in I can occur. Synchronize two probabilistic transitions. If one contract reaches ⊤, the composed contract reaches ⊤.

s1 s0 s3 s2 s6 s5 [0.9, 1] b b [0.5, 0.8] a [0, 0.1] [0.2, 0.5] a ⊤ t2 t3 t0 t1 c c [0.7, 0.9] [0.1, 0.3] d c

C1 C2

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1]

C1||IC2 where I={a|c, b, d}

slide-14
SLIDE 14

Parallel Composition of contracts over two components

A probabilistic transition has higher priority than an action transition. Interaction set I: only transitions labeled with interactions in I can occur. Synchronize two probabilistic transitions. If one contract reaches ⊤, the composed contract reaches ⊤.

s1 s0 s3 s2 s6 s5 [0.9, 1] b b [0.5, 0.8] a [0, 0.1] [0.2, 0.5] a ⊤ t2 t3 t0 t1 c c [0.7, 0.9] [0.1, 0.3] d c

C1 C2

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a|c

C1||IC2 where I={a|c, b, d}

slide-15
SLIDE 15

Parallel Composition of contracts over two components

A probabilistic transition has higher priority than an action transition. Interaction set I: only transitions labeled with interactions in I can occur. Synchronize two probabilistic transitions. If one contract reaches ⊤, the composed contract reaches ⊤.

s1 s0 s3 s2 s6 s5 [0.9, 1] b b [0.5, 0.8] a [0, 0.1] [0.2, 0.5] a ⊤ t2 t3 t0 t1 c c [0.7, 0.9] [0.1, 0.3] d c

C1 C2

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a|c b

C1||IC2 where I={a|c, b, d}

slide-16
SLIDE 16

Parallel Composition of contracts over two components

A probabilistic transition has higher priority than an action transition. Interaction set I: only transitions labeled with interactions in I can occur. Synchronize two probabilistic transitions. If one contract reaches ⊤, the composed contract reaches ⊤.

s1 s0 s3 s2 s6 s5 [0.9, 1] b b [0.5, 0.8] a [0, 0.1] [0.2, 0.5] a ⊤ t2 t3 t0 t1 c c [0.7, 0.9] [0.1, 0.3] d c

C1 C2

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a|c b (s5, t2) (s5, t3) (s6, t3) (s6, t2) [0.5 ∗ 0.1, 0.8 ∗ 0.3] [0.5 ∗ 0.7, 0.8 ∗ 0.9] [0.2 ∗ 0.7, 0.5 ∗ 0.9] [0.2 ∗ 0.1, 0.5 ∗ 0.3]

C1||IC2 where I={a|c, b, d}

slide-17
SLIDE 17

Parallel Composition of contracts over two components

A probabilistic transition has higher priority than an action transition. Interaction set I: only transitions labeled with interactions in I can occur. Synchronize two probabilistic transitions. If one contract reaches ⊤, the composed contract reaches ⊤.

s1 s0 s3 s2 s6 s5 [0.9, 1] b b [0.5, 0.8] a [0, 0.1] [0.2, 0.5] a ⊤ t2 t3 t0 t1 c c [0.7, 0.9] [0.1, 0.3] d c

C1 C2

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a|c b (s5, t2) (s5, t3) (s6, t3) (s6, t2) [0.5 ∗ 0.1, 0.8 ∗ 0.3] [0.5 ∗ 0.7, 0.8 ∗ 0.9] [0.2 ∗ 0.7, 0.5 ∗ 0.9] [0.2 ∗ 0.1, 0.5 ∗ 0.3] b

C1||IC2 where I={a|c, b, d}

slide-18
SLIDE 18

Parallel Composition of contracts over two components

A probabilistic transition has higher priority than an action transition. Interaction set I: only transitions labeled with interactions in I can occur. Synchronize two probabilistic transitions. If one contract reaches ⊤, the composed contract reaches ⊤.

s1 s0 s3 s2 s6 s5 [0.9, 1] b b [0.5, 0.8] a [0, 0.1] [0.2, 0.5] a ⊤ t2 t3 t0 t1 c c [0.7, 0.9] [0.1, 0.3] d c

C1 C2

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a|c b (s5, t2) (s5, t3) (s6, t3) (s6, t2) [0.5 ∗ 0.1, 0.8 ∗ 0.3] [0.5 ∗ 0.7, 0.8 ∗ 0.9] [0.2 ∗ 0.7, 0.5 ∗ 0.9] [0.2 ∗ 0.1, 0.5 ∗ 0.3] b a|c

C1||IC2 where I={a|c, b, d}

slide-19
SLIDE 19

Parallel Composition of contracts over two components

A probabilistic transition has higher priority than an action transition. Interaction set I: only transitions labeled with interactions in I can occur. Synchronize two probabilistic transitions. If one contract reaches ⊤, the composed contract reaches ⊤.

s1 s0 s3 s2 s6 s5 [0.9, 1] b b [0.5, 0.8] a [0, 0.1] [0.2, 0.5] a ⊤ t2 t3 t0 t1 c c [0.7, 0.9] [0.1, 0.3] d c

C1 C2

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a|c b (s5, t2) (s5, t3) (s6, t3) (s6, t2) [0.5 ∗ 0.1, 0.8 ∗ 0.3] [0.5 ∗ 0.7, 0.8 ∗ 0.9] [0.2 ∗ 0.7, 0.5 ∗ 0.9] [0.2 ∗ 0.1, 0.5 ∗ 0.3] b a|c d

C1||IC2 where I={a|c, b, d}

slide-20
SLIDE 20

Parallel Composition of contracts over two components

A probabilistic transition has higher priority than an action transition. Interaction set I: only transitions labeled with interactions in I can occur. Synchronize two probabilistic transitions. If one contract reaches ⊤, the composed contract reaches ⊤.

s1 s0 s3 s2 s6 s5 [0.9, 1] b b [0.5, 0.8] a [0, 0.1] [0.2, 0.5] a ⊤ t2 t3 t0 t1 c c [0.7, 0.9] [0.1, 0.3] d c

C1 C2

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a|c b (s5, t2) (s5, t3) (s6, t3) (s6, t2) [0.5 ∗ 0.1, 0.8 ∗ 0.3] [0.5 ∗ 0.7, 0.8 ∗ 0.9] [0.2 ∗ 0.7, 0.5 ∗ 0.9] [0.2 ∗ 0.1, 0.5 ∗ 0.3] b a|c d b

C1||IC2 where I={a|c, b, d}

slide-21
SLIDE 21

Parallel Composition of contracts over two components

A probabilistic transition has higher priority than an action transition. Interaction set I: only transitions labeled with interactions in I can occur. Synchronize two probabilistic transitions. If one contract reaches ⊤, the composed contract reaches ⊤.

s1 s0 s3 s2 s6 s5 [0.9, 1] b b [0.5, 0.8] a [0, 0.1] [0.2, 0.5] a ⊤ t2 t3 t0 t1 c c [0.7, 0.9] [0.1, 0.3] d c

C1 C2

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a|c b (s5, t2) (s5, t3) (s6, t3) (s6, t2) [0.5 ∗ 0.1, 0.8 ∗ 0.3] [0.5 ∗ 0.7, 0.8 ∗ 0.9] [0.2 ∗ 0.7, 0.5 ∗ 0.9] [0.2 ∗ 0.1, 0.5 ∗ 0.3] b a|c d b d

C1||IC2 where I={a|c, b, d}

slide-22
SLIDE 22

Parallel Composition of contracts over two components

A probabilistic transition has higher priority than an action transition. Interaction set I: only transitions labeled with interactions in I can occur. Synchronize two probabilistic transitions. If one contract reaches ⊤, the composed contract reaches ⊤.

s1 s0 s3 s2 s6 s5 [0.9, 1] b b [0.5, 0.8] a [0, 0.1] [0.2, 0.5] a ⊤ t2 t3 t0 t1 c c [0.7, 0.9] [0.1, 0.3] d c

C1 C2

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a|c b (s5, t2) (s5, t3) (s6, t3) (s6, t2) [0.5 ∗ 0.1, 0.8 ∗ 0.3] [0.5 ∗ 0.7, 0.8 ∗ 0.9] [0.2 ∗ 0.7, 0.5 ∗ 0.9] [0.2 ∗ 0.1, 0.5 ∗ 0.3] b a|c d b d ⊤ a|c

C1||IC2 where I={a|c, b, d}

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 10 / 18

slide-23
SLIDE 23

Properties for Parallel Composition

Theorem (Congruence of refinement for ||I)

For all contracts C1, C2, C3, C4 and interaction set I, if C1 ≤ C2 and C3 ≤ C4, then C1||I C3 ≤ C2||I C4.

Theorem (Independent implementability)

For all IMCs M, N, contracts C1, C2, and interaction set I, if M | = C1 and N | = C2, then M||IN | = C1||IC2.

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 11 / 18

slide-24
SLIDE 24

Conjunction: composition of requirements over a same component

A probability transition has a higher priority than an action transition. Contracts must agree on common action transitions. Intersect probability intervals for two states that are similar. If one contract reaches ⊤, the conjunction behaves like the other contract.

s1 s0 s3 s2 s6 s5 [0.9, 1] c [0.7, 0.9] a b [0, 0.1] [0.1, 0.3] a ⊤ t2 t3 t0 t1 b a [0.8, 0.9] [0.1, 0.2] d a

C1 with A1 = {a, b, c} C2 with A2 = {a, b, d} C1 ∧ C2

slide-25
SLIDE 25

Conjunction: composition of requirements over a same component

A probability transition has a higher priority than an action transition. Contracts must agree on common action transitions. Intersect probability intervals for two states that are similar. If one contract reaches ⊤, the conjunction behaves like the other contract.

s1 s0 s3 s2 s6 s5 [0.9, 1] c [0.7, 0.9] a b [0, 0.1] [0.1, 0.3] a ⊤ t2 t3 t0 t1 b a [0.8, 0.9] [0.1, 0.2] d a

C1 with A1 = {a, b, c} C2 with A2 = {a, b, d}

(s0, t0)

C1 ∧ C2

slide-26
SLIDE 26

Conjunction: composition of requirements over a same component

A probability transition has a higher priority than an action transition. Contracts must agree on common action transitions. Intersect probability intervals for two states that are similar. If one contract reaches ⊤, the conjunction behaves like the other contract.

s1 s0 s3 s2 s6 s5 [0.9, 1] c [0.7, 0.9] a b [0, 0.1] [0.1, 0.3] a ⊤ t2 t3 t0 t1 b a [0.8, 0.9] [0.1, 0.2] d a

C1 with A1 = {a, b, c} C2 with A2 = {a, b, d}

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1]

C1 ∧ C2

slide-27
SLIDE 27

Conjunction: composition of requirements over a same component

A probability transition has a higher priority than an action transition. Contracts must agree on common action transitions. Intersect probability intervals for two states that are similar. If one contract reaches ⊤, the conjunction behaves like the other contract.

s1 s0 s3 s2 s6 s5 [0.9, 1] c [0.7, 0.9] a b [0, 0.1] [0.1, 0.3] a ⊤ t2 t3 t0 t1 b a [0.8, 0.9] [0.1, 0.2] d a

C1 with A1 = {a, b, c} C2 with A2 = {a, b, d}

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a

C1 ∧ C2

slide-28
SLIDE 28

Conjunction: composition of requirements over a same component

A probability transition has a higher priority than an action transition. Contracts must agree on common action transitions. Intersect probability intervals for two states that are similar. If one contract reaches ⊤, the conjunction behaves like the other contract.

s1 s0 s3 s2 s6 s5 [0.9, 1] c [0.7, 0.9] a b [0, 0.1] [0.1, 0.3] a ⊤ t2 t3 t0 t1 b a [0.8, 0.9] [0.1, 0.2] d a

C1 with A1 = {a, b, c} C2 with A2 = {a, b, d}

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a c

C1 ∧ C2

slide-29
SLIDE 29

Conjunction: composition of requirements over a same component

A probability transition has a higher priority than an action transition. Contracts must agree on common action transitions. Intersect probability intervals for two states that are similar. If one contract reaches ⊤, the conjunction behaves like the other contract.

s1 s0 s3 s2 s6 s5 [0.9, 1] c [0.7, 0.9] a b [0, 0.1] [0.1, 0.3] a ⊤ t2 t3 t0 t1 b a [0.8, 0.9] [0.1, 0.2] d a

C1 with A1 = {a, b, c} C2 with A2 = {a, b, d}

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a c (s5, t3) (s6, t2) [0.1, 0.2] [0.8, 0.9]

C1 ∧ C2

slide-30
SLIDE 30

Conjunction: composition of requirements over a same component

A probability transition has a higher priority than an action transition. Contracts must agree on common action transitions. Intersect probability intervals for two states that are similar. If one contract reaches ⊤, the conjunction behaves like the other contract.

s1 s0 s3 s2 s6 s5 [0.9, 1] c [0.7, 0.9] a b [0, 0.1] [0.1, 0.3] a ⊤ t2 t3 t0 t1 b a [0.8, 0.9] [0.1, 0.2] d a

C1 with A1 = {a, b, c} C2 with A2 = {a, b, d}

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a c (s5, t3) (s6, t2) [0.1, 0.2] [0.8, 0.9] d

C1 ∧ C2

slide-31
SLIDE 31

Conjunction: composition of requirements over a same component

A probability transition has a higher priority than an action transition. Contracts must agree on common action transitions. Intersect probability intervals for two states that are similar. If one contract reaches ⊤, the conjunction behaves like the other contract.

s1 s0 s3 s2 s6 s5 [0.9, 1] c [0.7, 0.9] a b [0, 0.1] [0.1, 0.3] a ⊤ t2 t3 t0 t1 b a [0.8, 0.9] [0.1, 0.2] d a

C1 with A1 = {a, b, c} C2 with A2 = {a, b, d}

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a c (s5, t3) (s6, t2) [0.1, 0.2] [0.8, 0.9] d a

C1 ∧ C2

slide-32
SLIDE 32

Conjunction: composition of requirements over a same component

A probability transition has a higher priority than an action transition. Contracts must agree on common action transitions. Intersect probability intervals for two states that are similar. If one contract reaches ⊤, the conjunction behaves like the other contract.

s1 s0 s3 s2 s6 s5 [0.9, 1] c [0.7, 0.9] a b [0, 0.1] [0.1, 0.3] a ⊤ t2 t3 t0 t1 b a [0.8, 0.9] [0.1, 0.2] d a

C1 with A1 = {a, b, c} C2 with A2 = {a, b, d}

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a c (s5, t3) (s6, t2) [0.1, 0.2] [0.8, 0.9] d a (s1, ⊤) b

C1 ∧ C2

slide-33
SLIDE 33

Conjunction: composition of requirements over a same component

A probability transition has a higher priority than an action transition. Contracts must agree on common action transitions. Intersect probability intervals for two states that are similar. If one contract reaches ⊤, the conjunction behaves like the other contract.

s1 s0 s3 s2 s6 s5 [0.9, 1] c [0.7, 0.9] a b [0, 0.1] [0.1, 0.3] a ⊤ t2 t3 t0 t1 b a [0.8, 0.9] [0.1, 0.2] d a

C1 with A1 = {a, b, c} C2 with A2 = {a, b, d}

(s0, t0) (s2, t0) (s1, t0) [0, 0.1] [0.9, 1] (s3, t1) a c (s5, t3) (s6, t2) [0.1, 0.2] [0.8, 0.9] d a (s1, ⊤) b (s3, ⊤) (s5, ⊤) (s6, ⊤) [0.1, 0.3] [0.7, 0.9] a a b

C1 ∧ C2

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 12 / 18

slide-34
SLIDE 34

Unambiguous Contracts

For conjunction, we require the contracts to be unambiguous. s1 s3 s2 s5 s4 s7 s6 [0, 0.4] [0, 0.3] b [0.8, 1] [0.7, 1] b [0.4, 1] [0, 0.6] a a Ambiguous Contract s1 s4 s6 [0.7, 1] a [0, 0.4] b Unambiguous Contract

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 13 / 18

slide-35
SLIDE 35

Properties of Conjunction

Theorem (Soundness of conjunction)

For all unambiguous contracts C1 and C2 with alphabets A such that: C1 ∧ C2 ≤ Ci for i = 1, 2

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 14 / 18

slide-36
SLIDE 36

Case Study

[0, 0.001] s2 fail ⊤ CS success s0 comp [0.999, 1] s1 s3

p1

CP

  • k

p0 [p, 1] [0, 1 − p] p2 p3 nok exe

Requirment Cs on the server Contract CP of a processor

q2 q4

q6 q0 q1 q3 q5

  • k′

exe′ nok′ exe′ nok′

  • k′

success comp fail

Contract CT of a re-execution scheduler I = {success, comp, fail, exe|exe′, ok|ok′, nok|nok′}

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 15 / 18

slide-37
SLIDE 37

Case Study

[0, 0.001] s2 fail ⊤ CS success s0 comp [0.999, 1] s1 s3 q0 comp q1 q2 [p, 1] [0, 1 − p] q3 q5 q4 q6 q7 [0, 1 − p] [p, 1] CT||P = CT||ICP

q8 q9

exe nok exe nok success fail

  • k

Shortcuts: exe = exe|exe′

  • k = ok|ok′

nok = nok|nok′

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 16 / 18

slide-38
SLIDE 38

Case study: Refinement to Guarantee Reliability

Collapse probabilistic transitions:

q′ comp [p, 1] [0, 1 − p] q′

1

q′

2

[p, 1] q′

3

[0, 1 − p] q′

4

Cπ = πB(CT||P) success fail

q′′

1

q′′ comp [2p − p2, 1] q′′

2

q′′

3

˜ Cπ [0, (1 − p)2] success fail

B = {success, comp, fail} Refinement ˜ Cπ ≤ CS of reliability contract CS gives constraint on p: (1 − p)2 ≤ 0.001, that is, p ≥ 0.969.

[0, 0.001] s2 fail ⊤ CS success s0 comp [0.999, 1] s1 s3

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 17 / 18

slide-39
SLIDE 39

Conclusion

Developed a probabilistic contract framework for component-based design. Provide operations for bottom-up and top-down design: refinement, parallel composition, and conjunction. Proved the desired properties of these operations. Small case study to show its usefulness. Future work directions: Implement the framework in a tool, e.g. CADP model-checker Work on larger case studies. Study blaming (statically and at run-time).

D.N. Xu, G. G¨

  • ssler, A. Girault (INRIA, France)

Probabilistic contracts ATVA 2010 18 / 18