Clones in logic programs and how to detect them

  • Authors:
  • Céline Dandois;Wim Vanhoof

  • Affiliations:
  • Faculty of Computer Science, University of Namur, Namur, Belgium;Faculty of Computer Science, University of Namur, Namur, Belgium

  • Venue:
  • LOPSTR'11 Proceedings of the 21st international conference on Logic-Based Program Synthesis and Transformation
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

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.