skip to main content
article
Open Access

Modular logic programming

Published:01 July 1994Publication History
Skip Abstract Section

Abstract

Modularity is a key issue in the design of modern programming languages. When designing modular features for declarative languages in general, and for logic programming languages in particular, the challenge lies in avoiding the superimposition of a complex syntactic and semantic structure over the simple structure of the basic language. The modular framework defined here for logic programming consists of a small number of operations over modules which are (meta-) logically defined and semantically justified in terms of the basic logic programming semantics. The operations enjoy a number of algebraic properties, thus yielding an algebra of modules. Despite its simplicity, the suite of operations is shown capable of capturing the core features of modularization: information hiding, import/export relationships, and construction of module hierarchies. A metalevel implementation and a compilation-oriented implementation of the operations are provided and proved sound with respect to the semantics. The compilation-oriented implementation is based on manipulation of name spaces and provides the basis for an efficient implementation.

References

  1. APT, K.R. 1990. Logic programming. In Handbook of Theoretical Computer Science, J. van Leeuwen, Ed. Vol. B. Elsevier, Amsterdam, 493-574. Google ScholarGoogle Scholar
  2. BERGSTRA, j., HEERING, J., AND KLINT, P. 1990. Module algebra. J. ACM 37, 2, 335-372. Google ScholarGoogle Scholar
  3. BOWEN, K. AND KOWALSKI, R. 1982. Amalgamating language and metalanguage in logic programming. In Logic Programming, K. Clark and S. Tarnlund, Eds. Academic Press, New York, 153-173.Google ScholarGoogle Scholar
  4. BROGI, A. 1993. Program construction in computational logic. Ph.D. thesis, University of Pisa, Pisa, Italy.Google ScholarGoogle Scholar
  5. BROGI, A., CHIARELLI, A., MANCARELLA, P., MAZZOTTA, V. PEDRESCHI, D., AND TURINI, F. 1993a. Implementation of program composition operations. Tech. Rep., Dipartimento di Informatica, Universith di Pisa, Pisa, Italy.Google ScholarGoogle Scholar
  6. BROGI, A. AND TURINI, F. 1993. Fully abstract compositional semantics for an algebra of logic programs. Tech. Rep. TR 20/93, Dipartlmento di Informatica, Universith di Pisa, Pisa, Italy.Google ScholarGoogle Scholar
  7. BROGI, A., LAMMA, E., AND MELLO, P. 1992a. Compositional model-theoretic semantics for logic programs. New Gen. Comput. 11, 1, 1-21.Google ScholarGoogle Scholar
  8. BROGI, A., MANCARELLA, P., PEDRESCHI, D., AND TURrNI, F. 1992b. Meta for modularising logic programming. In Metaprogramming in Logic, A. Pettorossi, Ed. Lecture Notes in Computer Science, vol. 649. Springer-Verlag, New York, 105-119. Google ScholarGoogle Scholar
  9. BROGI, A., MANCARELLA, P., PEDRESCHI, D., AND TURINI, F. 1993b. Theory constructmn in computational logic. In Constructtng Logic Programs, J.-M. Jacquet, Ed. John Wiley and Sons, New York, 241-250. Google ScholarGoogle Scholar
  10. BROGI, A., MANCARELLA, P., PEDRESCHI, D., AND TURINI, F. 1990a. Composition operators for logic theories. In Computational Logic, Symposium Proceedings, J. Lloyd, Ed. Springer-Verlag, New York, 117-134.Google ScholarGoogle Scholar
  11. BROGI, A., MANCARELLA, P., PEDRESCHI, D., AND TURINI, F. 1990b. Hierarchies through basic metalevel operators. In Proceedings of the 2nd Workshop on meta-Programm~ng in Logic, M. Bruynooghe, Ed. K. U. Leuven, Belgium, 381-396.Google ScholarGoogle Scholar
  12. BROGI, A., MANCARELLA, P., PEDRESCHI, D., AND TURINI, F. 1990c. Logic programming within a functional framework. In Proceedings of the Workshop on Programming Language Implementation and Logic Programming (PLILP90), P. Deransart and J. Maluszynski, Eds. Lecture Notes in Computer Science, vol. 456. Springer-Verlag, New York, 372-386. Google ScholarGoogle Scholar
  13. BURSTALL, R. AND GOGUEN, J. 1980. The semantics of CLEAR, a specification language. In Abstract Software Specifications, D. Biorner, Ed. Lecture Notes in Computer Science, vol. 86. Springer-Verlag, New York, 292-332. Google ScholarGoogle Scholar
  14. CLARK, K. 1978. Negation as failure. In Logic and Data Bases, H. Gallaire and J. Minker, Eds. Plenum, New York, 293-322.Google ScholarGoogle Scholar
  15. COMPULOG 1992. Esprit basic research action, R. A. Kowalski, Ed. Tech. Annex, Imperial College of Science and Technology, London, U.K.Google ScholarGoogle Scholar
  16. FITTING, M.1987. Enumeration operators and modular logic programming. J. Logic Program. 4, 11-21. Google ScholarGoogle Scholar
  17. FUTATSUGI, K_~ GOGUEN7 J.~ JOUANNAUD, J., AND MESEGUER~ J. 1985. Principles of OBJ2. In Proceedings of the 12th POPL. ACM Press, New York, 52-66. Google ScholarGoogle Scholar
  18. GAIFMAN, H. AND SHAPIRO, E. 1989. Fully abstract compositional semantics for logic programs. In Proceedings of the 16th POPL. ACM Press, New York, 134-142. Google ScholarGoogle Scholar
  19. GIORDANO, L. AND MARTELLI, A. 1992 A modal reconstruction of blocks and modules in logic programming In Proceedings of the Internattonal Logic Programming Symposium, V. Saraswat and K Ueda, Eds. The MIT Press, Cambridge, Mass., 239-253.Google ScholarGoogle Scholar
  20. HILL, P. AND LLOYD, J. 1994. The Gbdel Programmtng Language. The MIT Press, Cambridge, Mass. Google ScholarGoogle Scholar
  21. HILL, P. AND LLOYD, J. 1989. Analysis of metaprograms. In Metaprogramrning in Logzc Programming, H. Abramson and M. Rogers, eds. The MIT Press, Cambridge, Mass., 23-52. Google ScholarGoogle Scholar
  22. KOWALSKI, R. 1979. Logzc for Problem Solving. North-Holland, Amsterdam. Google ScholarGoogle Scholar
  23. KOWALSK}, R. 1974. Predicate logic as a programming language. In IFIP 74. IFIP, Washington, D.C., 569-574.Google ScholarGoogle Scholar
  24. KOWALSKI, R AND KIM, J. 1991. A metalogic programming approach to multiagent knowledge and belief. In Artt~czal Intelltgence and Mathematzcal Theory of Computation, V. Lifschltz, Ed. Academic Press, New York. Google ScholarGoogle Scholar
  25. LASSEZ, J. AND MAHER, M. 1984. Closures and fairness in the semantics of logic programming. Theor. Comput. Scz. 29, 167-184.Google ScholarGoogle Scholar
  26. LLOYD, J. 1987. Foundattons of Logac Programming. 2nd ed. Springer-Verlag, New York. Google ScholarGoogle Scholar
  27. MAHER, M. 1988. Equivalences of logic programs. In Deductwe Databases and Logzc Programmzng, J. Minker, Ed. Morgan Kaufmann, San Mateo, Calif., 627-658. Google ScholarGoogle Scholar
  28. MANCARELLA, P. AND PEDRESCHI, D. 1988. An algebra of logic programs. In Proceedzngs of the 5th Internatzonal Conference on Logtc Programming, R. A. Kowalskl and K. A. Bowen, Eds. The MIT Press, Cambridge, Mass., 1006-1023.Google ScholarGoogle Scholar
  29. MCCABE, F. 1988. Logic and objects Ph.D thesis, Imperial College of Science and Technology, London, U.K.Google ScholarGoogle Scholar
  30. MELLO, P. AND NATALI, n. 1986 Programs as collections of communicating Prolog units. In Proceedtngs of ESOP 86, B. Robmet and R. Wichelm, Eds Lecture Notes m Computer Science, vol. 243. Springer-Verlag, New York, 274-288 Google ScholarGoogle Scholar
  31. MILLER, D. 1989. A logical analysis of modules in logic programming. J. Logzc Program. 6, 1 79-108. Google ScholarGoogle Scholar
  32. MONTEIRO, L. AND PORTO, A. 1989. Contextual logic programming. In Proceedzngs of the 6th International Conference on Logic Programmzng, G. Levl and M. Martelli, Eds. The MIT Press, Cambridge, Mass., 284-302.Google ScholarGoogle Scholar
  33. MONTEIRO, L. AND PORTO, A. 1991. A transformational view of inheritance in logic programming. In Proceedzngs of the 7th Internattonal Conference on Logzc Programmzng, D Warren and P. Szeredi, Eds. The MIT Press, Cambridge, Mass., 481-494. Google ScholarGoogle Scholar
  34. O'KEEFE, R. 1985. Towards an algebra for constructing logic programs. In Proceedings of the IEEE Symposzum on Logic Programmzng, J. Cohen and J. Cornery, Eds. IEEE Computer Society Press, Los Alamitos, Calif., 152-160.Google ScholarGoogle Scholar
  35. PFENNING, F. (Ed.) 1992. Types zn Logic Programmzng. The MIT Press, Cambridge, Mass. Google ScholarGoogle Scholar
  36. QUINTUS COMPUTER SYSTEMS, INC. 1986. Quintus Prolog User's Guide. Quintus Computer Systems, Inc., Mountain View, Calif.Google ScholarGoogle Scholar
  37. SANNELLA, D. AND WALLEN, L. 1992. A calculus for the construction of modular Prolog programs. J. Logic Program. 12, 147-177. Google ScholarGoogle Scholar
  38. STERLING, L. AND SHAPIRO, E. 1986. The Art of Prolog. The MIT Press, Cambridge, Mass.Google ScholarGoogle Scholar
  39. TAKEUCHI, A. AND FURUKAWA, K. 1986. Partial evaluation of Prolog programs and its application to metaprogramming. In Information Processtng 86, H.-J. Kugler, Ed. North-Holland, Amsterdam, 415-420.Google ScholarGoogle Scholar
  40. VAN EMDEN, M H. AND KOWALSKI, R.A. 1976. The semantics of predicate logic as a programming language. J. ACM 23, 4, 733-742. Google ScholarGoogle Scholar

Index Terms

  1. Modular logic programming

            Recommendations

            Comments

            Login options

            Check if you have access through your login credentials or your institution to get full access on this article.

            Sign in

            Full Access

            PDF Format

            View or Download as a PDF file.

            PDF

            eReader

            View online with eReader.

            eReader