Hostname: page-component-89b8bd64d-mmrw7 Total loading time: 0 Render date: 2026-05-08T03:29:40.773Z 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)

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.

Information

Type
Technical Note
Copyright
Copyright © Cambridge University Press 2007

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

Article purchase

Temporarily unavailable