2004/06/16 by Tom Schrijvers, Alexander Serebrenik, Schrijvers, Tom +1
Computer Science · #D.1.6 #D.2.7 #FOS: Computer and information sciences #Logic, programming, and type systems #Programming Languages (cs.PL) #Software Engineering (cs.SE) #Software Engineering Research #Software Testing and Debugging Techniques #cs.PL #cs.SE
paper · pdf · doi:10.48550/arxiv.cs/0406026
To appear in ICLP 2004
arxiv created 2004/06/16 · openalex publication_date 2004/06/16 · arxiv updated 2009/12/01 · openalex created_date 2025/10/10 · openalex updated_date 2026/07/28
Refactoring is an established technique from the OO-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. Also the discrepancy between intended and operational semantics in Prolog is 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. Our main conclusion is that refactoring is not only a viable technique in Prolog but also a rather desirable one.