# Review of Code Similarity and Plagiarism Detection Research Studies
## Appendix A
### Program Dependence Graph  
A program dependence graph (PDG) is a graph representing the data and control dependencies of codes that displays the semantic relationships between code parts. Starting from the entry point of the code, we draw the edges from one code part A to another code part B based on the code using dependencies. Figure 11 presents the PDG obtained by analyzing the code in Figure 11. Each node corresponds to one sentence except for the entry node, which indicates the starting point of the code. Among the edges, those marked with T represent control dependencies, meaning that if the condition is true, the program control moves through the corresponding edge. For example, the first three lines of the code are always executed after execution starts, unless an exception occurs; therefore, the entry node, which indicates code entry, and the trunk line, which indicates execution if true, are connected. Similarly, the node indicating if(a >= 0) in the third line and the node corresponding to the fourth line, which is executed only when a >= 0 is true, are also connected. In the node representing sum = a + b in line 5, the value of sum in this node depends on the values of a, b; therefore, the values of these two variables can change. These three nodes are connected by an edge, which indicates a data dependency. As the PDG expresses semantic relationships regardless of the grammatical structure of the code, changes in the structure of the code do not affect the PDG if the meaning is maintained. For example, PDG appears the same as in Figure 11, even if read() in the first two lines of Figure 11. code is replaced with a different variable or integer literal, or sum = a + b and print(sum) in lines 5-6 are changed to avg = (a + b)/2 and print(avg). Because analyses such as program slicing are required to obtain a PDG from the code, it is more expensive than obtaining an abstract syntax tree based on lexical analysis or grammar using simple pattern matching. In addition, compared to displaying code as a list of tokens or expressing a grammatical structure in the form of a tree, displaying it as a graph is more difficult and has higher costs. * [PERSON] et al. (2019) [PERSON]; [PERSON]; [PERSON] Source-code Similarity Detection and Detection Tools Used in Academia: A Systematic Review. _ACM Trans. Comput. Educ._**2019**, _19_, _27_. * [PERSON] et al. (2020) [PERSON]; [PERSON]; [PERSON]; [PERSON]; [PERSON] [PERSON]; [PERSON]; [PERSON] Choosing Code Segments to Exclude from Code Similarity Detection. In Proceedings of the TIGCSE-WGR'20: Working Group Reports on Innovation and Technology in Computer Science Education, Trondheim, Norway, 17-18 June 2020. * [PERSON] et al. (2019) [PERSON]; [PERSON]; [PERSON]; [PERSON] Source Code Plagiarism Detection in Academia with Information Retrieval: Dataset and the Observation. _Inform. Educ._**2019**, _18_, 321-344. * [PERSON] and [PERSON] (2017) [PERSON]; [PERSON] Plagiarism detection in learning management system. In Proceedings of the 2017 8 th International Conference on Information Technology (ICIT), Amman, Jordan, 17-18 May 2017. * [PERSON] (1993) [PERSON], B.S. A program for identifying duplicated code. _Comput. Sci. Stat._**1993**, 1-9. * [PERSON] (1993) [PERSON] Identifying redundancy in source code using fingerprints. In Proceedings of the 1993 Conference of the Centre for Advanced Studies on Collaborative Research: Software Engineering, Toronto, ON, Canada, 24-28 October 1993; Volume 1, pp. 171-183. * [PERSON] (1994) [PERSON] Substring Matching for Clone Detection and Change Tracking. _ICSM_**1994**, 120-126. * [PERSON] (1999) [PERSON], B.S. Parameterized diff. In Proceedings of the Tenth Annual ACM-SIAM Symposium on Discrete Algorithms, Baltimore, MD, USA, 17-19 January 1999. * [PERSON] et al. (1999) [PERSON]; [PERSON] [PERSON]; [PERSON] A language independent approach for detecting duplicated code. In Proceedings of the IEEE International Conference on Software Maintenance--1999 (ICSM'99), \"Software Maintenance for Business Change\" (Cat. No.