Contents

Axiom Event dec : ∀ e e' : Event, {e = e'}+{e = e'}. Definition Object := Var + Event. Values. Parameter Val : Set. Axiom Val dec : ∀ x y : Val, {x = y}+{x = y}.
91KB taille 4 téléchargements 513 vues
CONTENTS

September 8, 2009  1

Contents 0.1 0.2 0.3 0.4

0.5 0.6

Subsets . . . . . . . . . . . . . . . . . . Denitions . . . . . . . . . . . . . . . . Encapsulation and Assembly . . . . . . Semantics . . . . . . . . . . . . . . . . 0.4.1 Read and Written Variables and 0.4.2 Well-formed Processes . . . . . 0.4.3 Well-formed Systems . . . . . . 0.4.4 Assembly condition . . . . . . . Encapsulation Theorem . . . . . . . . Assembly Theorem . . . . . . . . . . .

. . . . . . . . . . . . . . . . . . . . Events . . . . . . . . . . . . . . . . . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

0.1 Subsets Denition

Subset

(X : Type) :=

X

→ Prop.

Denition Contained (X : Type) (X1 ∀ x, X1 x → X2 x. Denition

Contained X X1 Union

Denition

Intersect

Denition

Emptyset

(X : Type) (X1

B

: Type) (f

Variables and Events : Set.

g

:

Subset X

Subset X

X2

(X : Type) (x :

0.2 Denitions Var

X2

(X : Type) (X1

Denition eq ext (A ∀ a, f a = g a.

Parameter

:

(X : Type) (X1 X2 : Subset X2 ∧ Contained X X2 X1.

eq Subset

Denition

X2

X

:

:



False B

) :=

) (x :

Subset X

) :=

A

X

) :=

.

) :=

X

) (x :

) := X

X1 x

) :=



X1 x

X2 x



.

X2 x

.

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

. . . . . . . . . .

1 1 3 3 4 5 5 5 6 6

CONTENTS

September 8, 2009  2

Axiom Var dec : ∀ x y : Var, {x = y } + {x 6= y }. Parameter Event : Set. Axiom Event dec : ∀ e e' : Event, {e = e' } + {e 6= Denition

Object

:=

+

Var

Event

e'

}.

.

Values

Parameter Val : Set. Axiom Val dec : ∀ x

y

:

Val

, {x = y } + {x 6= y }.

Congurations

Parameter Conf : Set. Axiom Conf dec : ∀ c c' :

Conf

, {c =

c'

} + {c 6=

c'

}.

Environments

Denition Denition

Memory

:=

eq Memory

Var

:=



.

Val

eq ext Var Val

.

Denition update (m : Memory ) (x : Var ) (v : fun y : Var ⇒ match Var dec x y with | left ⇒ v | right ⇒ m y end.

Val

):

Memory

:=

Transfert functions

Denition Phi := (Conf × Memory ) → (Conf × (Subset Axiom Phi dec : ∀ phi : Phi, ∀ (a : Conf × Memory ) phi a a'

Denition

eq Phi

(phi

phi'

:

∨¬ Phi

phi a a'

) := ∀

.

a a'

(a' :

, (phi

Conf

a a'



Processes

Record

: Type := { R : Subset Object ; W : Subset Object ; C : Subset Conf ; phi : Phi }. Process

mkProcess

Systems

Record

: Type := mkSystem { L : Subset Object ; P : Subset Process }. System

Variables and Events read by a System Denition Sys Read (S : System ) (o : Object ) : Prop :=

Event



Memory

× (Subset phi' a a'

).

Event

) → Prop.



Memory

),

CONTENTS

∃ p, S.(P )

September 8, 2009  3 p

∧ p.(R ) o.

Variables and Events written by a System Denition Sys Write (S : System ) (o : Object ) : Prop := ∃ p, S.(P ) p ∧ p.(W ) o. Events of a System

Denition

Sys Events

Sys Read S

(inr

(S : System ) (e : Event ) : Prop := ) ∨ Sys Write S (inr Var e ).

Var e

Variables of a System Denition Sys Vars (S : System ) (x : Var ) : Prop := Sys Read S (inl Event x ) ∨ Sys Write S (inl Event

x

).

Variables and Events of a System Denition Sys Objects (S : System ) : Object → Prop := Union Object (Sys Read S ) (Sys Write S ).

0.3 Encapsulation and Assembly Denition

Encapsulation

.(P ).

(S :

System

) (X :

:

System

Subset Object

):

System

:=

mkSystem X S

Denition

Assembly

mkSystem

(Union

(S1

S2

Object

) : System := S1.(L) S2.(L)) (Union Process

.(P )

S1

0.4 Semantics Record

SysConf

: Type := mkSysConf { Cs : Process → Conf ; E : Subset Event }.

Record

State

: Type := { r : SysConf ; m : Memory }.

Denition

Trace

:=

nat

mkState



State

.

Parameter Sched : SysConf → SysConf → Prop. Inductive Transition (S : System ) (st st' : State ) : Prop := |

Univers Trans

:

(∀ p, S.(P ) p → (st.(r ).(Cs ) p ) = (st'.(r ).(Cs ) p )) → (∀ e, S.(L) (inr Var e ) → (st.(r ).(E ) e ↔ st'.(r ).(E ) e )) → (∀ x, S.(L) (inl Event x ) → (st.(m ) x = st'.(m ) x )) →

.(P )).

S2

CONTENTS

September 8, 2009  4

Transition S st st'

|

:

Local Trans



, .(P ) p → p.(phi ) (st.(r ).(Cs ) p, st.(m )) (st'.(r ).(Cs ) p, E p, st'.(m )) → (∀ p', p' 6= p → st.(r ).(Cs ) p' = st'.(r ).(Cs ) p' ) → eq Subset Event st'.(r ).(E ) (Union Event st.(r ).(E ) E p ) →

p E p S

Transition S st st'

|

Sched Trans

Sched st

.(r )

Transition

: .(r ) → S st st'.

st'

.(m )

eq Memory st

st'

.(m ) →

Denition Sem (S : System ) (t : Trace ) : Prop := ∀ i, Transition S (t i ) (t (i +1)%nat ). 0.4.1

Read and Written Variables and Events

Semantically Read Variables by a Process Denition Proc Sem Read Var (p : Process ) (x : Var ) : Prop := ∃ c : Conf, ∃ m : Memory, ∃ c' : Conf, ∃ E' : Subset Event, ∃ m' : Memory, ∃ v : Val, p.(C ) c ∧ p.(C ) c' ∧ p.(phi ) (c, m ) (c', E', m' ) ∧ ¬ (p.(phi ) (c, update m x v ) (c', E', m' )). Semantically Read Events by a Process Denition Proc Sem Read Event (p : Process ) (e : Event ) : Prop := ∃ C1 : Process → Conf, ∃ E1 : Subset Event, ∃ C2 : Process → Conf, ∃ E2 : Subset Event, p.(C ) (C1 p ) ∧ p.(C ) (C2 p ) ∧ Sched (mkSysConf C1 (fun e' ⇒ ((e' = e ) ∨ E1 e' ))) (mkSysConf C2 E2 ) ∧ ∀ (C3 C4 : Process → Conf ) (E4 : Subset Event ), C3 p = C1 p → Sched (mkSysConf C3 E1 ) (mkSysConf C4 C4 p 6= C2 p. Semantically Written Variables by a Process Denition Proc Sem Write Var (p : Process ) (x : Var ) : Prop := ∃ c : Conf, ∃ m : Memory, ∃ c' : Conf, ∃ E' : Subset Event, ∃ m' : Memory, p.(C ) c ∧ p.(C ) c' ∧ p.(phi ) (c, m ) (c', E', m' ) ∧ m x 6= m' x. Semantically Written Events by a Process

E4

)→

CONTENTS

September 8, 2009  5

Denition Proc Sem Write Event (p : Process ) (e : Event ) : Prop := ∃ c : Conf, ∃ m : Memory, ∃ c' : Conf, ∃ E' : Subset Event, ∃ m' : Memory, p.(C ) c ∧ p.(C ) c' ∧ p.(phi ) (c, m ) (c', E', m' ) ∧ E' e. Semantically Read Variables and Events by a Process Denition Proc Sem Read (p : Process ) (o : Object ) : Prop :=

match

with | inl x ⇒ Proc | inr e ⇒ Proc end. o

Sem Read Var p x Sem Read Event p e

Semantically Written Variables and Events by a Process Denition Proc Sem Write (p : Process ) (o : Object ) : Prop :=

match

with | inl x ⇒ Proc | inr e ⇒ Proc end. o

Sem Write Var p x Sem Write Event p e

Semantically Read Variables and Events by a System Denition Sys Sem Read (S : System ) (o : Object ) : Prop := ∃ p, S.(P ) p ∧ Proc Sem Read p o. Semantically Written Variables and Events by a System Denition Sys Sem Write (S : System ) (o : Object ) : Prop := ∃ p, S.(P ) p ∧ Proc Sem Write p o. 0.4.2

Well-formed Processes

Denition

Is Process (p : Process ) : Prop := (Contained Object (Proc Sem Read p ) p.(R )) ∧ (Contained Object (Proc Sem Write p ) p.(W )) ∧ (∀ (c c' : Conf ) (m m' : Memory ) (E : Subset Event ), p.(phi ) (c, m ) (c', E, m' ) → p.(C ) c ∧ p.(C ) c' ).

0.4.3

Well-formed Systems

Denition Is System (S : System ) : Prop := ∀ p, S.(P ) p → Is Process p. 0.4.4

Denition

Assembly condition Assemblable

(S

S'

:

System

) : Prop :=

CONTENTS

September 8, 2009  6

(Intersect Object S.(L) (Sys Write S' )) (Emptyset Object ) ∧ (Intersect Object S'.(L) (Sys Write S )) (Emptyset Object ) ∧ Process (Intersect Process S.(P ) S'.(P )) (Emptyset Process ).

eq Subset Object eq Subset Object eq Subset

0.5 Encapsulation Theorem Theorem Encapsulation Sem : ∀ (S : System ) (X Y : Subset Contained Trace

Object

),



Is System S

(Sem (Encapsulation S (Union (Sem (Encapsulation S X )).

Object X Y

)))

0.6 Assembly Theorem Theorem Assembly Sem : ∀ (S S' : System ), Is System eq Subset Trace

S



(Sem (Assembly

Is System S' S S'



Assemblable S S'

)) (Intersect

Trace

(Sem

S



) (Sem

S'

)).