Implementing a notion of modules in the logic programming language λProlog

Keehang Kwon, Gopalan Nadathur, Debra Sue Wilson

Research output: Chapter in Book/Report/Conference proceedingConference contribution

6 Scopus citations

Abstract

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 languageEnglish (US)
Title of host publicationExtensions of Logic Programming - 3rd International Workshop, ELP 1992, Proceedings
EditorsEvelina Lamina, Paola Mello
PublisherSpringer Verlag
Pages359-393
Number of pages35
ISBN (Print)9783540564546
DOIs
StatePublished - 1993
Event3rd International Workshop on Extensions of Logic Programming, ELP 1992 - Bologna, Italy
Duration: Feb 26 1992Feb 28 1992

Publication series

NameLecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics)
Volume660 LNAI
ISSN (Print)0302-9743
ISSN (Electronic)1611-3349

Other

Other3rd International Workshop on Extensions of Logic Programming, ELP 1992
Country/TerritoryItaly
CityBologna
Period2/26/922/28/92

Fingerprint

Dive into the research topics of 'Implementing a notion of modules in the logic programming language λProlog'. Together they form a unique fingerprint.

Cite this