Evaluation of Logic Programs in a Relational Language

  • Rémi Legrand


we present in this article a new approach to the compilation of logic programs. This method is based on the relationalization of literals into relations, which are evaluated in a relational language named Grel. The scheme of compilation is divided into two main steps. First, transformation rules of clauses are used in order to relationalize the compound terms. In the second step, we relationalize the literals through a mode inference mechanism close to Reddy (1984). Therefore, a goal is regionalized and the resulting relation is evaluated by the relational reduction machine. In order to do that, we defined and implemented the relational language Grel. It includes the non determinism following from the multi-results management and unknowns objects required in logic programs. Grel is implemented as an extension of a functional variableless language.

In the scheme of compilation, the evaluation of logic programs is based on the reduction principle, usual in functional languages; it is not based on the Robinson resolution principle such as in the classical Prolog implementations (Warren, 1983). It ensues an increase in the efficiency since reduction is generally more efficient than resolution. Furthermore, logic and functional programming are merged through the notion of relation.


Logic Program Functional Programming Horn Clause Functional Language LABRI 18838 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. Barbuti, R., 1986, LEAF: a language which integrates logic, equations and functions, in: Degroot (1986)Google Scholar
  2. DeBakker, J. W., and Apt, K.R., 1976, The fixed point approach in semantics: theory and applications, in: “Advanced course on the Foundations of Computer Science,” J.W. de Bakker, ed., AmsterdamGoogle Scholar
  3. Belkhir, A., 1988, Conception d’une machine orientée fonctions, application à l’implantation d’un langage dirigé par les données, Report LITP 88-55, ParisGoogle Scholar
  4. Bellia, M., Degano, P., and Levi G., 1982, The call by name semantics of a clause language with functions, in: “Logic Programming,” K.L. Clark and S.A. Tarnlund, ed., Academic PressGoogle Scholar
  5. Bellia, M., and Levi, G., 1986, The relation between logic and functional languages: a survey, Journal of Logic Programming. 3:217MATHCrossRefGoogle Scholar
  6. Bellot, P., 1986, Graal: a functional programming system with uncurryfied combinators and its reduction machine, in: “proc. of European Symposium On Programming,” LNCS 213, SaarbrückenGoogle Scholar
  7. Billaud, M., 1988, Simple operational and denotational semantics for prolog with cut, Report LABRI I8838, BordeauxGoogle Scholar
  8. Bobrow, D.G., and Wegbreit, B., 1973, A Model and Stack Implementation of Multiple Environments, CACM. 16:591CrossRefGoogle Scholar
  9. Bonacinak, M.P., and Hsiang, J., 1992, On the Rewrite Programs: Semantics and Relationship with Prolog, Journal of Logic Programming. 14:155MathSciNetCrossRefGoogle Scholar
  10. Bruynooghe, M., 1991, A practical Framework for the Abstract Interpretation of Logic Programs, Journal of Logic Programming. 10:91MathSciNetMATHCrossRefGoogle Scholar
  11. Clark, K.L. and Gregory, S., 1981, A relational language for parallel programming, in: “Proc. Functional Programming Languages and Computer Architecture,” Arvind and J. Dennis, ed., PorstmouthGoogle Scholar
  12. Darlington, J., Field, A J., and Pull, H., 1986, The unification of functional and logic languages, in DegrootGoogle Scholar
  13. Debray, S.K., and Warren, D.S., 1986, Automatic mode inference for prolog programs, in: “IEEE Symposium On Logic Programming,” Salt lake city, Utah (1986)Google Scholar
  14. DeGroot, D., 1986, Logic programming, Functions, Relations and Equations, D. DeGroot and G. Lindstrom, ed., Prentice-Hall, Englewood CliffsGoogle Scholar
  15. Eilenberg, S., and Elgot, C.C., 1970, Recursiveness, Academic Press, New yorkMATHGoogle Scholar
  16. Friedman, D., and Haynes, C.T., 1985, Constraining control, Technical Report 170, Indiana UniversityGoogle Scholar
  17. Greussay, P., 1983, Le système Lovlisp, in: “proc. Journées Prolog du CNET”, M. Dinebas, ed., CNET, Perros-GuirecGoogle Scholar
  18. Henderson, P., and Morris, J.M., 1976, A lazy evaluator, in: “Proc. Symposium on Principles of Programming Languages,” ACM, AtlantaGoogle Scholar
  19. Jagadeesan, R., Pingali, K., and Panangaden, P., 1991, A Fully Abstract Semantic for a First-Order Functional Language with Logic Variables, Transactions on Programming Languages and Systems, ACM, 13:577CrossRefGoogle Scholar
  20. Komorowski, H.J., 1982, Qlog-the programming environment for Prolog in Lisp, in: “Logic Programming,” K.L. Clark and S.A. Tarnlund, ed.Google Scholar
  21. Legrand, R., 1987, Calcul Relationnel et Programmation en Logique, Thesis, Report LITP 88-72, ParisGoogle Scholar
  22. Legrand, R., 1988, Extending functional programming towards relations, in: “Proc. European Symposium on Programming,” LNCS 300, H. Ganzinger, ed., Springer Verlag, NancyGoogle Scholar
  23. MacLennan, B.J., 1981, Introduction to relational programming, in: “Proc. Functional Programming Languages and Computer Architecture,” Arvind and J. Dennis, ed., PorstmouthGoogle Scholar
  24. Mellish, C.S., 1981, The automatic Generation of Mode Declarations for Prolog Programs, Report 163, Department A.I., EdinburghGoogle Scholar
  25. Mellish, C.S., 1984, Integrating Prolog in the POPLOG environment, Implementations of Prolog, J.A. Campbell, ed.Google Scholar
  26. Popplestone R.J., 1979, Relational Programming, Machine Intelligence 9, J.E. Hayes and D. Michie and L.I. Mikulich, ed.Google Scholar
  27. Reddy, U.S., 1984, Transformation of logic programs into functional programs, in: “Proc. International Symposium on Logic Programming,” IEEE Computer Soc. Press, Atlantic cityGoogle Scholar
  28. Robinson, J.A., 1965, A machine oriented based on the resolution principe, JACM, Vol. 12, pp 23–44MATHCrossRefGoogle Scholar
  29. Robinson, J.A., and Sibert, E.E., 1982, Loglisp: Motivations, Design and Implementation, In: “Logic Programming,” K.L. Clark and S.A. Tarnlund, ed., Academic PressGoogle Scholar
  30. Robinson, J.A., 1987, Beyond Loglisp: combining functional and relational programming in a reduction setting, Machine Intelligence 11, J.E. Hayes & D. Michie & J. Richards, ed.Google Scholar
  31. Seniak, N., 1987, Graal et sa compilation, Report LITP, ParisGoogle Scholar
  32. Sanderson, J.G., 1980, A Relational Theory of Computing, LNCS 82, G. Goos and J. Hartmanis, ed., Springer VerlagGoogle Scholar
  33. Smolka, G., 1986, Fresh: A Higher-Order Language Based on Unification, in Degroot (1986)Google Scholar
  34. Subrahmanyam, P.A., and You, J.H., 1984, Funlog=Functions+Logic: a computational model integrating functional and logic programming, in: “Proc. International Symposium on Logic Programming,” IEEE Computer Soc. Press, Atlantic cityGoogle Scholar
  35. Tarski, A., 1941, On the calculus of relations, Journal of Symbolic Logic. 6:73MathSciNetMATHCrossRefGoogle Scholar
  36. Warren, D.H.D, 1983, An abstract Prolog Instruction Set, Technical Note 309, SRI InternationalGoogle Scholar

Copyright information

© Springer Science+Business Media New York 1994

Authors and Affiliations

  • Rémi Legrand
    • 1
  1. 1.LITPUniversité Paris VIParis Cedex 05France

Personalised recommendations