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.
Preview
Unable to display preview. Download preview PDF.
Bibliography
Abramson H.: Definite Clause Translation Grammar, International Symposium on Logic Programming, Atlantic City, IEEE, pp 233–240, 1984.
Attali I., Franchi-Zannettacci P.: Unification-free Execution of TYPOL Programs by Semantic Attribute Evaluation. PLILP'88, Orléans, France, May 16–18, 1988.
Arbab B.: Compiling Circular Attribute Grammars into Prolog, Journal of Research Development, 30 3, pp 294–309, May 1986.
Bonnier S., Maluszynski J.: Toward Clean Amalgamation of Logic Programs with External Procedures, PLILP'88, Orléans, France, May 16–18, 1988.
Turbo Prolog Owner's Handbook, Borland Int., Scotts Valley, 1986.
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).
Cohen J., Hickey T.J.: Parsing and Compiling Using Prolog, ACM Trans. on Progr. Lang. and Systems, 9 2, pp 125–163, April 1987.
Clark K.L.: Predicate Logic as a Computational Formalism, Res. Mon. 79/59, TOC, Imperial College, December 1979.
Colmerauer A.: Metamorphosis Grammar, LNCS 63, pp 133–189, Springer Verlag, (Bolc L. ed.), 1978.
Deransart P.: PROLOG: Basic Concepts and Methodology: Commented Exercises (french), University of Orléans, to appear, 1988.
Deransart P.: Proof of declarative properties of Logic Programs, INRIA report (to appear).
Deransart P.: On the Multiplicity of Operational Semantics for Logic Programming and their Modelization by Attribute Grammars. INRIA Report 1988 (to appear).
Deransart P., Ferrand G.: Logic Programming with Negation: Formal Presentation (in french), RR 87-3, Laboratoire d'Informatique, University of Orléans, June 1987.
Deransart P., Ferrand G.: An Operational Formal Definition of PROLOG, comprehensive version. RR 763, INRIA Rocquencourt, December 1987.
Deransart P., Ferrand G.: Logic Programming: Methodology and Teaching, 2nd French-Japan Symposium, Cannes, Nov 1987, North-Holland 1988.
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).
Deransart P., Maluszynski J.: Modelling Data Dependencies in Logic Programs by Attribute Schemata, INRIA RR 323, July 1983.
Deransart P., Maluszynski J.: Relating Logic Programs and Attribute Grammars, J. of Logic Programming 1985,2, pp 119–155.
Drabent W.: Do Logic Programs Resemble Programs in Conventional Languages, Proc. of IEEE SLP'87, San Francisco, September 1987.
Drabent W., Maluszynski J.: Inductive Assertion Method for Logic Programs. CFLP 87, Pisa, Italy, March 22–27 1987.
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.
Henriques P.R.: A Semantic Evaluator Generating System in Prolog, PLILP'88, Orléans, May 16–18, 1988.
Hogger C.J.: Introduction to Logic Programming, APIC Studies in Data Processing 21, Academic Press, 1984.
Hsiang J., Srivas M.: Prolog based Inductive Theorem Proving, LNCS 206, Springer Verlag, pp 129–149, Dec. 85.
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.
Kanamori T.: Soundness and Completness of Extended Execution for Proving Properties of Prolog Programs. TR 175 ICOT, 1986.
Knuth, D.E.: Semantics of Context-Free Languages, Math. Systems Theory 2 (1968), pp 127–145.
Leszczylowski J., Bonnier S. and Maluszynski J.: Logic Programming with External Procedures: Introducing S-Unification, IPL 27, 1988, pp 159–165.
Lloyd J.W.: Foundations of Logic Programming, Springer, 2nd edition, December 1987 (first 1984).
Maluszynski J.: Towards a Programming Language based on the Notion of Two-level Grammar, TCS 28 (1984) pp 13–43.
Maluszynski J., Nilsson J.F.: Grammatical Unification, IPL 15 (1982), pp 150–158.
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.
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
Matsumoto Y., Tanaka H., Hirakawa and al.: BUP: a Bottom Up Parser embedded in Prolog, New generation Computing, 1, 1983.
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.
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.
Nilsson U., AID: an Alternative Implementation of DCG's, New Generation Computing 4, pp 383–399, 1986.
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.
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.
Siekmann J.H.: Universal Unification, in Proc. of the 7th Int. Conf. on Automated Deduction, R.E.Shostak, ed., LNCS 169, Springer-Verlag, 1984.
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.
Van Wijngaarden A.: Orthogonal Design and Description of a Formal Language, MR 76, Mathematisch Centrum, Amsterdam, 1965.
Author information
Authors and Affiliations
Editor information
Rights 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