NWPT2015
T
- w
a r d s C
- mp
- n
e n t
- b
a s e d R e u s e f
- r
E v e n t
- B
A n d y E d m u n d s Å b
- A
k a d e m i , T u r k u , F i n l a n d a e d m u n d s @ a b
- .
f
NWPT2015 T o w a r d s C o mp o n e n t - b a s e - - PowerPoint PPT Presentation
NWPT2015 T o w a r d s C o mp o n e n t - b a s e d R e u s e f o r E v e n t - B A n d y E d m u n d s b o A k a d e m i , T u r k u , F i n l a n d a e d m u n d s
A n d y E d m u n d s Å b
k a d e m i , T u r k u , F i n l a n d a e d m u n d s @ a b
f
– Uses abstraction and non-determinism.
– is based on set theory and predicate logic. – can provide a precise description of a system. – uses stepwise development (refinement). – can be partly “hidden” by graphical notations.
3
– aimed at High Integrity Systems. – We specify important 'invariant' properties. – Show that state updates don't violate these
properties.
– Show that these properties hold as
development progresses.
– Uses proof and/or model checking.
– Looking at the engineering process.
4
– Describing static parts of the system. – Have Sets, Constants and Axioms.
– Describe the dynamic parts. – Have Variables, Invariants and Events.
– Have parametrised, guarded, atomic state updates.
– for structuring and scalability.
– gradual introduction of detail.
Composed Machine Machine Context includes refines sees extends scaling static definitions dynamic definitions
6
– through reuse of Event-B machines,
‒ by defining component interfaces.
‒ describing communication flow across component boundaries. ‒ adding additional proofs obligations.
‒ by adding a component instance diagram.
‒ extending iUML-B. ‒ adding new Event-B 'generators'.
7
– Name e; Parameters p; Guards G; Actions A
– Sets s; Constants c
– Variables v
e ≙ ANY p WHERE G(p, s, c, v) THEN A(p, s, c, v) END
8
– models parameters and local variables.
– blocking predicate.
– deterministic assignments := – non-deterministic assignments
e ≙ ANY p WHERE G(p, s, c, v) THEN A(p, s, c, v) END
specify properties atomic, guarded state updates
10
in the parameter declaration,
– not part of the name.
e ≙ ANY p? p! x WHERE G(p, x, v) THEN A(p, x, v) END
“Ignoring Sets and Constants”
11
VARIABLES va, vb ea || eb ≙ ANY p, xa , xb WHEN Ga (p, xa , va ) ∧ Gb (p, xb , vb ) THEN Aa (p, xa , va ) || Ab (p, xx , vb ) END MACHINE a || b MACHINE a MACHINE b VARIABLES va ea ≙ ANY p?a , p!a , xa WHEN Ga (pa , xa , va ) THEN Aa (pa , xa , va ) END VARIABLES vb eb ≙ ANY p?b , p!b , xb WHEN Gb (pb , xb , vb ) THEN Ab (pb , xb , vb ) END
Composed Machine ≈
'Reduced' parameter set “Ignoring Sets and Constants”
12
In a single machine, parameter set p = p? ⋃ p! Parameters q are typed: q? p? ^ q! p! ∈ ∈ In a composition, parameters are typed: q?a p? ∈
a ^ q!b p!
∈
b ^ q?b p?
∈
b ^ q!a p!
∈
a
Matching input/output parameters 'reduce', (q = q!a || q?b ) and (q = q!b || q?a ) so that, in the composition, p consists of reduced parameters q, q p ∈
13
(A Concrete Example)
MACHINE a MACHINE b VARIABLES A ∊ T ea ≙ ANY prm? WHEN prm ∊ T THEN A := prm END VARIABLES B ∊ T eb ≙ ANY prm! WHEN prm = B ^ prm ∊ T THEN SKIP END Composed Machine VARIABLES A ∊ T, B ∊ T ea || eb ≙ ANY prm WHEN prm = B ^ prm ∊ T THEN A := prm END MACHINE a || b
≈
Combined event So, A := B
14
– Identifies a component. – Identifies interface events. – (Identifies parameter direction).
15
16
17
– is part of the composed-machine. – specifies properties between internal elements of
included machines.
– ranges over all variables v in a composition. – ranges over all included sets and constants, s and c.
– is formed from the composed-machine CM's
composition invariant CI,
– … and invariants MI0..MIm of machines M0..Mm.
CMI(CM, M0 .. Mm ) = CI(s, c, v) ∧ MI0 (s0 , c0 , v0 ) ∧ .. ∧ MIm (sm , cm , vm )
18
– to satisfy the Composition Invariant. – remember, combined events reside in the composed
machine.
– The resulting combined event follows,
ea || eb ≙ ANY p, xa , xb WHERE GCI(v) ∧ Ga(p, xa , va ) ∧ Gb(p, xb , vb ) THEN Aa(p, xa , va ) || Ab(p, xb , vb ) END
“Ignoring Sets and Constants”
19
INVej || ek : CI(v) ∧ Ij(vj) ∧ Ik(vk)
∧
Gj(pj , vj) ∧ Gk(pk , vk) ∧ GCI(v)
∧
Aj(pj , vj , v'j) ∧ Ak(pk , vk , v'k) ⊢ ij(v'j) ∧ ik(v'k) ∧ CI(v')
20
compatible, w.r.t
– type – range
typeOfIn returns the type T of q?
ℕ typeOfIn(e , q?) = T typeOfIn(evt, prm?) = ℕ
21
‒ we call it FISpreStyle
FISpreStyle (ej(p?j , p!j ), ek(p?k , p!k )) = ∀ q!, q?·(q! p! ∈ ∧ q? p?) ∈ ⇒(typeOfOut(ej , q!) typeOfIn(e ⊆
k , q?)
Where parameters q are matched by name.
22
‒ Interface event “calls” (in Tech. Report). ‒ Tool Support. ‒ Library, linked data, search and retrieve.
‒ Marina Waldén - Åbo Akademi University, Turku, Finland. ‒ Colin Snook - University of Southampton, UK.