Hostname: page-component-74656f9884-npj9w Total loading time: 0 Render date: 2026-11-09T05:56:38.477Z Has data issue: false hasContentIssue false

Improving Prolog programs: Refactoring for Prolog

Published online by Cambridge University Press:  01 March 2008

ALEXANDER SEREBRENIK
Affiliation:
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)
TOM SCHRIJVERS
Affiliation:
Department of Computer Science, K.U. Leuven, Celestijnenlaan 200A, B-3001, Heverlee, Belgium (e-mail: Tom.Schrijvers@cs.kuleuven.be)
BART DEMOEN
Affiliation:
Department of Computer Science, K.U. Leuven, Celestijnenlaan 200A, B-3001, Heverlee, Belgium (e-mail: Bart.Demoen@cs.kuleuven.be)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

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.

Information

Type
Technical Note
Copyright
Copyright © Cambridge University Press 2007