A refinement of import/export declarations in modular logic programming and its semantics
Encapsulation constructs with import/export declarations is the structuring facility offered in most commercial Prolog systems. However, real-life applications have shown to require a finer information exchange between encapsulated pieces of code. In this paper, a refinement of import/export declarations for modules of logic programs is presented. This offers a stricter form of communication between the modules and a larger variety of visibility states of their predicates, the standard approaches being special cases of it. The semantics of this module system has been examined and model-theoretic, fixpoint and operational ones are given and have been proved to be equivalent. Instead of using other logics, all these semantics extend the ones of Horn clause logic using concepts commonly used in it. In addition, the module system has been naturally transformed to Horn clause logic exploiting the distinction of the predicates within a module according to the interface declarations of this module. A form of equivalence with the other semantics of the system is given. In addition, the employed transformation has provided us with a basis for a preprocessor based implementation of the module system.