Towards a Normal Form for Mercury Programs

  • Authors:
  • François Degrave;Wim Vanhoof

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

  • Venue:
  • Logic-Based Program Synthesis and Transformation
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

In this work we define a program transformation that normalises a Mercury program by reordering clauses, body goals, and predicate arguments. The transformation, which preserves the well-modedness and determinism characteristics of the program, aims at reducing the complexity of performing a search for duplicated or similar code fragments between programs. In previous work, we have defined an analysis that searches for such duplicated functionality basically by pairwise comparing atoms and goals. While feasible in theory, the number of permutations to perform during the search renders it hard if not impossible to use in practice. We conjecture that the transformation to normal form, defined in this work, allows to substantially reduce the number of permutations, and hence the complexity of the search.