CJO - Abstract - Improving Prolog programs: Refactoring for Prolog

Cambridge Journals Online

Cambridge Journals Online
Theory and Practice of Logic Programming (2008), 8 : 201-215 Cambridge University Press
doi:10.1017/S1471068407003134 (About doi)
Published online by Cambridge University Press 23 May 2007
Cambridge Journals Online - CUP Full-Text Page
Theory and Practice of Logic Programming (2008), 8:201-215 Cambridge University Press
Copyright © Cambridge University Press 2007
doi:10.1017/S1471068407003134

Technical Note

Improving Prolog programs: Refactoring for Prolog


ALEXANDER SEREBRENIKa1, TOM SCHRIJVERSa21 and BART DEMOENa3

a1 Laboratory of Quality of Software (LaQuSo), T.U. Eindhoven, HG 5.91, Den Dolech 2, P.O. Box 513, 5600 MB Eindhoven, The Netherlands (e-mail: A.Serebrenik@tue.nl)
a2 Department of Computer Science, K.U. Leuven, Celestijnenlaan 200A, B-3001, Heverlee, Belgium (e-mail: Tom.Schrijvers@cs.kuleuven.be)
a3 Department of Computer Science, K.U. Leuven, Celestijnenlaan 200A, B-3001, Heverlee, Belgium (e-mail: Bart.Demoen@cs.kuleuven.be)
Article author query
serebrenik a Google Scholar
schrijvers t Google Scholar
demoen b Google Scholar

Abstract

Refactoring is an established technique from the object-oriented (OO) programming community to restructure code: it aims at improving software readability, maintainability, and extensibility. Although refactoring is not tied to the OO-paradigm in particular, its ideas have not been applied to logic programming until now. This paper applies the ideas of refactoring to Prolog programs. A catalogue is presented listing refactorings classified according to scope. Some of the refactorings have been adapted from the OO-paradigm, while others have been specifically designed for Prolog. The discrepancy between intended and operational semantics in Prolog is also addressed by some of the refactorings. In addition, ViPReSS, a semi-automatic refactoring browser, is discussed and the experience with applying ViPReSS to a large Prolog legacy system is reported. The main conclusion is that refactoring is both a viable technique in Prolog and a rather desirable one.

(Received December 24 2004)

(Revised August 28 2005)

(Revised September 20 2006)

(Accepted February 12 2007)

Key Words: refactoring; software engineering; program transformation; programming environments; tools

Footnotes

1 Research Assistant of the Fund for Scientific Research-Flanders (Belgium) (F.W.O.-Vlaanderen).


Cambridge University Press