Research Article

Evaluation of Tools and Slicing Techniques for Efficient Verification of UML/OCL Class Diagrams

Algorithm 2

Slicing algorithm.
Input: Property being verified
Output: A partition 𝑃 of the model 𝑀 into non-necessarily disjoint submodels
(1) 𝐺 ← 𝐡 𝑒 𝑖 𝑙 𝑑 𝐹 𝑙 π‘œ 𝑀 𝐺 π‘Ÿ π‘Ž 𝑝 β„Ž ( 𝑀 ) { C r e a t i n g t h e fl o w g r a p h }
(2) { C l u s t e r t h e O C L c o n s t r a i n t s }
(3) for each pair of constraints 𝑐 1 , 𝑐 2 in 𝑀 do
(4)  if ConstraintSupport( 𝑀 , 𝑐 1 ) ∩ ConstraintSupport ( 𝑀 , 𝑐 2 ) β‰  βˆ…   then
(5)  MergeInSameCluster ( 𝑐 1 , 𝑐 2 )
(6) end if
(7) end for
(8) { W o r k o n e a c h c l u s t e r o f c o n s t r a i n t s s e p a r a t e l y }
(9) for each cluster of constraints Cl do
(10) subModel ← empty model { I n i t i a l i z e t h e s u b M o d e l t o b e e m p t y }
(11)  { I n i t i a l i z e w o r k l i s t }
(12) workList ← Union of the ConstraintSupport of all constraints in the cluster
(13) while workList not empty do
(14)   𝑛 π‘œ 𝑑 𝑒 ← first(workList) { T a k e fi r s t e l e m e n t f r o m w o r k L i s t a n d r e m o v e i t }
(15)  workList ← w o r k L i s t ⧡ 𝑛 π‘œ 𝑑 𝑒
(16)  for each subclass or superclass 𝑐 of 𝑛 π‘œ 𝑑 𝑒   do
(17)   subModel ← subModel βˆͺ { 𝑐 }
(18)   if 𝑐 was not before in the subModel  then
(19)    workList ← workList βˆͺ { 𝑐 }
(20)   end if
(21)  end for
(22)  for each class 𝑐 tightly coupled to 𝑛 π‘œ 𝑑 𝑒   do
(23)   if 𝑃 π‘Ÿ π‘œ 𝑝 𝑒 π‘Ÿ 𝑑 𝑦 = weak SAT  then
(24)    subModel ← subModel βˆͺ { 𝑐 }
(25)   else if 𝑃 π‘Ÿ π‘œ 𝑝 𝑒 π‘Ÿ 𝑑 𝑦 = strong SAT  then
(26)    workList ← workList βˆͺ { 𝑐 }
(27)   end if
(28)  end for
(29) end while
(30) end for