arXivDaily arXiv每日学术速递 周一至周五更新
北美退伍军人节(Veterans Day),12 日无更新
arXiv cs/0702083cs.SE
收藏

改进Prolog程序:重构Prolog

Improving Prolog programs: Refactoring for Prolog

Alexander Serebrenik, Tom Schrijvers, Bart Demoen

摘要:

重构是面向对象(OO)编程社区的一项既定技术,用于重构代码:它旨在提高软件的可读性、可维护性和可扩展性。虽然重构并不特别与OO范式相联系,但它的思想直到现在还没有应用到逻辑编程中。本文将重构思想应用于Prolog程序。一个目录列出了根据范围分类的重构。一些重构是从OO范式改编而来的,而另一些则是专门为Prolog设计的。Prolog中的预期语义和操作语义之间的差异也通过一些重构来解决。此外,ViPReSS,一个半自动重构浏览器,进行了讨论,并报告了将ViPReSS应用于大型Prolog遗留系统的经验。主要结论是重构在Prolog中既是一种可行的技术,也是一种相当可取的技术。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑