Skip to main content

Graph grammars and logic programming

  • Conference paper
  • First Online:
Graph Grammars and Their Application to Computer Science (Graph Grammars 1990)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 532))

Abstract

In this paper we investigate the relationship between the algebraic definition of graph grammars and logic programming. In particular, we show that the operational semantics of any logic program can be faithfully simulated by a particular context-free hypergraph grammar. In the process of doing that, we consider the issue of representing terms, formulas, and clauses as particular graphs or graph productions, by first evaluating the approaches already proposed for Term Rewriting Systems (TRS), and then by giving an original extension of those approaches, to be able to deal with the unique features of logic programming. Actually, not only does our representation of definite clauses by graph productions allow us to deal correctly with logical unification, but also it overcomes some of the problems encountered by other approaches for representing TRS's as graph grammars. The main result of the paper states the soundness and completeness of the representation of clauses by productions, and this correspondence is extended to entire computations, showing how a context-free grammar (over a suitable category of graphs) can be associated with a logic program. The converse holds as well, i.e. given any context-free graph grammar (over that category), a logic program can be extracted from it.

Research supported by the GRAGRA Basic Research Esprit Working Group n. 3299.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

6. References

  1. A. Asperti, S. Martini, Projections instead of variables, A category theoretic interpretation of logic programs, Proc. 6th Int. Conf. on Logic Programming, MIT Press, 1989, pp. 337–352.

    Google Scholar 

  2. M. Bauderon, B. Courcelle, Graph Expressions and Graph Rewritings, Mathematical System Theory 20, 1987, pp. 83–127.

    Article  Google Scholar 

  3. H.P. Barendregt, M.C.J.D. van Eekelen, J.R.W. Glauert, J.R. Kennaway, M.J. Plasmeijer, M.R. Sleep, Term graph reduction, in Proc. PARLE, LNCS 259, 1987, pp. 141–158.

    Google Scholar 

  4. V. Claus, H. Ehrig, G. Rozenberg, (Eds.) Proceedings of the 1 st International Workshop on Graph-Grammars and Their Application to Computer Science and Biology, LNCS 73, 1979.

    Google Scholar 

  5. B. Courcelle, On using context-free graph grammars for analyzing recursive definitions, in Programming of Future Generation Computers II, K. Fuchi, L. Kott (Eds.), Elsevier-North-Holland, 1988, pp. 83–122.

    Google Scholar 

  6. H. Ehrig, Aspects of concurrency in graph grammars, in [ENR83], pp. 58–81.

    Google Scholar 

  7. H. Ehrig, Tutorial introduction to the algebraic approach of graph-grammars, in [ENRR87] pp. 3–14.

    Google Scholar 

  8. H. Ehrig, A. Habel, H.-J. Kreowski, F. Parisi-Presicce, High-Level Replacement Systems, in [EKR91].

    Google Scholar 

  9. H. Ehrig, H.-J. Kreowski, G. Rozenberg, (Eds.) Proceedings of the 4 th International Workshop on Graph-Grammars and Their Application to Computer Science, LNCS, 1991, this volume.

    Google Scholar 

  10. H. Ehrig, M. Nagl, G. Rozenberg, (Eds.) Proceedings of the 2 nd International Workshop on Graph-Grammars and Their Application to Computer Science, LNCS 153, 1983.

    Google Scholar 

  11. H. Ehrig, M. Nagl, G. Rozenberg, A. Rosenfeld, (Eds.) Proceedings of the 3 rd International Workshop on Graph-Grammars and Their Application to Computer Science, LNCS 291, 1987.

    Google Scholar 

  12. H. Ehrig, M. Pfender, H.J. Schneider, Graph-grammars: an algebraic approach, Proc, IEEE Conf. on Automata and Switching Theory, 1973, pp. 167–180.

    Google Scholar 

  13. M. Falaschi, G. Levi, M. Martelli, C. Palamidessi, Declarative Modeling of the Operational Behaviour of Logic Languages, Theoretical Computer Science, 69(3), 1989, pp. 289–318.

    Article  Google Scholar 

  14. M. Falaschi, G. Levi, C. Palamidessi, A Synchronization Logic: Axiomatics and Formal Semantics of Generalized Horn Clauses, in Information and Control, 60(1–3), Academic Press, 1984.

    Google Scholar 

  15. J.A. Goguen, What is Unification? A Categorical View of Substitution, Equation and Solution, in M. Nivat and H. Aït-Kaci (Eds.), Resolution of Equations in Algebraic Structures, Academic Press, 1989.

    Google Scholar 

  16. A. Habel, Hyperedge Replacement: Grammars and Languages, Ph.D. Thesis, University of Bremen, 1989.

    Google Scholar 

  17. A. Habel, H-J. Kreowski, D. Plump, Jungle evaluation, in Proc. Fifth Workshop on Specification of Abstract Data Types, LNCS 332, 1988, pp. 92–112.

    Google Scholar 

  18. J.R. Kennaway, On ‘On Graph Rewritings', Theoretical Computer Science, 52, 1987, pp. 37–58.

    Article  Google Scholar 

  19. J.R. Kennaway, Graph rewriting in some categories of partial morphisms, in [EKR91].

    Google Scholar 

  20. G. Levi, Models, Unfolding Rules and Fixpoint Semantics, in Proc. 5th Int. Conf. Symp. on Logic Programming, Seattle, MIT Press, pp. 1649–1665, 1988.

    Google Scholar 

  21. J.W. Lloyd, Foundations of Logic Programming, Springer Verlag, 1984, (Second Edition 1987).

    Google Scholar 

  22. S. Mac Lane, Categories for the Working Mathematician, Springer Verlag, New York, 1971.

    Google Scholar 

  23. F. Parisi-Presicce, H. Ehrig and U. Montanari, Graph Rewriting with Unification and Composition, in [ENRR87], pp. 496–514.

    Google Scholar 

  24. J.C. Raoult, On Graph Rewritings, Theoretical Computer Science, 32, 1984, pp. 1–24.

    Article  Google Scholar 

  25. D.E. Rydeheard, R.M. Burstall, A Categorical Unification Algorithm, Proc. of the Workshop on Category Theory and Computer Programming, LNCS 240, 1985.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Hartmut Ehrig Hans-Jörg Kreowski Grzegorz Rozenberg

Rights and permissions

Reprints and permissions

Copyright information

© 1991 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Corradini, A., Montanari, U., Rossi, F., Ehrig, H., Löwe, M. (1991). Graph grammars and logic programming. In: Ehrig, H., Kreowski, HJ., Rozenberg, G. (eds) Graph Grammars and Their Application to Computer Science. Graph Grammars 1990. Lecture Notes in Computer Science, vol 532. Springer, Berlin, Heidelberg. https://doi.org/10.1007/BFb0017392

Download citation

  • DOI: https://doi.org/10.1007/BFb0017392

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-54478-4

  • Online ISBN: 978-3-540-38395-6

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics