4/25/20151 metodi formali nello sviluppo software a.a.2013/2014 prof.anna labella

33
03/21/22 1 Metodi formali nello sviluppo software a.a.2013/2014 Prof.Anna Labella

Upload: ismael-kenerson

Post on 14-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

04/18/23 1

Metodi formali nello sviluppo software

a.a.2013/2014

Prof.Anna Labella

04/18/23 2

Process EquivalencesSameness of behaviour = equivalence of states

Many process equivalences have been proposed

For instance: q1 ~ q2 iff– q1 and q2 have the same paths, or– q1 and q2 may always refuse the same interactions, or– q1 and q2 pass the same tests, or– q1 and q2 satisfy the same temporal formulas, or– q1 and q2 have identical branching structure

CCS: Focus on bisimulation equivalence

04/18/23 3

Bisimulation EquivalenceIntuition: q1 ~ q2 iff q1 and q2 have same

branching structure

Idea: Find relation which will relate two states with the same transition structure, and make sure the relation is preserved

Example:

a a a

bb

bcc

c

q1 q2

04/18/23 4

Strong Bisimulation Equivalence

Given: Labelled transition system T = (Q,,R)

Looking for a relation S Q Q on states

S is a strong bisimulation relation if whenever q1 S q2 then:– q1 q1’ implies q2 q2’ for some q2’ such that q1’ S q2’– q2 q2’ implies q1 q1’ for some q1’ such that q1’ S q2’

q1 and q2 are strongly bisimilar iff q1 S q2 for some strong bisimulation relation S

q1 q2: q1 and q2 are strongly bisimilar

Peled uses ´bis for »

04/18/23 5

Example

q1

q0

q2

p0

p1

p2a

aa

a

a

a

a

b

b

b

Does q0 ~ p0 hold?

04/18/23 6

Example

q1

q0

q2

p0

p1

p2

c

a a a

cbb

Does q0 ~ p0 hold?

q3 q4 p3

04/18/23 7

Weak TransitionsWhat to do about internal activity?

: Transition label for activity which is not externally visible q q’ iff q = q0 q1 ... qn = q’, n 0 q q’ iff q q’ q q’ iff q q1 q2 q’ ( )

Beware that = (non-standard notation)

Observational equivalence, v.1.0: Bisimulation equivalence with in place of

Let q1 q2 iff q1 ~ q2 with in place of

04/18/23 8

Observational EquivalenceLet S Q Q. The relation S is a weak bisimulation

relation if whenever q1 S q2 then:– q1 q1’ implies q2 q2’ for some q2’ such that q1’ S

q2’– q2 q2’ implies q1 q1’ for some q1’ such that q1’ S

q2’

q1 and q2 are observationally equivalent, or weakly bisimulation equivalent, if q1 S q2 for some weak bisimulation relation S

q1 q2: q1 and q2 are observationally equivalent/weakly bisimilar

04/18/23 9

Examplesa a

aa

a

a

a

ab

b

c

c

c

04/18/23 10

Examplesb

a

b

a

a

b

All three are inequivalent

04/18/23 11

Bisimulazioni

Strong Weak Branching

04/18/23 12

Bisimulazioni

Strong

Se un processo/stato può fare una mossa, allora può farla anche l’altro e viceversa.

a

cb c bb

a a

b c

04/18/23 13

Bisimulazioni weak

Un processo può passare attraverso più stati (non equivalenti e non allineati) con mosseinvisibili, tentando di simulare l’altro.

a

b

c b

a

b

c

a

04/18/23 14

Bisimulazioni branching

Un processo può passare attraverso più stati (equivalenti) con mosse invisibili, mentre l’altro è fermo, ma mantiene le stesse potenzialità.

a

b

b

a

b c

b a

c

04/18/23 15

Proving EquivalencesThe bisimulation proof method:

To establish P Q:

1. Identify a relation S such that P S Q

2. Prove that S is a weak bisimulation relation

This is the canonical method

There are other methods for process verification:

1. Equational reasoning

2. Temporal logic specification/proof/model checking

04/18/23 16

Bisimilarità: massimo punto fisso

04/18/23 17

04/18/23 18

04/18/23 19

04/18/23 20

04/18/23 21

04/18/23 22

04/18/23 23

04/18/23 24

04/18/23 25

04/18/23 26

04/18/23 27

04/18/23 28

04/18/23 29

04/18/23 30

04/18/23 31

04/18/23 32

04/18/23 33