A grammatical view of logic programming

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.

[1]  Bruno Courcelle,et al.  Proofs of Partial Correctness for Attribute Grammars with Applications to Recursive Procedures and Logic Programming , 1988, Inf. Comput..

[2]  Michael J. Maher,et al.  A Theory of Complete Logic Programs with Equality , 1984, J. Log. Program..

[3]  Adriaan van Wijngaarden,et al.  Orthogonal design and description of a formal language , 1965 .

[4]  Mandayam K. Srivas,et al.  PROLOG-Based Inductive Theorem Proving , 1985, FSTTCS.

[5]  Bijan Arbab Compiling Circular Attribute Grammars Into Prolog , 1986, IBM J. Res. Dev..

[6]  Giorgio Levi,et al.  A New Declarative Semantics for Logic Languages , 1988, ICLP/SLP.

[7]  David H. D. Warren,et al.  Parsing as Deduction , 1983, ACL.

[8]  Christopher John Hogger,et al.  Introduction to logic programming , 1986, A.P.I.C. Studies in data processing.

[9]  T. Naslund An experimental implementation of a compiler for two-level grammars , 1987 .

[10]  Wlodzimierz Drabent Do Logic Programs Resemble Programs in Conventional Languages? , 1987, SLP.

[11]  Jørgen Fischer Nilsson,et al.  On the Compilation of a Domain-Based Prolog , 1983, IFIP Congress.

[12]  Harvey Abramson Definite Clause Translation Grammars , 1984, SLP.

[13]  Jan Maluszynski,et al.  Relating Logic Programs and Attribute Grammars , 1985, J. Log. Program..

[14]  David H. D. Warren,et al.  Definite Clause Grammars for Language Analysis - A Survey of the Formalism and a Comparison with Augmented Transition Networks , 1980, Artif. Intell..

[15]  T. Kanamori Soundness and completeness of extended execution for proving properties of prolog programs , 1988 .

[16]  Kuniaki Uehara,et al.  A Bottom-Up Parser Based on Predicate Logic: A Survey of the Formalism and its Implementation Technique , 1984, SLP.

[17]  Alain Colmerauer,et al.  Metamorphosis Grammars , 1978, Natural Language Communication with Computers.

[18]  Jan Maluszynski,et al.  Logic Programming with External Procedures: Introducing S-Unification , 1988, Inf. Process. Lett..

[19]  Wlodzimierz Drabent,et al.  Inductive Assertion Method for Logic Programs , 1988, Theor. Comput. Sci..

[20]  John Wylie Lloyd,et al.  Foundations of Logic Programming , 1987, Symbolic Computation.

[21]  Jacques Cohen,et al.  Parsing and compiling using Prolog , 1987, TOPL.

[22]  Jörg H. Siekmann,et al.  Universal Unification , 1982, GWAI.

[23]  Jørgen Fischer Nilsson,et al.  A Comparison of the Logic Programming Language Prolog with Two-levels Grammars , 1982, ICLP.

[24]  Paul Franchi-Zannettacci,et al.  Unification-Free Execution of TYPOL Programs by Semantic Attribute Evaluation , 1988, ICLP/SLP.

[25]  Pierre Deransart,et al.  Proofs of Declarative Properties of Logic Programs , 1989, TAPSOFT, Vol.1.

[26]  Jan Maluszynski,et al.  Towards a Programming Language Based on the Notion of Two-Level Grammar , 1984, Theor. Comput. Sci..