Closures are Needed for Closed Module Systems - Inria - Institut national de recherche en sciences et technologies du numérique Access content directly
Reports (Research Report) Year : 2005

Closures are Needed for Closed Module Systems

Francois Fages


In a classical paper of D.H.D. Warren, the higher-order extensions of Prolog were questioned as they do not really provide more expressive power than meta-programming predicates. Without disputing this argumentation in the context of a logic programming system without modules, we show that the situation is different in a closed module system. By closed we mean the property that the module system is able to prevent any call to the private predicates of a module from the other modules, in particular through meta-programming predicates. We show that this property necessitates to distinguish the execution of a term (meta-programming predicate call) from the execution of a closure (higher order). We propose a module system for Constraint Logic Programming with a notion of closures inspired from Linear Concurrent Constraint programming. This module system is quite simple and pretty independent of a precise language (it is currently implemented for GNU-Prolog). Although this system can be seen as a simple layer of syntactic sugar, it does provide a discipline for naming predicates and hiding code, making possible the development of libraries and facilitating the safe re-use of existing code. Furthermore we provide the module system with logical and operational semantics. This formal setting is used in the paper to compare our approach to the other module systems proposed for Prolog, which generally do not ensure full code protection.
Fichier principal
Vignette du fichier
RR-5575.pdf (273.27 Ko) Télécharger le fichier

Dates and versions

inria-00070431 , version 1 (19-05-2006)


  • HAL Id : inria-00070431 , version 1


Rémy Haemmerlé, Francois Fages. Closures are Needed for Closed Module Systems. [Research Report] RR-5575, INRIA. 2005, pp.19. ⟨inria-00070431⟩
104 View
151 Download


Gmail Facebook Twitter LinkedIn More