Rémy Haemmerlé, François Fages:
Modules for Prolog Revisited.

Complete Text [
.pdf, 224KB]
In: Proceedings of 22nd International Conference on Logic Programming (ICLP06), Seattle, WA, USA (17th - 20th August 2006), LNCS 4079, 41-55, August 2006
© Springer

Module systems are an essential feature of programming languages as they facilitate the re-use of existing code and the development of general purpose libraries. Unfortunately, there has been no consensual module system for Prolog, hence no strong development of libraries, in sharp contrast to what exists in Java for instance. One difficulty comes from the call predicate which interferes with the protection of the code, an essential task of a module system. By distinguishing the called module code protection from the calling module code protection, we review the existing syntactic module systems for Prolog. We show that no module system ensures both forms of code protection, with the noticeable exceptions of Ciao-Prolog and XSB. We then present a formal module system for logic programs with calls and closures, define its operational semantics and formally prove the code protection property. Interestingly, we also provide an equivalent logical semantics of modular logic programs without calls nor closures, which shows how they can be translated into constraint logic programs over a simple module constraint system.



	author = {R\'{e}my Haemmerl\'{e} and Fran\c{c}ois Fages},
	title = {Modules for Prolog Revisited},
	booktitle = {Proceedings of 22nd International Conference on Logic Programming, Seattle, WA, USA (17th--20th August 2006)},
	year = {2006},
	volume = {4079},
	series = {LNCS},
	pages = {41--55},
	url = {}