In this paper, we propose a theoretical framework that allows us to capture, by program analysis, the notion of code clone in the context of logic programming. Informally, two code fragments are considered as cloned if they implement the same functionality. Clone detection can be advantageous from a software engineering viewpoint, as the presence of code clones inside a program reveals redundancy, broadly considered a “bad smell”. In the paper, we present a detailed definition of a clone in a logic program and provide an efficient detection algorithm able to identify an important subclass of code clones that could be used for various applications such as program refactoring and plagiarism recognition. Our clone detection algorithm is not tied to a particular logic programming language, and can easily be instantiated for different such languages.
|Title of host publication||Logic-Based Program Synthesis and Transformation|
|Subtitle of host publication||21st International Symposium, LOPSTR 2011, Odense, Denmark, July 18-20, 2011. Revised Selected Papers|
|Publication status||Published - 2012|
- logic programming languages
- code clone
- code duplication
- clone detection algorithm