Abstract
It is now widely accepted that separating programs into modules is useful in program development and maintenance. While many Prolog implementations include useful module systems, we argue that these systems can be improved in a number of ways, such as, for example, being more amenable to effective global analysis and transformation and allowing separate compilation or sensible creation of standalone executables. We discuss a number of issues related to the design of such an improved module system for Prolog and propose some novel solutions. Based on this, we present the choices made in the Ciao module system, which has been designed to meet a number of objectives: allowing separate compilation, extensibility in features and in syntax, amenability to modular global analysis and transformation, enhanced error detection, support for meta-programming and higher-order, compatibility to the extent possible with official and de-facto standards, etc.
This work was supported in part by the “EDIPIA” (CICYT TIC99-1151) and “ECCOSIC” (Fulbright 98059) projects. The authors would like to thank Francisco Bueno and the anonymous referees for their useful comments on previous versions of this document. The Ciao system is a collaborative international effort and includes contributions from members of several institutions, which are too many to mention here: a complete list can be found in the Ciao system documentation.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
H. Aït-Kaci, A. Podelski, and G. Smolka. A feature-based constraint system for logic programming with entailment. In Proc. Fifth Generation Computer Systems 1992, pages 1012–1021, 1992.
F. Bueno, D. Cabeza, M. Carro, M. Hermenegildo, P. López-García, and G. Puebla. The Ciao Prolog System. Reference Manual. TR CLIP3/97.1, School of Computer Science, Technical University of Madrid (UPM), August 1997.
F. Bueno, D. Cabeza, M. Hermenegildo, and G. Puebla. Global Analysis of Standard Prolog Programs. In European Symposium on Programming, number 1058 in LNCS, pages 108–124, Sweden, April 1996. Springer-Verlag.
F. Bueno, M. García de la Banda, and M. Hermenegildo. Effectiveness of Abstract Interpretation in Automatic Parallelization: A Case Study in Logic Programming. ACM Trans. on Programming Languages and Systems, 21(2): 189–238, March 1999.
F. Bueno, P. Deransart, W. Drabent, G. Ferrand, M. Hermenegildo, J. Maluszynski, and G. Puebla. On the Role of Semantic Approximations in Validation and Diagnosis of Constraint Logic Programs. In Int’l WS on Automated Debugging-AADEBUG’97, pages 155–170, Sweden, May 1997. U. of Linköping Press.
D. Cabeza and M. Hermenegildo. Higher-order Logic Programming in Ciao. TR CLIP7/99.0, Facultad de Informática, UPM, September 1999.
D. Cabeza and M. Hermenegildo. The Ciao Modular Compiler and Its Generic Program Processing Library. In ICLP’99 WS on Parallelism and Implementation of (C)LP Systems, pages 147–164. N.M. State U., December 1999.
M. Carlsson and J. Widen. Sicstus Prolog User’s Manual. Po Box 1263, S-16313 Spanga, Sweden, April 1994.
W. Chen. A theory of modules based on second-order logic. In Proc. 4th IEEE Internat. Symposium on Logic Programming, pages 24–33, San Francisco, 1987.
M. Comini, G. Levi, M. C. Meo, and G. Vitiello. Proving properties of logic programs by abstract diagnosis. In M. Dams, editor, Analysis and Verification of Multiple-Agent Languages, 5th LOMAPS Workshop, number 1192 in Lecture Notes in Computer Science, pages 22–50. Springer-Verlag, 1996.
S. Debray. Flow analysis of dynamic logic programs. Journal of Logic Programming, 7(2):149–176, September 1989.
P. Deransart, A. Ed-Dbali, and L. Cervoni. Prolog: The Standard. Springer, 1996.
J.A. Goguen and J. Meseguer. Eqlog: equality, types, and generic modules for logic programming. In Logic Programming: Functions, Relations, and Equations, Englewood Cliffs, 1986. Prentice-Hall.
M. Hermenegildo. A Documentation Generator for (C)LP Systems. In this volume: Proceedings of CL2000, LNCS, Springer-Verlag.
M. Hermenegildo, F. Bueno, G. Puebla, and P. López-García. Program Analysis, Debugging and Optimization Using the Ciao System Preprocessor. In Proc. of ICLP’99, pages 52–66, Cambridge, MA, November 1999. MIT Press.
M. Hermenegildo and The CLIP Group. Programming with Global Analysis. In Proc. of ILPS’97, pages 49–52, October 1997. MIT Press. (Invited talk abstract).
M. Hermenegildo, G. Puebla, and F. Bueno. Using Global Analysis, Partial Specifications, and an Extensible Assertion Language for Program Validation and Debugging. In K. R. Apt, V. Marek, M. Truszczynski, and D. S. Warren, editors, The Logic Programming Paradigm: a 25-Year Perspective, pages 161–192. Springer-Verlag, July 1999.
P. Hill and J. Lloyd. The Goedel Programming Language. MIT Press, 1994.
International Organization for Standardization. PROLOG. ISO/IEC DIS 13211 — Part 1: General Core, 1994.
International Organization for Standardization. PROLOG. Working Draft 7.0 X3J17/95/1 — Part 2: Modules, 1995.
D. Miller. A logical analysis of modules in logic programming. Journal of Logic Programming, pages 79–108, 1989.
L. Monteiro and A. Porto. Contextual logic programming. In Proc. of ICLP’89, pages 284–299. MIT Press, Cambridge, MA, 1989.
R.A. O’Keefe. Towards an algebra for constructing logic programs. In IEEE Symposium on Logic Programming, pages 152–160, Boston, Massachusetts, July 1985. IEEE Computer Society.
A. Pineda and M. Hermenegildo. O’ciao: An Object Oriented Programming Model for (Ciao) Prolog. TR CLIP 5/99.0, Facultad de Inform’atica, UPM, July 1999.
G. Puebla, F. Bueno, and M. Hermenegildo. An Assertion Language for Debugging of Constraint Logic Programs. In ILPS’97 WS on Tools and Environments for (C)LP, October 1997. Available as TR CLIP2/97.1 from ftp://clip.dia.fi.upm.es/pub/papers/assert_lang_tr_discipldeliv.ps.gz.
G. Puebla, F. Bueno, and M. Hermenegildo. An Assertion Language for Debugging of Constraint Logic Programs. In Analysis and Visualization Tools for Constraint Programming, LNCS. Springer-Verlag, 2000. To appear.
G. Puebla and M. Hermenegildo. Some Issues in Analysis and Specialization of Modular Ciao-Prolog Programs. In ICLP’99 WS on Optimization and Implementation of Declarative Languages, pages 45–61. U. of Southampton, U.K, Nov. 1999.
Quintus Prolog User’s Guide and Reference Manual—Version 6, April 1986.
K. Sagonas, T. Swift, and D.S. Warren. The XSB Programming System. In ILPS WS on Programming with Logic Databases, TR #1183, pages 164–164. U. of Wisconsin, October 1993.
Z. Somogyi, F. Henderson, and T. Conway. The execution algorithm of Mercury: an efficient purely declarative LP language. JLP, 29(1–3), October 1996.
A. Taylor. High performance prolog implementation through global analysis. Slides of the invited talk at PDK’91, Kaiserslautern, 1991.
P. Van Roy, B. Demoen, and Y. D. Willems. Improving the Execution Speed of Compiled Prolog with Modes, Clause Selection, and Determinism. In Proceedings of TAPSOFT’ 87, LNCS. Springer-Verlag, March 1987.
P. Van Roy and A.M. Despain. High-Performace Logic Programming with the Aquarius Prolog Compiler. IEEE Computer Magazine, pages 54–68, January 1992.
D.S. Warren and W. Chen. Formal semantics of a theory of modules. TR 87/11, SUNY at Stony Brook, 1987.
R. Warren, M. Hermenegildo, and S. K. Debray. On the Practicality of Global Flow Analysis of Logic Programs. In Fifth International Conference and Symposium on Logic Programming, pages 684–699. MIT Press, August 1988.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2000 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Cabeza, D., Hermenegildo, M. (2000). A New Module System for Prolog. In: Lloyd, J., et al. Computational Logic — CL 2000. CL 2000. Lecture Notes in Computer Science(), vol 1861. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-44957-4_9
Download citation
DOI: https://doi.org/10.1007/3-540-44957-4_9
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-67797-0
Online ISBN: 978-3-540-44957-7
eBook Packages: Springer Book Archive