Issues concerning the implementation of a notion of modules in the higher-order logic programming language λProlog are examined. A program in this language is a composite of type declarations and procedure definitions. The module construct that is considered permits large collections of such declarations and definitions to be decomposed into smaller units. Mechanisms are provided for controlling the interaction of these units and for restricting the visibility of names used within any unit. The typical interaction between modules has both a static and a dynamic nature. The parsing of expressions in a module might require declarations in a module that it interacts with, and this information must be available during compilation. Procedure definitions within a module might utilize procedures presented in other modules and support must be provided for making the appropriate invocation during execution. Our concern here is largely with the dynamic aspects of module interaction. We describe a method for compiling each module into an independent fragment of code. Static interactions prevent the compilation of interacting modules from being completely decoupled. However, using the idea of an interface definition presented here, a fair degree of independence can be achieved even at this level. The dynamic semantics of the module construct involve enhancing existing program contexts with the procedures defined in particular modules. A method is presented for achieving this effect through a linking process applied to the compiled code generated for each module. A direct implementation of the dynamic semantics leads to considerable redundancy in search. We present a way in which this redundancy can be controlled, prove the correctness of our approach and describe run-time structures for incorporating this idea into the overall implementation.
|Original language||English (US)|
|Title of host publication||Extensions of Logic Programming - 3rd International Workshop, ELP 1992, Proceedings|
|Editors||Evelina Lamina, Paola Mello|
|Number of pages||35|
|State||Published - 1993|
|Event||3rd International Workshop on Extensions of Logic Programming, ELP 1992 - Bologna, Italy|
Duration: Feb 26 1992 → Feb 28 1992
|Name||Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)|
|Other||3rd International Workshop on Extensions of Logic Programming, ELP 1992|
|Period||2/26/92 → 2/28/92|
Bibliographical notePublisher Copyright:
© Springer-Verlag Berlin Heidelberg 1993.