An Algorithm for Local Variable Elimination in Normal Logic Programs

  • Javier Álvez
  • Paqui Lucio
Part of the Lecture Notes in Computer Science book series (LNCS, volume 3901)


A variable is local if it occurs in a clause body but not in its head. Local variables appear naturally in practical logic programming, but they complicate several aspects such as negation, compilation, memoization, static analysis, program approximation by neural networks etc. As a consequence, the absence of local variables yields better performance of several tools and is a prerequisite for many technical results. In this paper, we introduce an algorithm that eliminates local variables from a wide proper subclass of normal logic programs. The proposed transformation preserves the Clark-Kunen semantics for normal logic programs.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Álvez, J., Lucio, P.: An algorithm for local variable elimination in normal logic programs. Technical Report LSI/TR 10-2005, Basque Country University (2005)Google Scholar
  2. 2.
    Álvez, J., Lucio, P., Orejas, F., Pasarella, E., Pino, E.: Constructive negation by bottom-up computation of literal answers. In: SAC 2004, pp. 1468–1475. ACM Press, New York (2004)Google Scholar
  3. 3.
    Andréka, H., Németi, I.: The generalized completeness of Horn predicate-logic as a programming language. Acta Cybern. 4, 3–10 (1980)zbMATHGoogle Scholar
  4. 4.
    Apt, K.R.: Logic programming. In: Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics (B), pp. 493–574. Elsevier, Amsterdam (1990)Google Scholar
  5. 5.
    Barbuti, R., Mancarella, P., Pedreschi, D., Turini, F.: A transformational approach to negation in logic programming. J. Log. Program. 8(3), 201–228 (1990)MathSciNetCrossRefzbMATHGoogle Scholar
  6. 6.
    Bruscoli, P., Levi, F., Levi, G., Meo, M.C.: Compilative constructive negation in constraint logic programs. In: Tison, S. (ed.) CAAP 1994. LNCS, vol. 787, pp. 52–67. Springer, Heidelberg (1994)CrossRefGoogle Scholar
  7. 7.
    Chan, D.: An extension of constructive negation and its application in coroutining. In: NACLP, pp. 477–493 (1989)Google Scholar
  8. 8.
    Clark, K.L.: Negation as failure. In: Gallaire, H., Minker, J. (eds.) Logic and Data Bases, pp. 293–322. Plenum Press, New York (1978)CrossRefGoogle Scholar
  9. 9.
    Dembinski, P., Maluszynski, J.: And-parallelism with intelligent backtracking for annotated logic programs. In: SLP, pp. 29–38 (1985)Google Scholar
  10. 10.
    Drabent, W.: Do logic programs resemble programs in conventional languages. In: SLP, pp. 289–396 (1987)Google Scholar
  11. 11.
    Drabent, W.: What is failure? an approach to constructive negation. Acta Inf. 32(1), 27–29 (1995)MathSciNetCrossRefzbMATHGoogle Scholar
  12. 12.
    Hanus, M.: On extra variables in (equational) logic programming. In: ICLP, pp. 665–679 (1995)Google Scholar
  13. 13.
    Kunen, K.: Negation in logic programming. J. Log. Program. 4(4), 289–308 (1987)MathSciNetCrossRefzbMATHGoogle Scholar
  14. 14.
    Leuschel, M., Sørensen, M.H.: Redundant argument filtering of logic programs. In: Gallagher, J.P. (ed.) LOPSTR 1996. LNCS, vol. 1207, pp. 83–103. Springer, Heidelberg (1997)CrossRefGoogle Scholar
  15. 15.
    Maher, M.J.: Correctness of a logic program transformation system. Technical Report RC 13496, IBM T.J. Watson Research Center (1988)Google Scholar
  16. 16.
    Mellish, C.S.: The automatic generation of mode declarations for prolog programs. Technical Report 163, Dept. of Artificial Intelligence, University of Edinburgh, Scotland (1981)Google Scholar
  17. 17.
    Pettorossi, A., Proietti, M.: Transformation of logic programs. In: Gabbayand, D.M., Hogger, C.J., Robinson, J.A. (eds.) Handbook of Logic in Artificial Intelligence and Logic Programming, vol. 5, pp. 697–787. Oxford University Press, Oxford (1998)Google Scholar
  18. 18.
    Proietti, M., Pettorossi, A.: Unfolding - definition - folding, in this order, for avoiding unnecessary variables in logic programs. Theor. Comput. Sci. 142(1), 89–124 (1995)MathSciNetCrossRefzbMATHGoogle Scholar
  19. 19.
    Rosenblueth, D.A.: Chart parsers as proof procedures for fixed-mode logic programs. In: FGCS, pp. 1125–1132 (1992)Google Scholar
  20. 20.
    Sato, T., Tamaki, H.: Transformational logic program synthesis. In: FGCS, pp. 195–201 (1984)Google Scholar
  21. 21.
    Sato, T., Tamaki, H.: Existential continuation. New Generation Comput 6(4), 421–438 (1989)CrossRefzbMATHGoogle Scholar
  22. 22.
    Sterling, L., Shapiro, E.: The art of Prolog: advanced programming techniques. MIT Press, Cambridge (1986)zbMATHGoogle Scholar
  23. 23.
    Stuckey, P.J.: Negation and constraint logic programming. Inf. Comput. 118(1), 12–33 (1995)MathSciNetCrossRefzbMATHGoogle Scholar
  24. 24.
    Tärnlund, S.-Å.: Horn clause computability. BIT 17(2), 215–226 (1977)Google Scholar
  25. 25.
    Wasserman, H.C., Yukawa, K., Shen, Z.: An alternative transformation rule for logic programs. In: SAC 1995: Proceedings of the 1995 ACM symposium on Applied computing, pp. 364–368. ACM Press, New York (1995)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2006

Authors and Affiliations

  • Javier Álvez
    • 1
  • Paqui Lucio
    • 1
  1. 1.Faculty of Computer ScienceBasque Country UniversitySan SebastiánSpain

Personalised recommendations