Clones in Logic Programs and How to Detect Them

Céline Dandois, Wim Vanhoof

Research output: Contribution in Book/Catalog/Report/Conference proceedingConference contribution


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.
Original languageEnglish
Title of host publicationLogic-Based Program Synthesis and Transformation
Subtitle of host publication21st International Symposium, LOPSTR 2011, Odense, Denmark, July 18-20, 2011. Revised Selected Papers
Publication statusPublished - 2012


  • logic programming languages
  • code clone
  • code duplication
  • clone detection algorithm


Dive into the research topics of 'Clones in Logic Programs and How to Detect Them'. Together they form a unique fingerprint.

Cite this