Improving Prolog Programs: Refactoring for Prolog
Tom Schrijvers, Alexander Serebrenik

TL;DR
This paper introduces refactoring techniques tailored for Prolog programs, adapting ideas from object-oriented programming to improve code quality and address semantic discrepancies, supported by a semi-automatic tool and practical application.
Contribution
It presents a catalog of Prolog-specific refactorings, including adaptations from OO paradigms and addressing Prolog semantics, along with a semi-automatic refactoring tool and case study.
Findings
Refactoring improves Prolog code readability and maintainability.
A semi-automatic refactoring tool, ViPReSS, is effective for large legacy systems.
Refactoring is a viable and beneficial technique for Prolog programming.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsSoftware Engineering Research · Software Testing and Debugging Techniques · Logic, programming, and type systems
