Research Article

Service-Oriented Synthesis of Distributed and Concurrent Protocol Specifications

Algorithm 4

A procedure for remodeling the PE-SPEC to consider the concurrency behavior in the case where there is a sending image of fork state.
Procedure:Re-Model_Parallel_Paths_for_Sending_State.
Inputs:
– a PE-SPEC that has an image state s of a fork state such that s is a sending state,
G1, G2, and the subpaths found using the Partition_Parallel_Paths procedure given in Algorithm 5.
Outputs: a remodeled PE-SPEC that has additional states and transitions to consider the
concurrency behavior of the service specification.
Steps:
(1) if  the paths in G1 and G2 end with an image of a joint state and this joint image state is a sending state then
  (1.1) LastSUBs ={},
  (1.2) for each path in G2do
(1.2.1) LastSUBs = LastSUBs last sub-path in SUBp,
(1.2.2) SUBp=SUBp last sub-path in SUBp.
  (1.3) add to the PE-SPEC model i=1nC(n,i) copies of each path in G1, where n=|G2| (i.e.,
number of paths in G2) and C(n,i)=n!/(i!(ni)!),
  (1.4) connect each path in G1 and its copies together using all subpaths in LastSUBs such
that each combination of the subpaths is covered once. Connecting two paths using a
subpath includes connecting each state in one of the paths to its corresponding state in
the other path using the subpath,
  (1.5) join all copied states that have no outgoing transitions together in a state j,
  (1.6) delete all redundant transitions connected to state j,
  (1.7) redirect the outgoing transitions from the joint state image to be initiated from state j,
(2) for each state sg in G1do
  (2.1) for each path p in G2,
(2.1.1) for each sub-path in SUBpdo
(2.1.1.1) add a copy of the subpath to state sg such that the state sg is, respectively,
the tail and head state of the first and last transitions in the subpath.
(3) if  there are copied paths created using Step 1.3 then
  (3.1) for each copied path c of an original path p do
(3.1.1) let q be the path from any state in p to its copied state in c,
(3.1.2) for each subpath sp added in Step 2.1.1.1 to a state in pdo
(3.1.2.1) ifsp is a subpath of a path g and none of the transitions in q is a subpath in path gthen
(3.1.2.1.1) for each state sc in path cdo
(3.1.2.1.1.1) add a copy of the subpath sp to state sc such that the state sc is, respectively,
the tail and head state of the first and last transitions in the subpath.
(4) Delete redundant transitions connected to the images of the fork and joint states.
(5) Remove all paths in the groups in the set G2 excluding the images of the fork and joint states in these paths.