Skip to main content

A grammatical view of logic programming

  • Attribute Grammars And Logic Programming
  • Conference paper
  • First Online:
Programming Languages Implementation and Logic Programming (PLILP 1988)

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

Abstract

We presented a grammatical view of logic programming where logic programs are considered grammars. This gives a natural framework for defining extensions to the concept of logic program. The paper shows that many useful extensions of Horn clauses incorporated in Prolog without theoretical justification correspond to well-established grammatical concepts. In particular the notion of DCG is a special case of W-grammar, modes are related to dependency relation of AG's, domain declarations of Turbo Prolog can be seen as a metagrammar of W-grammar and Prolog arithmetics fits naturally in the framework of RAG's with non-term interpretations. The grammatical point of view shows also a possibility of further extensions, not incorporated in Prolog, like a natural use of external procedures in logic programs. It also opens for the use of “grammatical techniques” like parsing or attribute evaluation in implementation of logic programs. On the other hand, the comparison of the formalisms shows that resolution techniques can be used for some grammars which were considered practically intractable, like RAG's or W-grammars. Last but not least, the grammatical point of view makes it possible to apply in logic programming some proof techniques developed originally for proving correctness of attribute grammars.

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.

Bibliography

  1. Abramson H.: Definite Clause Translation Grammar, International Symposium on Logic Programming, Atlantic City, IEEE, pp 233–240, 1984.

    Google Scholar 

  2. Attali I., Franchi-Zannettacci P.: Unification-free Execution of TYPOL Programs by Semantic Attribute Evaluation. PLILP'88, Orléans, France, May 16–18, 1988.

    Google Scholar 

  3. Arbab B.: Compiling Circular Attribute Grammars into Prolog, Journal of Research Development, 30 3, pp 294–309, May 1986.

    Google Scholar 

  4. Bonnier S., Maluszynski J.: Toward Clean Amalgamation of Logic Programs with External Procedures, PLILP'88, Orléans, France, May 16–18, 1988.

    Google Scholar 

  5. Turbo Prolog Owner's Handbook, Borland Int., Scotts Valley, 1986.

    Google Scholar 

  6. Courcelle B., Deransart P.: Proofs of Partial Correctness for Attribute Grammars with Application to Recursive Procedures and Logic Programming, RR I-8702, University of Bordeaux (to appear in Information and Computation 1988).

    Google Scholar 

  7. Cohen J., Hickey T.J.: Parsing and Compiling Using Prolog, ACM Trans. on Progr. Lang. and Systems, 9 2, pp 125–163, April 1987.

    Google Scholar 

  8. Clark K.L.: Predicate Logic as a Computational Formalism, Res. Mon. 79/59, TOC, Imperial College, December 1979.

    Google Scholar 

  9. Colmerauer A.: Metamorphosis Grammar, LNCS 63, pp 133–189, Springer Verlag, (Bolc L. ed.), 1978.

    Google Scholar 

  10. Deransart P.: PROLOG: Basic Concepts and Methodology: Commented Exercises (french), University of Orléans, to appear, 1988.

    Google Scholar 

  11. Deransart P.: Proof of declarative properties of Logic Programs, INRIA report (to appear).

    Google Scholar 

  12. Deransart P.: On the Multiplicity of Operational Semantics for Logic Programming and their Modelization by Attribute Grammars. INRIA Report 1988 (to appear).

    Google Scholar 

  13. Deransart P., Ferrand G.: Logic Programming with Negation: Formal Presentation (in french), RR 87-3, Laboratoire d'Informatique, University of Orléans, June 1987.

    Google Scholar 

  14. Deransart P., Ferrand G.: An Operational Formal Definition of PROLOG, comprehensive version. RR 763, INRIA Rocquencourt, December 1987.

    Google Scholar 

  15. Deransart P., Ferrand G.: Logic Programming: Methodology and Teaching, 2nd French-Japan Symposium, Cannes, Nov 1987, North-Holland 1988.

    Google Scholar 

  16. Deransart P., Jourdan M., Lorho B.: Attribute Grammars: Main Results, Existing Systems and Bibliography. LNCS 323, Springer Verlag, August 1988 (first edition: A Survey on Attribute Grammars, INRIA RR 485, 510, 417).

    Google Scholar 

  17. Deransart P., Maluszynski J.: Modelling Data Dependencies in Logic Programs by Attribute Schemata, INRIA RR 323, July 1983.

    Google Scholar 

  18. Deransart P., Maluszynski J.: Relating Logic Programs and Attribute Grammars, J. of Logic Programming 1985,2, pp 119–155.

    Google Scholar 

  19. Drabent W.: Do Logic Programs Resemble Programs in Conventional Languages, Proc. of IEEE SLP'87, San Francisco, September 1987.

    Google Scholar 

  20. Drabent W., Maluszynski J.: Inductive Assertion Method for Logic Programs. CFLP 87, Pisa, Italy, March 22–27 1987.

    Google Scholar 

  21. Falashi M., Levi G., Martelli M., Palamidessi C.: A new Declarative Semantics for Logic Languages. Dipartimento di informatica, University of Pisa, Italy. LP'88, Seattle, August 1988.

    Google Scholar 

  22. Henriques P.R.: A Semantic Evaluator Generating System in Prolog, PLILP'88, Orléans, May 16–18, 1988.

    Google Scholar 

  23. Hogger C.J.: Introduction to Logic Programming, APIC Studies in Data Processing 21, Academic Press, 1984.

    Google Scholar 

  24. Hsiang J., Srivas M.: Prolog based Inductive Theorem Proving, LNCS 206, Springer Verlag, pp 129–149, Dec. 85.

    Google Scholar 

  25. Jaffar J., Lassez J.L., Maher M.J.: A theory of complete logic programs with equality, Journal of Logic Programming, 1984/3, pp 211–223.

    Google Scholar 

  26. Kanamori T.: Soundness and Completness of Extended Execution for Proving Properties of Prolog Programs. TR 175 ICOT, 1986.

    Google Scholar 

  27. Knuth, D.E.: Semantics of Context-Free Languages, Math. Systems Theory 2 (1968), pp 127–145.

    Google Scholar 

  28. Leszczylowski J., Bonnier S. and Maluszynski J.: Logic Programming with External Procedures: Introducing S-Unification, IPL 27, 1988, pp 159–165.

    Google Scholar 

  29. Lloyd J.W.: Foundations of Logic Programming, Springer, 2nd edition, December 1987 (first 1984).

    Google Scholar 

  30. Maluszynski J.: Towards a Programming Language based on the Notion of Two-level Grammar, TCS 28 (1984) pp 13–43.

    Google Scholar 

  31. Maluszynski J., Nilsson J.F.: Grammatical Unification, IPL 15 (1982), pp 150–158.

    Google Scholar 

  32. Maluszynski J., Nilsson J.F.: A Comparison of the Logic Programming Language PROLOG with Two-level Grammars, in: Van Caneghem, ed., First Int. Logic Programming Conf., pp 193–199, Marseille 1982.

    Google Scholar 

  33. Maluszynski J., Nilsson J.F.: A Version of PROLOG based on the Notion of Two-Level Grammar, in: J. Komorowski (ed) PROLOG Programming Environments, Proc. of the Workshop, Linköping University 1982

    Google Scholar 

  34. Matsumoto Y., Tanaka H., Hirakawa and al.: BUP: a Bottom Up Parser embedded in Prolog, New generation Computing, 1, 1983.

    Google Scholar 

  35. Näslund T.: An experimental implementation of a compiler for two-level grammars, in: Z.W.Ras and M. Zemankova (eds.), Proc. of the 2nd Int. Symposium, Methodologies for Intelligent Systems, pp 424–431, North-Holland 1987.

    Google Scholar 

  36. Nilsson J.F.: On the Compilation of a Domain-based Prolog, in: R.E.A. Mason, ed., Information Processing 83, pp 293–298, North-Holland 1983.

    Google Scholar 

  37. Nilsson U., AID: an Alternative Implementation of DCG's, New Generation Computing 4, pp 383–399, 1986.

    Google Scholar 

  38. Pereira F.N.C., Warren D.H.D.: Definite Clause Grammars for Language Analysis: a Survey of the Formalism and Comparison with Augmented Transition Networks. Artificial Intelligence, 13–3, pp 231–278, 1980.

    Google Scholar 

  39. Pereira F.N.C., Warren D.H.D.: Parsing as Deduction, 21st Annual Meeting of the Ass. for Computational Linguistics (Cambridge, Mass.), pp 137–144, June 1983.

    Google Scholar 

  40. Siekmann J.H.: Universal Unification, in Proc. of the 7th Int. Conf. on Automated Deduction, R.E.Shostak, ed., LNCS 169, Springer-Verlag, 1984.

    Google Scholar 

  41. Uehara K., Ochitani R., Kakusho O., Toyoda J.: A Bottom Up Parser Based on Predicate Logic: a Survey of the Formalism and its Implementation Technique, ISLP, Atlantic City, pp 220–227, 1984.

    Google Scholar 

  42. Van Wijngaarden A.: Orthogonal Design and Description of a Formal Language, MR 76, Mathematisch Centrum, Amsterdam, 1965.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

P. Deransart B. Lorho J. Małuszyński

Rights and permissions

Reprints and permissions

Copyright information

© 1989 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Deransart, P., Maluszynski, J. (1989). A grammatical view of logic programming. In: Deransart, P., Lorho, B., Małuszyński, J. (eds) Programming Languages Implementation and Logic Programming. PLILP 1988. Lecture Notes in Computer Science, vol 348. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-50820-1_50

Download citation

  • DOI: https://doi.org/10.1007/3-540-50820-1_50

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-50820-5

  • Online ISBN: 978-3-540-46092-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics