Abstract
Parallelizing transformations are applied in the process of high-level synthesis to enable the designer to optimize and improve the synthesis results. Parallelizing compilers often apply parallelizing transformations to convert a sequential program into a concurrentized or vectorized program so that the resulting parallel program can exploit the architectures of parallel machines. Concurrentization of loops in a sequential program is one of the most important transformations performed by these compilers. Loop concurrentization often requires insertion of \({ wait}\)–\({ signal}\) synchronization instructions within the body of the concurrentized loops to achieve synchronization among the threads for preserving the dependences of the original sequential program. In the current work, we have proposed a method of analyzing the synchronization instructions for constructing the dependence graph of a loop concurrentized program. The resulting dependence graph, devoid of the synchronization instructions, is then checked for equivalence with the dependence graph of the original sequential program using methods reported in the literature. The proposed algorithm signals errors if the parallel program deadlocks or becomes non-determinate due to faulty insertion of \({ wait}\)–\({ signal}\) instructions.
Similar content being viewed by others
References
Owicki, S., Gries, D.: Verifying properties of parallel programs: an axiomatic approach. Commun. ACM 19(5), 279–285 (1976). doi:10.1145/360051.360224
Sinha, A., Malik, S., Gupta, A.: Efficient predictive analysis for detecting nondeterminism in multi-threaded programs. In: FMCAD’12, pp. 6–15 (2012)
Wang, C., Kundu, S., Ganai, M., Gupta, A.: Symbolic predictive analysis for concurrent programs. In: Proceedings of the 2nd World Congress on Formal Methods, pp. 256–272. Berlin, Heidelberg (2009). ISBN 978-3-642-05088-6. doi:10.1007/978-3-642-05089-3_17
Sethi, D., Talupur, M., Malik, S.: Model checking software. In: Proceedings of 20th International Symposium, Spin 2013, Stony Brook, NY, USA, July 8–9, 2013 (2013). doi:10.1007/978-3-642-39176-7_20
Karfa, C., Sarkar, D., Mandal, C., Kumar, P.: An equivalence-checking method for scheduling verification in high-level synthesis. IEEE Trans. Comput. Aided Des. Integr. Circuits Syst. 27(3), 556–569 (2008). ISSN 0278-0070
Kundu, S., Lerner, S., Gupta, R.K.: Translation validation of high-level synthesis. IEEE Trans. CAD Integr. Circuits Syst. 29(4), 566–579 (2010). doi:10.1109/TCAD.2010.2042889
Bandyopadhyay, S., Banerjee, K., Sarkar, D., Mandal, C.: Translation validation for PRES+ models of parallel behaviours via an FSMD equivalence checker. In: Proceedings of Progress in VLSI Design and Test—16th International Symposium, VDAT 2012, Shibpur, India, July 1–4, 2012, pp. 69–78 (2012). doi:10.1007/978-3-642-31494-0_9
Hu, L., Hutton, G.: Compiling concurrency correctly: cutting out the middle man. In: Proceedings of the Tenth Symposium on Trends in Functional Programming, TFP 2009, Komárno, Slovakia, June 2–4, 2009, pp. 17–32 (2009)
Collingbourne, P., Cadar, C., Kelly, P.H.J.: Symbolic crosschecking of data-parallel floating-point code. IEEE Trans. Softw. Eng. 40(7), 710–737 (2014). doi:10.1109/TSE.2013.2297120
Nicolau, A., Li, G., Kejariwal, A.: Techniques for efficient placement of synchronization primitives. In: Proceedings of the 14th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPoPP’09, pp. 199–208. ACM, New York, NY, USA (2009). ISBN 978-1-60558-397-6. doi:10.1145/1504176.1504207
Kahlon, V.: Automatic lock insertion in concurrent programs. In: Formal Methods in Computer-Aided Design, FMCAD 2012, Cambridge, UK, October 22–25, 2012, pp. 16–23 (2012). http://ieeexplore.ieee.org/xpl/articleDetails.jsp?arnumber=6462551
Dutta, S., Sarkar, D., Rawat, A., Singh, K.: Validation of loop parallelization and loop vectorization transformations. In: Proceedings of Evaluation of Novel Software Approaches to Software Engineering (to appear) (2016)
Feautrier, P.: Dataflow analysis of array and scalar references. Int. J. Parallel Program. 20(1), 23–53 (1991). doi:10.1007/BF01407931
Liang, D., Harrold, M.J.: Slicing objects using system dependence graphs. In: Proceedings of the International Conference on Software Maintenance, ICSM’98, p. 358. IEEE Computer Society, Washington, DC, USA (1998). ISBN 0-8186-8779-7. http://dl.acm.org/citation.cfm?id=850947.853342
Collard, J., Barthou, D., Feautrier, P.: Fuzzy array dataflow analysis. In: Proceedings of the Fifth ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, PPOPP’95, pp. 92–101. ACM, New York, NY, USA (1995). ISBN 0-89791-700-6. doi:10.1145/209936.209947
Krinke, J.: Static slicing of threaded programs. In: Proceedings of the 1998 ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, PASTE’98, pp. 35–42. ACM, New York, NY, USA (1998). ISBN 1-58113-055-4. doi:10.1145/277631.277638
Cheng, J.: Process dependence net of distributed programs and its applications in development of distributed systems. In: Computer Software and Applications Conference, 1993. COMPSAC 93. Proceedings., Seventeenth Annual International, pp. 231–240 (1993). doi:10.1109/CMPSAC.1993.404187
Sarkar, V.: Automatic partitioning of a program dependence graph into parallel tasks. IBM J. Res. Dev. 35(5–6), 779–804 (1991). doi:10.1147/rd.355.0779
Ferrante, J., Ottenstein, K.J., Warren, J.D.: The program dependence graph and its use in optimization. ACM Trans. Program. Lang. Syst. 9(3), 319–349 (1987). doi:10.1145/24039.24041
Allen, J.R., Kennedy, K., Porterfield, C., Warren, J.: Conversion of control dependence to data dependence. In: Proceedings of the 10th ACM SIGACT-SIGPLAN Symposium on Principles of Programming Languages, POPL’83, pp. 177–189. ACM, New York, NY, USA (1983). ISBN 0-89791-090-7. doi:10.1145/567067.567085
Shashidhar, K.C., Bruynooghe, M., Catthoor, F., Janssens, G.: Functional equivalence checking for verification of algebraic transformations on array-intensive source code. Proc. Des. Autom. Test Eur. 2, 1310–1315 (2005)
Karfa, C., Banerjee, K., Sarkar, D., Mandal, C.: Verification of loop and arithmetic transformations of array-intensive behaviors. IEEE Trans. CAD Integr. Circuits Syst. 32(11), 1787–1800 (2013)
Verdoolaege, S., Janssens, G., Bruynooghe, M.: Equivalence checking of static affine programs using widening to handle recurrences. ACM Trans. Program. Lang. Syst. 34(3), 11:1–11:35 (2012). doi:10.1145/2362389.2362390
Collard, J.-F., Griebl, M.: Array dataflow analysis for explicitly parallel programs. Parallel Process. Lett. 07(02), 117–131 (1997). doi:10.1142/S0129626497000140
Midkiff, S.P., Padua, D.A.: A comparison of four synchronization optimization techniques. ICPP 2, 9–16 (1991)
Griebl, M., Lengauer, C.: The loop parallelizer loopo. In: Proceedings of Sixth Workshop on Compilers for Parallel Computers, volume 21 of Konferenzen des Forschungszentrums Jülich, pp. 311–320. Forschungszentrum (1996)
Bondhugula, U., Baskaran, M., Krishnamoorthy, S., Ramanujam, J., Rountev, A., Sadayappan, P.: Automatic transformations for communication-minimized parallelization and locality optimization in the polyhedral model. In: International Conference on Compiler Construction (ETAPS CC) (2008)
Amini, M., Goubier, O., Guelton, S., McMahon, J.O., Pasquier, F., Péan, G., Villalon, P.: Par4all: from convex array regions to heterogeneous computing. In: IMPACT 2012: Second International Workshop on Polyhedral Compilation Techniques HiPEAC 2012 (2012)
Author information
Authors and Affiliations
Corresponding author
Appendix: Correctness
Appendix: Correctness
1.1 Termination
The termination proof of algorithm 3 obviously uses the facts that the functions it invokes, either directly or through some other functions, terminate. The termination proofs of all these functions are given below in a bottom-up manner.
Algorithm 5 iterates over all paths \(\pi \in \varPi _{ws}\). As the wait–signal statements are finite in number, the set \(\varPi _{ws}\) is finite and the procedure terminates. Algorithm 6 iterates over a subset of paths \(\varPi ' \subseteq \varPi _{ws}\) such that for any \(\pi \in \varPi '\), \(M_{\pi }(i)\) \(\ne \) \(M_{\langle \alpha _1, \alpha _2\rangle }(i)\) over the domain \(D_u\) \(=\) \(dom(M_{\langle \alpha _1, \alpha _2\rangle }^{u_{ws}})\). It also iterates over the set of fundamental cycles \(C_{ws}\) which are finite in number. Hence, the procedure terminates. Algorithm 4 invokes two procedures (Algorithms 5 and 6) and it does not involve any loop. Hence it terminates as these two procedures always terminate.
Theorem 1
(Termination) Algorithm 3 always terminates.
The procedure for construction of preliminary conflict access graphs (step 2) always terminates as it finds the accesses from all the statements of the transformed program. It then finds the conflict accesses and the conflict edges between all the conflict accesses performed in the same thread. As the number of statements is finite, the process of extracting accesses, conflict accesses, and conflict edges surely terminates (step 2). The procedure of construction of the wait–signal graphs (step 4) also terminates as the number of wait–signal statements is finite. The procedure of finding paths in the wait–signal graphs (step 7) and the procedure of finding fundamental cycles in the wait–signal graphs (step 10) always terminates for the same reason. As the number of fundamental cycles in the wait–signal statements is finite, the procedure of finding deadlock (step 13) by finding the composition of the mappings of the edges of the fundamental cycles always terminates. The only loop in Algorithm 3 (steps 16–36) iterates over a subset of the conflict edge \(E_u \subseteq E_c\) and invokes Algorithm 4 at two steps (steps 21 and 29); the set \(E_c\) is finite; also, we have argued that Algorithm 4 always terminates; so the loop always terminates. The procedure for constructing DG (step 39) calls the procedure for dataflow analysis for the read accesses and output arrays of the program. As the number of accesses and the number of output arrays are finite in a program, the method for dataflow analysis terminates. In the next step, the procedure for constructing DG calls the procedure of pre-order traversal for each output array z and for each of the statements s in a set, \(S_z\) say, which write most recently on z on non-overlapping memory locations. Both set P of output arrays and set \(S_z\) are finite. Hence, the procedure for pre-order traversal is invoked finite number of times. We need to prove that each of the invocations terminates. Let S denote the set of all statements in the program. Suppose, the number of operators and accesses in a statement s is \(o_s\) and \(a_s\) respectively. As the pre-order traversal procedure for computing pre-order traversal for the entire syntax tree \(T_s\) of any statement s is called only once, the procedure for pre-order traversal can be called maximum \(\underset{s \in S}{\sum }\) \((a_s + o_s)\) times which is finite. Hence, the procedure for constructing DG from CAG and also the Algorithm 3 terminate.
1.2 Soundness and Completeness
The formal treatment of soundness and completeness of the analysis mechanism needs a formal definition of dependence between conflict access instances and formalization of the functional relationship that holds between the input(s) and the output(s) of the functions InstallEdge, FindSupportingPath and FindSupportingWalk. In the following, we present a definition and three lemmas to this end.
Definition 6
Dependence between two access instances
An access instance \(\alpha _1(\overline{i})\) depends on an access instance \(\alpha _2(f(\overline{i}))\), \(\overline{i} \in D_i\) if and only if they are conflict access instances over \(D_i\) and the former executes after the latter.
Lemma 1
Characterization of FindSupportingPath: The function FindSupportingPath (Algorithm 5) takes as inputs (i) two conflict accesses \(\alpha \), \(\alpha '\), (ii) the set \(\varPi \) of paths in \(G_{ws}\) and (iii) a sub-domain \(D_u^{i}\) of the domain of \(M_{\langle \alpha , \alpha '\rangle }\); it identifies all the paths of \(\varPi \) which can cover the mapping \(M_{\langle \alpha , \alpha '\rangle }\) either partially or completely over the sub-domain \(D_u^i\) of the domain of \(M_{\langle \alpha , \alpha '\rangle }\); it returns (i) an uncovered sub-domain \(D_u^{f}\) of the domain \(D_u^{i}\) for which no path can be found having an identical mapping as \(M_{\langle \alpha , \alpha '\rangle }\) and (ii) a set \(\varPi '\) of paths which were found to be unsuitable for covering the mapping \(M_{\langle \alpha , \alpha '\rangle }\); among the inputs and outputs of the function, the following relations hold:
-
R1.1: \(D_u^{f} \subseteq D_u^{i}\),
-
R1.2: \(\forall \overline{i} \in D_u^{i} - D_u^{f}\), \(\exists \pi = \langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \in \varPi \), such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha \), \(\alpha '\) \(\prec _f\) \(\alpha _{n, \pi }\) and \(M_{\pi }(\overline{i})\) \(=\) \(M_{\langle \alpha , \alpha '\rangle }(\overline{i})\),
-
R1.3: \(\forall \overline{i} \in D_u^{f}\), there exist no such paths that satisfy the condition given in R1.2.
-
R1.4: \(\forall \pi \in \varPi '\), if \(\pi \) is of the form \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \) where \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha \), \(\alpha '\) \(\prec _f\) \(\alpha _{n, \pi }\), then \(\forall \overline{i} \in dom(M_{\pi }) \cap D_u^{i}\), \(M_{\pi }(\overline{i})\) \(\ne \) \(M_{\langle \alpha , \alpha '\rangle }(\overline{i})\).
Proof
For the relation R1.1 for the set \(D_u^{f}\), it is to be noted that the domain \(D_u\) with an initial value \(D_u^i\) is updated only in step 5. Let \(D_u^{-, j}\) denote the value of \(D_u\) before execution of the jth loop iteration (steps 2–9) and \(D_u^{+, j}\) represent its value after the jth loop iteration; let \(\pi _j\) be the path of \(\varPi \) being considered in this iteration and let \(\pi _j\) be of the form \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \). If \(\pi _j\) satisfies the condition in step 3 and that in step 4, then \(D_u^{+, j}\) = \(D_u^{-, j}-dom(M_{\pi _j})\) (obtained through step 5). So \(D_u^{+, j}\) \(\subsetneq \) \(D_u^{-, j}\). If \(\pi _j\) does not satisfy the condition in step 3 or that in step 4, then \(D_u^{+, j}\) = \(D_u^{-, j}\). Hence, at the end of the jth iteration \(D_u^{+, j}\) \(\subseteq \) \(D_u^{-, j}\). Now, \(D_u^i\) = \(D_u^{-, 1}\), \(D_u^f\) = \(D_u^{+, l}\), where l is the total number of iterations, \(l \le \left| {\varPi }\right| \) and \(D_u^{-, j+1}\) = \(D_u^{+, j}\), \(\forall j\) \(1 \le j < l\); hence, we have the chain \(D_u^f\) = \(D_u^{+, l}\) \(\subseteq \) \(D_u^{-, l}\) = \(D_u^{+, l - 1}\) \(\subseteq \) \(\ldots \) \(\subseteq \) \(D_u^{+, 1}\) \(\subseteq \) \(D_u^{-, 1}\) = \(D_u^i\); so R1.1 holds.
For the relation R1.2, again considering the jth iteration, if \(\pi _j\) satisfies the condition in step 3 and that in step 4, then \(\forall \overline{i} \in \) \(D_u^{-, j}-D_u^{+, j}\) \(\ne \) \(\emptyset \), \(M_{\pi _j}(\overline{i})\) = \(M_{\langle \alpha , \alpha '\rangle }(\overline{i})\) = \(\mathcal{R}_1\), say. If \(\pi _j\) does not satisfy the condition in step 3 or that in step 4, then \(D_u^{-, j}-D_u^{+, j}\) = \(\emptyset \) (as argued in the above paragraph). So the relation \(\mathcal{R}_1\) holds vacuously. Therefore, \(\mathcal{R}_1\) holds in both the cases. Specifically, for \(j = 1\) \(\forall \overline{i}\) \(\in \) \(D_u^{-, 1} - D_u^{+, 1}\) = \(D_u^i - D_u^{+, 1}\), the relation R1.2 holds with \(\pi = \pi _1\); for \(j = 2\), \(\forall \overline{i}\) \(\in \) \(D_u^{-, 2} - D_u^{+, 2}\) = \(D_u^{+, 1}-D_u^{+, 2}\) \(\ne \) \(\emptyset \). The relation R1.2 holds with \(\pi = \pi _2\). Combining the cases for \(j = 1\) and \(j = 2\), therefore, \(\forall \overline{i}\) \(\in \) (\(D_u^i - D_u^{+, 1}\)) \(\cup \) (\(D_u^{+, 1}-D_u^{+, 2}\)), R1.2 holds for some \(\pi \in \varPi _2\) = {\(\pi _1\), \(\pi _2\)}. Since, \(D_u^{+, 2}\) \(\subseteq \) \(D_u^{+, 1}\) \(\subseteq \) \(D_u^i\), \(D_u^i - D_u^{+, 2}\) = (\(D_u^i-D_u^{+,1}\)) \(\cup \) (\(D_u^{+, 1}-D_u^{+, 2}\)). Therefore, after two iterations, R1.2 holds \(\forall \overline{i}\) \(\in \) \(D_u^i - D_u^{+, 2}\) for some \(\pi \in \varPi _2\). Continuing this way, after l iterations, R1.2 holds for \(\forall \overline{i}\) \(\in \) \(D_u^i - D_u^{+, l}\) = \(D_u^i - D_u^f\) for some path \(\pi \) \(\in \) \(\varPi _l\) = {\(\pi _1\), \(\pi _2\), \(\ldots \), \(\pi _l\)} \(\subseteq \) \(\varPi \). If \(D_u^f\) = \(\emptyset \) so that return takes place through step 9, then \(\varPi _l\) may be a strict subset of \(\varPi \); otherwise, return takes place through step 10 after the loop (steps 2 through 9) is completed, whereupon \(\varPi _l\) = \(\varPi \).
For relation R1.3, to see that \(\forall \overline{i} \in D_u^f\), no path satisfies the conditions depicted in steps 3 and 4, let us prove the invariant \(\forall \overline{i} \in \) \(D_u^{+, j}\), there exist no paths in \(\varPi _j\) = \(\{\pi _1\), \(\pi _2\), \(\ldots \), \(\pi _j\}\) satisfying the condition given in R1.2, for all values of j, \(1 \le j \le l\), (i.e., for all iterations), by induction on j.
Basis (j = 1) \(\varPi _1\) = \(\{\pi _1\}\) and either \(D_u^{+, 1}\) = \(D_u^{-, 1}\) or \(D_u^{+, 1}\) \(\subsetneq \) \(D_u^{-, 1}\). For the former case, \(\pi _1\) falsifies the condition in step 3 or that in step 4. So \(\pi _1\) does not provide any support \(\forall \overline{i} \in D_u^{+, 1}\). For the latter case, \(\pi _1\) provides support only for the sub-domain \(D_u^{-, 1}-D_u^{+, 1}\) and does not provide any support \(\forall \overline{i} \in D_u^{+, 1}\) since domain of \(M_{\pi _1}\) does not belong to \(D_u^{+, 1}\) (= \(D_u^{-, 1}-dom(M_{\pi _1})\)).
Induction hypothesis Let there exist no paths in \(\varPi _{j - 1}\) = {\(\pi _1\), \(\pi _2\), \(\ldots \), \(\pi _{j-1}\)} \(\subseteq \) \(\varPi \) which provide support for any \(\overline{i} \in D_u^{+, j- 1}\) = \(D_u^{-, j}\).
Induction step It can be identically argued as in the basis case that no paths in \(\varPi _j\) = {\(\pi _1\), \(\pi _2\), \(\ldots \), \(\pi _j\)} \(\subseteq \) \(\varPi \) provide the support \(\forall \overline{i} \in D_u^{+, j}\). Now, by substituting \(j = l\) in the invariant, we have, after execution of the loop, \(D_u^f\) = \(D_u^{+, l}\). If \(D_u^f\) = \(\emptyset \) (as detected in step 8), then the relation R1.3 holds vacuously. Otherwise, \(\varPi _l\) = \(\varPi \) and the relation holds.
For the relation R1.4 regarding the set \(\varPi '\), we notice that \(\varPi '\) is initialized to \(\emptyset \) in step 1; hence as per the loop condition, it acquires as its member a path \(\pi \in \varPi \) of the form \(\pi = \langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \) only in step 7 of an iteration of the loop; this step executes in an iteration with a starting value \(D_u^-\), say, a sub-domain of \(D_u^i\), under the condition \(\forall \overline{i} \in D_u^{-} \cap dom(M_{\pi })\) such that \(M_{\pi }(\overline{i})\) \(\ne \) \(M_{\langle \alpha , \alpha '\rangle }(\overline{i})\) (as per the else-statement of the if-statement in step 4), where \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha \) and \(\alpha '\) \(\prec _f\) \(\alpha _{n, \pi }\) (as per the condition of the if-statement in step 3). As \(D_u^{-} \subseteq D_u^{i}\) and the above condition for including a path in the set \(\varPi '\) holds for any of its members, the relation R1.4 holds for all the members of \(\varPi '\).\(\square \)
Lemma 2
Characterization of FindKPrime: The function FindKPrime takes as inputs (i) a prefix \(\pi _1\), (ii) a suffix \(\pi _2\) of a path \(\pi \) of the form \(\pi _1\).c.\(\pi _2\), where c is a fundamental cycle such that \(\pi _1\) = \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{i, \pi }\rangle \), \(\pi _2\) = \(\langle \alpha _{i, \pi }\), \(\alpha _{i + 1, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \) and \(c = \langle \alpha _{1, c}, \alpha _{2, c}, \ldots , \alpha _{m, c}\rangle \) with \(\alpha _{i, \pi } = \alpha _{j, c}\), for some j, \(1 \le j \le m\), (iii) a permutation \(c'\) = \(\langle \alpha _{j, c}\), \(\alpha _{j+1, c}\), \(\ldots \), \(\alpha _{m, c}\), \(\alpha _{1, c}\), \(\ldots \), \(\alpha _{j-1, c}\rangle \) of the cycle c, (iv) the mapping \(M_{\langle \alpha , \alpha '\rangle }\), where \(\alpha \), \(\alpha '\) are some conflict access pair, (v) \(D_u\), a subdomain of the domain of \(M_{\langle \alpha , \alpha '\rangle }\). It returns a non-negative integer \(k'\) such that the following relation holds:
R2.1 If \(k'>0\), then (\(M_{\pi _2}\) \(\circ \) \(M_{{c'}^{k'}}\) \(\circ \) \(M_{\pi _1})\)(\(\overline{i}\)) = \(M_{\langle \alpha , \alpha '\rangle }(\overline{i})\), \(\forall \overline{i}\) \(\in \) \(dom(M_{\pi _2}\) \(\circ \) \(M_{{c'}^{k'}}\) \(\circ \) \(M_{\pi _1})\) \(\cap \) \(D_u\) and if \(k' = 0\), then (\(M_{\pi _2}\) \(\circ \) \(M_{{c'}^{k'}}\) \(\circ \) \(M_{\pi _1})\)(\(\overline{i}\)) \(\ne \) \(M_{\langle \alpha , \alpha '\rangle }(\overline{i})\), \(\forall \overline{i}\) \(\in \) \(dom(M_{\pi _2}\) \(\circ \) \(M_{{c'}^{k'}}\) \(\circ \) \(M_{\pi _1})\) \(\cap \) \(D_u\).
Proof
Proof is followed from Sect. 4.3.\(\square \)
Lemma 3
Characterization of FindSupportingWalk: The function FindSupportingWalk (Algorithm 6) takes as inputs (i) two conflict accesses \(\alpha \), \(\alpha '\), (ii) a set \(\varPi \subseteq \varPi _{ws}\) of paths in \(G_{ws}\), (iii) the set \(C = C_{ws}\) of fundamental cycles in \(G_{ws}\), (iv) a sub-domain \(D_u^{i}\) of the domain of \(M_{\langle \alpha , \alpha '\rangle }\); it identifies all the walks which can cover the mapping \(M_{\langle \alpha , \alpha '\rangle }\) either partially or completely over the domain of \(M_{\langle \alpha , \alpha '\rangle }\); it returns an uncovered sub-domain \(D_u^{f}\) of the domain \(D_u^{i}\) for which no walk can be found having identical mapping as \(M_{\langle \alpha , \alpha '\rangle }\); among the inputs and the output \(D_u^{f}\) of the function the following relations hold:
-
R3.1: \(D_u^{f} \subseteq D_u^{i}\),
-
R3.2: \(\forall \overline{i} \in D_u^{i} - D_u^{f}\), \(\exists \pi \) = \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \) \(\in \) \(\varPi \), \(\exists c = \langle \alpha _{1, c}\), \(\alpha _{2, c}\), \(\ldots \), \(\alpha _{m, c}\rangle \in C\) such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha \), \(\alpha '\) \(\prec _f\) \(\alpha _{n, \pi }\), \(\alpha _{i, \pi }\) = \(\alpha _{j, c}\) for some i, \(1\le i \le n\) and for some j, \(1\le j \le m\), and \(\forall \overline{i}\) \(\in \) \(dom(M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1}) \cap D_u^i\), \((M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1})(\overline{i})\) \(=\) \(M_{\langle \alpha , \alpha '\rangle }(\overline{i})\), where \(\pi _1\) is the prefix \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \) \(\alpha _{i, \pi }\rangle \) of \(\pi \), \(\pi _2\) is the suffix \(\langle \alpha _{i, \pi }\), \(\alpha _{i+1, \pi }\), \(\ldots \) \(\alpha _{n, \pi }\rangle \) of \(\pi \), \(c'\) is the permutation \(\langle \alpha _{j, c}\), \(\alpha _{j+1, c}\), \(\ldots \), \(\alpha _{m, c}\), \(\alpha _{1, c}\), \(\ldots \), \(\alpha _{j-1, c}\rangle \) of c and \(k' > 0\),
-
R3.3: \(\forall \overline{i} \in D_u^{f}\), there exist no such walks as characterized in R3.2 above.
Proof
Note that the function comprises a two-nest loop. So any iteration can be indexed by an ordered pair (i, k), where i, \(1\le i \le |\varPi |\), indexes the outer loop and k, \(1 \le k \le |c|\), indexes the inner loop. Since the set of these indices is totally ordered, for brevity, we index any iteration (\(i_j\), \(k_j\)) unambiguously as j, \(1 \le j \le |\varPi |\times |c|\). Specifically, \(j= (i_j-1)\times c+k_j,1 \le k_j \le |c|\).
Let \(D_u^{-, j}\) (\(D_u^{+, j}\)) denote the value of \(D_u\) before (after) execution of the jth iteration. Depending on whether step 12 is visited or not, \(D_u^{+, j}\) \(\subset \) \(D_u^{-, j}\) or \(D_u^{+, j}\) = \(D_u^{-, j}\), respectively. Hence, \(D_u^{+, j}\) \(\subseteq \) \(D_u^{-, j}\) for any j. As \(D_u^f\) = \(D_u^{+, l}\), where l is the last iteration of the loop, \(D_u^{-, 1}\) = \(D_u^i\), \(D_u^{-, j+1}\) = \(D_u^{+, j}\) and \(\forall j\), \(D_u^{+, j}\) \(\subseteq \) \(D_u^{-, j}\), we have the following chain: \(D_u^f\) = \(D_u^{+, l}\) \(\subseteq \) \(D_u^{-, l}\) = \(D_u^{+, l-1}\) \(\subseteq \) \(\cdots \) \(D_u^{+, 1}\) \(\subseteq \) \(D_u^{-, 1}\) = \(D_u^i\). Hence, relation R3.1 holds.
For the relation R3.2, again considering the jth iteration we may have either case (i) \(D_u^{+, j}\) = \(D_u^{-, j}\) or \(D_u^{+, j}\) \(\subset \) \(D_u^{-, j}\). For case (i), \(D_u^{+, j}-D_u^{-, j}\) = \(\emptyset \) and hence, \(\forall \overline{i}\) \(\in \) \(D_u^{+, j}-D_u^{-, j}\), the relation R3.2 holds vacuously. For case (ii), step 12 must have been executed. Hence, the conditions associated with statements 1 2, 3, 4 and 11 are satisfied. So relation R2.1 of Lemma 2 with \(D_u\) = \(D_u^{-, j}\) and \(\pi \) = \(\pi _j\), it follows that \(\forall \overline{i}\) \(\in \) \(dom(M_{\pi _2}\) \(\circ \) \(M_{{c'}^{k'}}\) \(\circ \) \(M_{\pi _1})\) \(\cap \) \(D_u^{-, j}\). Thus R3.2 holds \(\forall \overline{i}\) \(\in \) \(D_u^{-, j}-D_u^{+, j}\).
Now, specifically for \(j = 1\), \(\forall \overline{i}\) \(\in \) \(D_u^{-, 1}-D_u^{+, 1}\), the relation R3.2 holds with \(\pi \) = \(\pi _{i_1}\) and c = \(c_{k_1}\); for \(j = 2\) \(\forall \overline{i}\) \(\in \) \(D_u^{-, 2}-D_u^{+, 2}\) = \(D_u^{+, 1}-D_u^{+, 2}\), the relation R3.2 holds with \(\pi = \pi _{i_2}\) and \(c = c_{k_2}\). Combining the cases for \(j = 1\) and \(j = 2\), therefore, \(\forall \overline{i}\) \(D_u^i-D_u^{+,1}\) \(\cup \) \(D_u^{+, 1}-D_u^{+,2}\), R3.2 holds for some \(\pi \in \varPi _2\) = {\(\pi _1\), \(\pi _2\)} and some \(c \in C_2\) = {\(c_{k_1}\), \(c_{k_2}\)}. Since, \(D_u^{+,2}\) \(\subseteq \) \(D_u^{+,1}\) \(\subseteq \) \(D_u^i\), \(D_u^i-D_u^{+,2}\) = \(D_u^i-D_u^{+,1}\) \(\cup \) \(D_u^{+, 1}-D_u^{+,2}\). Therefore, after two iterations, R3.2 holds \(\forall \overline{i}\) \(\in \) \(D_u^i-D_u^{+,2}\) for some \(\pi \in \varPi _2\) = {\(\pi _1\), \(\pi _2\)} and some \(c \in C_2\) = {\(c_{k_1}\), \(c_{k_2}\)}. Continuing this way, after l iterations, l = \(|\varPi |\times |C|\), R3.2 holds \(\forall \overline{i}\) \(\in \) \(D_u^i\) - \(D_u^{+,l}\) = \(D_u^i-D_u^f\) for some \(\pi \in \varPi _l\) = {\(\pi _1\), \(\pi _2\), \(\ldots \), \(\pi _l\)} and some \(c \in C_l\) = {\(c_{k_1}\), \(c_{k_2}\), \(\ldots \), \(c_{k_l}\)}. So this completes the proof of R3.2.
For the relation R3.3, we prove the invariant that for the jth iteration for any j, \(\forall \overline{i}\) \(\in \) \(D_u^{+, j}\), there is no supporting walk comprising paths from the subset \(\varPi _j\) = {\(\pi _{i_1}\), \(\ldots \), \(\pi _{i_j}\)} \(\subseteq \) \(\varPi \) and cycles from the subset \(C_j\) = {\(c_{k_1}\), \(\ldots \), \(c_{k_j}\)}\(\subseteq \) C. This can be proved by induction on j over the range 1 to l \(\le \) \(|\varPi |\times |C|\).
Basis (j = 1) Here \(\varPi _1\) = {\(\pi _{i_1}\)} and \(C_1\) = {\(c_{k_1}\)}. If \(D_u^{+, 1}\) = \(D_u^{-, 1}\), then step 12 is not executed. This may happen if (i) \(\pi _{i_1}\) does not meet the condition of step 2 or (ii) \(\pi _{i_1}\) and \(c_{k_1}\) do not meet the condition of step 4 or (iii) \(k' \not > 0\) in step 11. Under any of these conditions, (\(\pi _{i_1}\), \(c_{k_1}\)) does not result in a supporting walk. Otherwise, (\(\pi _{i_1}\), \(c_{k_1}\)) does provide a supporting walk over a domain which is not contained in \(D_u^{+, 1}\) because of step 12. Hence, the invariant holds for \(\varPi _1\) = {\(\pi _{i_1}\)} and \(C_1\) = {\(c_{k_1}\)}.
Induction hypothesis Let the invariant hold up to \((j - 1)\)th iterations i.e., \(\forall \overline{i}\) \(\in \) \(D_u^{+, j - 1}\), there is no supporting walk comprising paths from the subset \(\varPi _{j - 1}\) = {\(\pi _{i_1}\), \(\ldots \), \(\pi _{i_{j - 1}}\)} \(\subseteq \) \(\varPi \) and cycles from the subset \(C_{j - 1}\) = {\(c_{k_1}\), \(\ldots \), \(c_{k_{j - 1}}\)}.
Induction step For the jth iteration the path considered is \(\pi _{i_j}\) and the cycle considered is \(c_{k_j}\). If \(D_u^{+, j}\) = \(D_u^{-, j}\), then step 12 is not executed. This may happen if (i) \(\pi _{i_j}\) does not meet the condition of step 2 or (ii) \(\pi _{i_j}\) and \(c_{k_j}\) do not meet the condition of step 4 or (iii) \(k' \not > 0\) in step 11. Under any of these conditions, (\(\pi _{i_j}\), \(c_{k_j}\)) does not result in a supporting walk. Otherwise, (\(\pi _{i_j}\), \(c_{k_j}\)) does provide a supporting walk over a domain which is not contained in \(D_u^{+, j}\) because of step 12. Hence, the invariant holds for \(\varPi _j\) = {\(\varPi _{j - 1}\)} \(\cup \) {\(\pi _{i_j}\)} and \(C_j\) = {\(C_{j - 1}\)} \(\cup \) {\(c_{k_j}\)}. This completes the proof of the induction step.
For \(j = l\), \(\varPi _l\) = \(\varPi \), \(C_l\) = C and \(D_u^{+, l}\) = \(D_u^f\). So the invariant with \(j = l\) implies the relation R3.3.\(\square \)
Lemma 4
The function InstallEdge (Algorithm 4) takes as inputs (i) two conflict accesses \(\alpha \), \(\alpha '\), (ii) the set \(\varPi = \varPi _{ws}\) of paths in \(G_{ws}\), (iii) the set \(C = C_{ws}\) of fundamental cycles in \(G_{ws}\), (iv) a sub-domain \(D_u^{i}\) of the domain of \(M_{\langle \alpha , \alpha '\rangle }\); it finds supporting paths or walks which can cover the mapping \(M_{\langle \alpha , \alpha '\rangle }\) either partially or completely over the domain of \(M_{\langle \alpha , \alpha '\rangle }\); it returns an uncovered sub-domain \(D_u^{f} \subseteq D_u^{i}\) of the domain of \(M_{\langle \alpha , \alpha '\rangle }\) such that the following relations hold:
-
R4.1: \(D_u^{f} \subseteq D_u^{i}\),
-
R4.2: \(\forall \overline{i} \in D_u^{i} - D_u^{f}\), either
-
(a) \(\exists \pi \) = \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \in \varPi \) such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha \), \(\alpha '\) \(\prec _f\) \(\alpha _{n, \pi }\) and \(M_{\pi }(\overline{i})\) \(=\) \(M_{\langle \alpha , \alpha '\rangle }(\overline{i})\), or
-
(b) \(\exists \pi \) = \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \) \(\in \) \(\varPi \), \(\exists c = \langle \alpha _{1, c}\), \(\alpha _{2, c}\), \(\ldots \), \(\alpha _{m, c}\rangle \in C\) such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha \), \(\alpha '\) \(\prec _f\) \(\alpha _{n, \pi }\), \(\alpha _{i, \pi }\) = \(\alpha _{j, c}\) for some i, \(1\le i \le n\) and for some j, \(1\le j \le m\), and \(\forall \overline{i}\) \(\in \) \(dom(M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1}) \cap D_u^i\), \((M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1})(\overline{i})\) \(=\) \(M_{\langle \alpha , \alpha '\rangle }(\overline{i})\), where \(\pi _1\) is the prefix \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \) \(\alpha _{i, \pi }\rangle \) of \(\pi \), \(\pi _2\) is the suffix \(\langle \alpha _{i, \pi }\), \(\alpha _{i+1, \pi }\), \(\alpha _{i+ 2, \pi }\), \(\ldots \) \(\alpha _{n, \pi }\rangle \) of \(\pi \), \(c'\) is the permutation \(\langle \alpha _{j, c}\), \(\alpha _{j+1, c}\), \(\ldots \), \(\alpha _{m, c}\), \(\alpha _{1, c}\), \(\ldots \), \(\alpha _{j-1, c}\rangle \) of c and \(k' > 0\).
-
R4.3: \(\forall \overline{i} \in D_u^{f}\), there exist no such paths or walks as stated in relation R4.2(a) and R4.2(b).
Proof
The function InstallEdge invokes in step 1 FindSupportingPath with the 4th parameter \(D_u\) = \(D_u^i\). Let \(D_u^{f_{path}}\) be the value returned by the function FindSupportingPath. From the relation R1.1 of the Lemma 1, \(D_u^{f_{path}}\) \(\subseteq \) \(D_u^i\). Return from the function takes place from step 14 (case (i)) or step 12 (case (ii)) or step 9 (case (iii)). Case (i): step 14 executes with \(D_u^{f_{path}}\) = \(\emptyset \) \(\subseteq \) \(D_u^{i}\). Hence, for this case \(D_u^f\) = \(D_u^{f_{path}}\) \(\subseteq \) \(D_u^{i}\). So relation R4.1 holds. Case (ii): step 12 executes if \(D_u^{f_{path}}\) \(\ne \) \(\emptyset \) (as per the if-condition in step 5). It returns \(D_u^{f}\) = \(D_u^{f_{path}}\) \(\subseteq \) \(D_u^i\). So relation R4.1 holds for this case (iii). Step 9 executes if \(D_u^{f_{path}}\) \(\ne \) \(\emptyset \) as per the if-condition in step 5 and \(\varPi '\) \(\ne \) \(\emptyset \) as per the if-condition in step 6. Before this step, the function FindSupportingWalk has been invoked in step 7 with its 4th parameter \(D_u\) as \(D_u^{f_{path}}\). Let the function FindSupportingWalk return \(D_u^{f_{walk}}\) which is returned in step 9. Therefore, for this case \(D_u^{f}\) = \(D_u^{f_{walk}}\) \(\subseteq \) \(D_u^{f_{path}}\) by relation R3.1 of Lemma 3. Since, \(D_u^{f_{path}}\) \(\subseteq \) \(D_u^i\), therefore \(D_u^{f}\) \(\subseteq \) \(D_u^i\). Hence, R4.1 holds.
For relation R4.2, \(\forall \overline{i}\) \(\in \) \(D_u^i - D_u^f\) is the same as \(\forall \overline{i}\) \(\in \) \(D_u^i - D_u^{f_{walk}}\) = (\(D_u^i - D_u^{f_{path}}\)) \(\cup \) (\(D_u^{f_{path}} - D_u^{f_{walk}}\)). \(\forall \overline{i}\) \(\in \) (\(D_u^i - D_u^{f_{path}}\)), \(\exists \pi = \langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \in \varPi \), such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha \), \(\alpha '\) \(\prec _f\) \(\alpha _{n, \pi }\) and \(M_{\pi }(\overline{i})\) \(=\) \(M_{\langle \alpha , \alpha '\rangle }(\overline{i})\) as per relation R1.2 of Lemma 1. \(\forall \overline{i}\) \(\in \) (\(D_u^{f_{path}} - D_u^{f_{walk}}\)) \(\exists \pi \) = \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \) \(\in \) \(\varPi \), \(\exists c = \langle \alpha _{1, c}\), \(\alpha _{2, c}\), \(\ldots \), \(\alpha _{m, c} \rangle \in C\) such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha \), \(\alpha '\) \(\prec _f\) \(\alpha _{n, \pi }\), \(\alpha _{i, \pi }\) = \(\alpha _{j, c}\) for some i, \(1\le i \le n\) and for some j, \(1\le j \le m\), and \(\forall \overline{i}\) \(\in \) \(dom(M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1}) \cap D_u^i\), \((M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1})(\overline{i})\) \(=\) \(M_{\langle \alpha , \alpha '\rangle }(\overline{i})\), where \(\pi _1\) is the prefix \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \) \(\alpha _{i, \pi }\rangle \) of \(\pi \), \(\pi _2\) is the suffix \(\langle \alpha _{i, \pi }\), \(\alpha _{i+1, \pi }\), \(\ldots \) \(\alpha _{n, \pi }\rangle \) of \(\pi \), \(c'\) is the permutation \(\langle \alpha _{j, c}\), \(\alpha _{j+1, c}\), \(\ldots \), \(\alpha _{m, c}\), \(\alpha _{1, c}\), \(\ldots \), \(\alpha _{j-1, c}\rangle \) of c and \(k' > 0\) as per relation R3.2 of Lemma 3. Hence, relation R4.2 holds.
For relation R4.3, \(\forall \overline{i}\) \(\in \) \(D_u^{f_{path}}\), there exists no such paths as stated in R4.2(a) as per relation R1.3 of Lemma 1. \(\forall \overline{i}\) \(\in \) \(D_u^{f_{walk}}\), there exists no such walks as stated in R4.2(b) as per relation R3.3 of Lemma 3. As \(D_u^{f}\) = \(D_u^{f_{walk}}\) \(\subseteq \) \(D_u^{f_{path}}\) (as shown in Fig. 7), \(\forall \overline{i}\) \(\in \) \(D_u^{f}\), there exist no path or walk as stated in relations R4.2(a) and R4.2(b) and hence relation R4.3 holds.\(\square \)
Theorem 2
(Soundness) For any edge (\(\alpha _1(\overline{i})\), \(\alpha _2(f(\overline{i}))\)), \(\overline{i} \in D_i\), \(\in \) \(E_u\), if Algorithm 3 visits step 23, then there is a dependence from \(\alpha _1(\overline{i})\) to \(\alpha _2(f(\overline{i}))\), \(\overline{i}\) \(\in \) D \(\subseteq \) \(D_i\) and if Algorithm 3 visits step 36, then there is a dependence from \(\alpha _2(f(\overline{i}))\) to \(\alpha _1(\overline{i})\), \(\overline{i}\) \(\in \) \(D'\) \(\subseteq \) \(D_i\).
Proof
Let Algorithm 3 visit step 23; the condition \(D_u-D_u'\) \(\ne \) \(\emptyset \) associated with step 22 is true, where \(D_u\) is the domain value with which InstallEdge was invoked in step 21 and \(D_u'\) is the value returned by the function. Hence in Lemma 4, \(D_u\) = \(D_u^i\) and \(D_u'\) = \(D_u^f\) and the function is called with \(\alpha = \alpha _1\), \(\alpha ' = \alpha _2\), \(\varPi = \varPi _{ws}\) and \(C = C_{ws}\) as arguments. Now, from the output relationship R4.2 of Lemma 4 we can infer that \(\forall \overline{i} \in D_u - D_u'\), we have one of the following two cases—(i) \(\exists \pi \) = \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \in \varPi \) such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha _1\), \(\alpha _2\) \(\prec _f\) \(\alpha _{n, \pi }\) and \(M_{\pi }(\overline{i})\) \(=\) \(M_{\langle \alpha _1, \alpha _2\rangle }(\overline{i})\) = \(f(\overline{i})\); \(\forall \overline{i} \in D_u^{f}\), there exists no such paths, or (ii) \(\exists \pi \) = \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \) \(\in \) \(\varPi \), \(\exists c = \langle \alpha _{1, c}\), \(\alpha _{2, c}\), \(\ldots \), \(\alpha _{m, c}\rangle \in C\) such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha _1\), \(\alpha _2\) \(\prec _f\) \(\alpha _{n, \pi }\), \(\alpha _{i, \pi }\) = \(\alpha _{j, c}\) for some i, \(1\le i \le n\) and for some j, \(1\le j \le m\), and \(\forall \overline{i}\) \(\in \) \(dom(M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1}) \cap D_u^i\), \((M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1})(\overline{i})\) \(=\) \(M_{\langle \alpha _1, \alpha _2\rangle }(\overline{i})\) = \(f(\overline{i})\), where \(\pi _1\) is the prefix \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \) \(\alpha _{i, \pi }\rangle \) of \(\pi \), \(\pi _2\) is the suffix \(\langle \alpha _{i, \pi }\), \(\alpha _{i+1, \pi }\), \(\alpha _{i+ 2, \pi }\), \(\ldots \) \(\alpha _{n, \pi }\rangle \) of \(\pi \), \(c'\) is the permutation \(\langle \alpha _{j, c}\), \(\alpha _{j+1, c}\), \(\ldots \), \(\alpha _{m, c}\), \(\alpha _{1, c}\), \(\ldots \), \(\alpha _{j-1, c}\rangle \) of c and \(k' > 0\). Hence, \(\alpha _{1, \pi }(\overline{i})\) \(\prec _f\) \(\alpha _1(\overline{i})\) and \(\alpha _2(f(\overline{i}))\) \(\prec _f\) \(\alpha _{n, \pi }(f(\overline{i}))\). The existence of path in \(G_{ws}\) from \(\alpha _{1, \pi }(\overline{i})\) to \(\alpha _{n, \pi }(f(\overline{i}))\) establishes that \(\alpha _{n, \pi }(f(\overline{i}))\) \(\prec \) \(\alpha _{1, \pi }(\overline{i})\). Hence, \(\alpha _2(f(\overline{i}))\) \(\prec \) \(\alpha _1(\overline{i})\) and there is a dependence from \(\alpha _1(\overline{i})\) to \(\alpha _2(f(\overline{i}))\) for \(\overline{i}\) \(\in \) D = \(D_u-D_u'\) \(\subseteq \) \(D_i\). The similar argument applies for case (ii). Hence, \(\forall \overline{i} \in D_u - D_u'\), \(\alpha _1(\overline{i})\) depends on \(\alpha _2(f(\overline{i}))\).
Let Algorithm 3 visit step 36; the condition \(D_u' \ne \emptyset \) associated with step 24 is true and the condition \(D_u''' \ne \emptyset \) associated with 30 is false, where \(D_u'\) is the domain value which is returned from the function InstallEdge, invoked in step 21, \(D_u'' = \{f^{-1}(\overline{i})|\overline{i} \in D_u'\}\) is the value passed to the invocation of the same function in step 29 and \(D_u'''\) is the domain value returned by the invocation. Hence, in Lemma 4, \(D_u''\) = \(D_u^i\) and \(D_u'''\) = \(D_u^f\) and the function is called with \(\alpha = \alpha _2\), \(\alpha ' = \alpha _1\), \(\varPi = \varPi _{ws}\) and \(C = C_{ws}\) as arguments for the invocation of the function in step 29. As per Lemma 4 we can infer that \(\forall \overline{i} \in D_u''\), we have one of the following two cases—(i) \(\exists \pi \) = \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \in \varPi \) such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha _2\), \(\alpha _1\) \(\prec _f\) \(\alpha _{n, \pi }\) and \(M_{\pi }(\overline{i})\) \(=\) \(M_{\langle \alpha _2, \alpha _1\rangle }(\overline{i})\) = \(f^{-1}(\overline{i})\); or (ii) \(\exists \pi \) = \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \) \(\in \) \(\varPi \), \(\exists c = \langle \alpha _{1, c}\), \(\alpha _{2, c}\), \(\ldots \), \(\alpha _{m, c}\rangle \in C\) such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha _2\), \(\alpha _1\) \(\prec _f\) \(\alpha _{n, \pi }\), \(\alpha _{i, \pi }\) = \(\alpha _{j, c}\) for some i, \(1\le i \le n\) and for some j, \(1\le j \le m\), and \(\forall \overline{i}\) \(\in \) \(dom(M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1}) \cap D_u''\), \((M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1})(\overline{i})\) \(=\) \(M_{\langle \alpha _2, \alpha _1\rangle }(\overline{i})\) = \(f^{-1}(\overline{i})\), where \(\pi _1\) is the prefix \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \) \(\alpha _{i, \pi }\rangle \) of \(\pi \), \(\pi _2\) is the suffix \(\langle \alpha _{i, \pi }\), \(\alpha _{i+1, \pi }\), \(\alpha _{i+ 2, \pi }\), \(\ldots \) \(\alpha _{n, \pi }\rangle \) of \(\pi \), \(c'\) is the permutation \(\langle \alpha _{j, c}\), \(\alpha _{j+1, c}\), \(\ldots \), \(\alpha _{m, c}\), \(\alpha _{1, c}\), \(\ldots \), \(\alpha _{j-1, c}\rangle \) of c and \(k' > 0\). By the similar argument given above, \(\alpha _2(\overline{i})\) depends on \(\alpha _1(f^{-1}(\overline{i}))\) where \(\overline{i} \in D_u''\) which can be similarly stated as \(\alpha _2(f(\overline{i}))\) depends on \(\alpha _1(\overline{i})\) where \(\overline{i} \in D' = D_u' \subseteq D_i\) \((D_u' = \{f(\overline{i}) | \overline{i} \in D_u''\}\) as per step 27).\(\square \)
Theorem 3
(Completeness) For any edge (\(\alpha _1(\overline{i})\), \(\alpha _2(f(\overline{i}))\)), \(\overline{i} \in D_i\), \(\in \) \(E_u\), if there is a dependence from \(\alpha _1(\overline{i})\) to \(\alpha _2(f(\overline{i}))\), \(\overline{i}\) \(\in \) D \(\subseteq \) \(D_i\), then Algorithm 3 visits step 23 and if there is a dependence from \(\alpha _2(f(\overline{i}))\) to \(\alpha _1(\overline{i})\), \(\overline{i}\) \(\in \) \(D'\) \(\subseteq \) \(D_i\), then Algorithm 3 visits step 36.
Proof
Let Algorithm 3 do not visit step 23; hence, either the loop condition e = (\(\alpha _1(\overline{i})\), \(\alpha _2(f(\overline{i}))\)) is true and the condition \(D_u-D_u'\) \(\ne \) \(\emptyset \) associated with step 22 is false or the loop condition is false, where \(D_u\) is the domain value with which InstallEdge was invoked in step 21 and \(D_u'\) is the value returned by the function. Consider the situation when the loop condition is true and the condition associated with step 22 is false. Hence, in Lemma 4, \(D_u\) = \(D_u^i\) and \(D_u'\) = \(D_u^f\) and the function is called with \(\alpha = \alpha _1\), \(\alpha ' = \alpha _2\), \(\varPi = \varPi _{ws}\) and \(C = C_{ws}\) as arguments. Now, \(D_u-D_u'\) \(=\) \(\emptyset \); the relationship R4.2 of Lemma 4 is vacuously true. As per relation R4.3 of Lemma 4, we have both the following situations true. (a) \(\forall \overline{i} \in D_u'\), there exists no paths of the form \(\pi \) = \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi } \rangle \in \varPi \) such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha _1\), \(\alpha _2\) \(\prec _f\) \(\alpha _{n, \pi }\) and \(M_{\pi }(\overline{i})\) \(=\) \(M_{\langle \alpha _1, \alpha _2\rangle }(\overline{i})\) = \(f(\overline{i})\), and (b) \(\forall \overline{i} \in D_u'\), there exists no walks of the form \(\pi _2\) \(\circ \) \(c'^{k'}\) \(\circ \) \(\pi _1\) where \(\pi \) = \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \) \(\in \) \(\varPi \), \(c = \langle \alpha _{1, c}\), \(\alpha _{2, c}\), \(\ldots \), \(\alpha _{m, c}\rangle \in C\) such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha _1\), \(\alpha _2\) \(\prec _f\) \(\alpha _{n, \pi }\), \(\alpha _{i, \pi }\) = \(\alpha _{j, c}\) for some i, \(1\le i \le n\) and for some j, \(1\le j \le m\), and \(\forall \overline{i}\) \(\in \) \(dom(M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1}) \cap D_u^i\), \((M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1})(\overline{i})\) \(=\) \(M_{\langle \alpha _1, \alpha _2\rangle }(\overline{i})\) = \(f(\overline{i})\), here \(\pi _1\) is the prefix \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \) \(\alpha _{i, \pi }\rangle \) of \(\pi \), \(\pi _2\) is the suffix \(\langle \alpha _{i, \pi }\), \(\alpha _{i+1, \pi }\), \(\alpha _{i+ 2, \pi }\), \(\ldots \) \(\alpha _{n, \pi }\rangle \) of \(\pi \), \(c'\) is the permutation \(\langle \alpha _{j, c}\), \(\alpha _{j+1, c}\), \(\ldots \), \(\alpha _{m, c}\), \(\alpha _{1, c}\), \(\ldots \), \(\alpha _{j-1, c}\rangle \) of c and \(k' > 0\). In other words, there does not exist any path or walk of the form \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{m, \pi }\rangle \) in \(G_{ws}\) such that \(\alpha _{1, \pi }(\overline{i})\) \(\prec _f\) \(\alpha _1(\overline{i})\) and \(\alpha _2(f(\overline{i}))\) \(\prec _f\) \(\alpha _{m, \pi } (f(\overline{i}))\). We know that if \(\alpha _1(\overline{i})\) and \(\alpha _2(f(\overline{i}))\) execute in two different threads, then \(\alpha _1(\overline{i})\) always executes after \(\alpha _2(f(\overline{i}))\) if and only if there exists any path or walk of the form \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{m, \pi }\rangle \) in \(G_{ws}\) such that \(\alpha _{1, \pi }(\overline{i})\) \(\prec _f\) \(\alpha _1(\overline{i})\) and \(\alpha _2(f(\overline{i}))\) \(\prec _f\) \(\alpha _{m, \pi } (f(\overline{i}))\). We can infer that \(\alpha _1(\overline{i})\) does not execute after \(\alpha _2(f(\overline{i}))\), \(\overline{i} \in D\) \(=\) \(D_u\) \(\subseteq \) \(D_i\); hence, \(\alpha _1(\overline{i})\) does not depend on \(\alpha _2(f(\overline{i}))\), \(\overline{i} \in D\) \(=\) \(D_u\) \(\subseteq \) \(D_i\).
Let Algorithm 3 do not visit step 36; hence, either the loop condition e = (\(\alpha _1(\overline{i})\), \(\alpha _2(f(\overline{i}))\)) is true and the condition \(D_u'''\) \(\ne \) \(\emptyset \) associated with step 30 is false or the loop condition is false, where \(D_u''\) = {\(f^{-1}(\overline{i} )\) | \(\overline{i} \in D_u'\)} is the domain value with which InstallEdge was invoked in step 29 and \(D_u'''\) is the value returned by the function. Consider the situation when the loop condition is true and the condition associated with step 30 is false. Hence, in Lemma 4, \(D_u''\) = \(D_u^i\) and \(D_u'''\) = \(D_u^f\) and the function is called with \(\alpha = \alpha _2\), \(\alpha ' = \alpha _1\), \(\varPi = \varPi _{ws}\) and \(C = C_{ws}\) as arguments. Now, \(D_u'''\) \(\ne \) \(\emptyset \). As per relation R4.3 of Lemma 4, we have both the following situations true. (a) \(\forall \overline{i} \in D_u'''\), there exists no paths of the form \(\pi \) = \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi } \rangle \in \varPi \) such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha _2\), \(\alpha _1\) \(\prec _f\) \(\alpha _{n, \pi }\) and \(M_{\pi }(\overline{i})\) \(=\) \(M_{\langle \alpha _1, \alpha _2\rangle }(\overline{i})\) = \(f^{-1}(\overline{i})\), and (b) \(\forall \overline{i} \in D_u'''\), there exists no walks of the form \(\pi _2\) \(\circ \) \(c'^{k'}\) \(\circ \) \(\pi _1\) where \(\pi \) = \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \) \(\in \) \(\varPi \), \(c = \langle \alpha _{1, c}\), \(\alpha _{2, c}\), \(\ldots \), \(\alpha _{m, c}\rangle \in C\) such that \(\alpha _{1, \pi }\) \(\prec _f\) \(\alpha _2\), \(\alpha _1\) \(\prec _f\) \(\alpha _{n, \pi }\), \(\alpha _{i, \pi }\) = \(\alpha _{j, c}\) for some i, \(1\le i \le n\) and for some j, \(1\le j \le m\), and \(\forall \overline{i}\) \(\in \) \(dom(M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1}) \cap D_u^i\), \((M_{\pi _2}\) \(\circ \) \(M_{c'}^{k'}\) \(\circ \) \(M_{\pi _1})(\overline{i})\) \(=\) \(M_{\langle \alpha _2, \alpha _1\rangle }(\overline{i})\) = \(f^{-1}(\overline{i})\), here \(\pi _1\) is the prefix \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \) \(\alpha _{i, \pi }\rangle \) of \(\pi \), \(\pi _2\) is the suffix \(\langle \alpha _{i, \pi }\), \(\alpha _{i+1, \pi }\), \(\alpha _{i+ 2, \pi }\), \(\ldots \) \(\alpha _{n, \pi }\rangle \) of \(\pi \), \(c'\) is the permutation \(\langle \alpha _{j, c}\), \(\alpha _{j+1, c}\), \(\ldots \), \(\alpha _{m, c}\), \(\alpha _{1, c}\), \(\ldots \), \(\alpha _{j-1, c}\rangle \) of c and \(k' > 0\). In other words, there does not exist any path or walk of the form \(\langle \alpha _{1, \pi }\), \(\alpha _{2, \pi }\), \(\ldots \), \(\alpha _{n, \pi }\rangle \) in \(G_{ws}\) such that \(\alpha _{1, \pi }(\overline{i})\) \(\prec _f\) \(\alpha _2(\overline{i})\) and \(\alpha _1(f^{-1}(\overline{i}))\) \(\prec _f\) \(\alpha _{n, \pi } (f^{-1}(\overline{i}))\), \(\overline{i} \in D_u'' - D_u'''\). Hence, we can infer that \(\alpha _2(\overline{i})\) does not execute after \(\alpha _1(f^{-1}(\overline{i}))\), \(\overline{i} \in D_u''\) \(\subseteq \) \(D_i\); hence, \(\alpha _2(f(\overline{i}))\) does not depend on \(\alpha _1(\overline{i})\), \(\overline{i} \in D'\) \(=\) \(D_u'\) \(\subseteq \) \(D_i\) \((D_u' = \{f(\overline{i}) | \overline{i} \in D_u''\}\) as per step 27).
If the loop condition i.e., e = (\(\alpha _1\), \(\alpha _2\)) \(\not \in \) \(E_u\), then \(\alpha _1\) and \(\alpha _2\) are not conflict accesses. In this situation, neither \(\alpha _1(\overline{i})\) depends on \(\alpha _2(f(\overline{i}))\), \(\overline{i}\) \(\in \) D \(\subseteq \) \(D_i\), nor \(\alpha _2(f(\overline{i}))\) depends on \(\alpha _1(\overline{i})\), \(\overline{i}\) \(\in \) \(D'\) \(\subseteq \) \(D_i\).\(\square \)
Rights and permissions
About this article
Cite this article
Dutta, S., Sarkar, D. & Rawat, A. Synchronization Validation for Cross-Thread Dependences in Parallel Programs. Int J Parallel Prog 45, 1326–1365 (2017). https://doi.org/10.1007/s10766-016-0467-9
Received:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s10766-016-0467-9