Research Article

Service-Oriented Synthesis of Distributed and Concurrent Protocol Specifications

Algorithm 5

A procedure for remodeling the PE-SPEC to consider the concurrency behavior in the case where there is a receiving image of fork state.
Procedure:Re-Model_Parallel_Paths_for_Receiving_State
Inputs:
– a PE-SPEC that has an image state s of a fork state such that s is a receiving state,
G1, G2, and the subpaths found using the Partition_Parallel_Paths procedure given in Figure 10.
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 G2 end with an image of a joint state and this state is a sending state then
    (1.1) LastSUBs ={},
    (1.2) for each path p in G2do
  (1.2.1) LastSUBs = LastSUBs last sub-path in SUBp,
    (1.3) add to the PE-SPEC model i=1nC(n,i) copies for each path in G2, where n is |G2|1,
    (1.4) delete the copies of the image of the fork state and their associated transitions from the copied paths,
    (1.5) for each path p in G2do
  (1.5.1) LastSUBnp=LastSUBs last sub-path in SUBp,
  (1.5.2) connect the path p and its copies together using all subpaths in LastSUBnp 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.6) join all copied states that have no outgoing transitions together in a state j,
    (1.7) delete all redundant transitions connected to state j,
    (1.8) redirect the outgoing transitions from the joint state image to be initiated from state j,
    (1.9) for each path in G2
  (1.9.1) SUBp=SUBp last subpath in SUBp,
(2) for each path g  in G2do
    (2.1) for each path p in the set G2gdo
  (2.1.1) for each state sg  in path g excluding the image of the fork state do
(2.1.1.1) for each sub-path sp in SUBpdo
 (2.1.1.1.1) add a copy of the subpath sp to state sg such that the state sg  is, respectively,
the tail and head state of the first and last transitions in the subpath sp.
(3) if  there are copied paths created using Step 1.3 then
    (3.1) for each copied path c of an original path pdo
  (3.1.1) let q be any 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.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 image of the joint state.