Abstract
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.
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
A. Brogi. Program Composition in Computational Logic. PhD thesis, Università di Pisa, 1993.
A. Brogi, E. Lamma, and P. Mello. A general framework for structuring logic programs. Technical Report 4/1, CNR Progetto Finalizzato Sistemi Informatici e Calcolo Parallelo, 1990.
A. Brogi, E. Lamma, and P. Mello. Composing open logic programs. Journal of Logic and Computation, 3(91–11:4):1–25, 1992.
A. Brogi, E. Lamma, and P. Mello. Compositional model-theoretic semantics for logic programs. New Generation Computing, 11:1–21, 1992.
A. Brogi, P. Mancarella, D. Pedreschi, and F. Turini. Composition operators for logic theories. In J. W. Lloyd, editor, Proceedings of the Computational Logic Symposium, pages 117–134, November 1990.
M. Bugliesi. A declarative view of inheritance in logic programming. In Joint International Conference and Symposium on Logic Programming, pages 112–127, 1992.
M. Bugliesi, E. Lamma, and P. Mello. Modularity in logic programming. Journal of Logic Programming, 19, 20:443–502, 1994.
W. F. Clocksin and C. S. Mellish. Programming in Prolog. Springer-Verlag, second edition, 1984.
R. Dietrich. A preprocessor based module system for Prolog. In TAPSOFT'89 International Joint Conference on Theory and Practice in Software Development, volume 2, pages 126–139, 1989.
ECL iPSe: User Manual, March 1993.
H. Gaifman and E. Shapiro. Fully abstract compositional semantics for logic programs. In 6th Conference on Principles of Programming Languages, pages 134–142, 1989.
I. Karali and C. Halatsis. The semantics of a module support for logic programming. Technical report, Department of Informatics, University of Athens, 1993.
I. Karali, E. Pelecanos, and C. Halatsis. A versatile module system for Prolog mapped to flat Prolog. In ACM Symposium on Applied Computing, pages 578–585, 1993.
J. W. Lloyd. Foundations of Logic Programming. Springer-Verlag, 1987.
P. Mancarella and D. Pedreschi. An algebra for logic programs. In 5th International Conference in Logic Programming, pages 1006–1023, 1988.
D. Miller. A theory of modules for logic programming. In Proceedings of the 1986 Symposium on Logic Programming, pages 106–114, 1986.
L. Monteiro and A. Porto. Contextual logic programming. In 6th International Conference in Logic Programming, pages 284–299, 1989.
L. Monteiro and A. Porto. A transformational view of inheritance in logic programming. In 7th International Conference in Logic Programming, pages 481–494, 1990.
Y. Moscowitz and E. Shapiro. Lexical logic programs. In 8th International Symposium in Logic Programming, pages 349–363, 1991.
R. O'Keefe. Towards an algebra for constructing logic programs. In IEEE Symposium on Logic Programming, pages 152–160, 1985.
D. T. Sannella and L. A. Wallen. A calculus for the construction of modular Prolog programs. Journal of Logic Programming, 12(1):147–177, January 1992.
L. Sterling and E. Shapiro. The Art of Prolog. MIT Press, 1986.
M. Van Emden and A. Kowalski. The semantics of predicate logic as a programming language. Journal of the Association for Computing Machinery, 23:733–742, 1976.
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 1995 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Karali, I., Halatsis, C. (1995). A refinement of import/export declarations in modular logic programming and its semantics. In: Mosses, P.D., Nielsen, M., Schwartzbach, M.I. (eds) TAPSOFT '95: Theory and Practice of Software Development. CAAP 1995. Lecture Notes in Computer Science, vol 915. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-59293-8_215
Download citation
DOI: https://doi.org/10.1007/3-540-59293-8_215
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-59293-8
Online ISBN: 978-3-540-49233-7
eBook Packages: Springer Book Archive