120 likes | 354 Views
UML-B: Formal Modeling and Design Aided by UML. B-Specification. -state model based, formal specification -3steps(specification,implementation and implementation) -for refinement it requires ‘refinement relation’. 0.. 1. UML-B model. +pbook. 1. Difficulties Translating from UML to B.
E N D
B-Specification -state model based, formal specification -3steps(specification,implementation and implementation) -for refinement it requires ‘refinement relation’
0.. 1 UML-B model +pbook 1
Difficulties Translating from UML to B • B is not object-oriented • Restrictions on B component and variable access • Simultaneous calls to several operations of another machine are not allowed UML-B profile: -uses stereotypes -defines tagged values(invariants,guards etc)
UML-B Model Architecture Class Diagrams -attributes -associations +current 0..* 0..1 1 0..* +cellChannels +dspChannels 0..* 0..*
TRANSLATION OF ųB -OCL=def:myExpression:integer=a → select(ocllsTypeOf(S)).x → sum() -ųB=Σi.(i ε C ۸ i ε S ۸ i ε ai.x) BEHAVIOUR - Invariants instance invariants class invariants - Operation Specification - Initialization - Appearance and Disappearance of class instances - subroutines +channels
BEHAVIOURAL SPECIFICATION BY STATE MACHINE • State Dependant Invariants • Example of state Machine Behaviour specification Inc / bx :=bx+1 Inc / bx :=bx+10 new BB Non_Zero Zero Dec [bx=1] Dec [bx>1] • State machine decision point s2 [G2] /A2 E1 [G1] /A1 s1 [G4] /A4 s3 [G3] /A3 s4 [G5] /A5
[G8]/A8 s8 E10[G10]/A10 s10 s9 [G9]/A9 E5[G5]/A5 s5 [G7]/A7 s7 s6 E6[G6]/A6
Alternative Semantics for UML-B State Machines s1 s2 REFINEMENT refines <<refinement>> cellphone1 <<machine>> cellphone
Refinement in UML-B +current PHONE CELL Powerlevel:INT +TRChannel +cellTRChannels +CBChannel +cellCBChannel +cellASChannles +ASChannels CBCH TRAFFIC ACCESS callkind:CALLKIND CHANNEL broadcasting:BOOL=FALSE