Correction of Functional Logic Programs

  • Maria Alpuente
  • Demis Ballis
  • Francisco J. Correa
  • Moreno Falaschi
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2618)


We propose a new methodology for synthesizing correct functional logic programs. We aim to create an integrated development environment in which it is possible to debug a program and correct it automatically. We start from a declarative diagnoser that we have developed previously which allows us to identify wrong program rules w.r.t. an intended specification. Then a bug-correction, program synthesis methodology tries to correct the erroneous components of the wrong code. We propose a hybrid, top-down (unfolding-based) as well as bottom-up (induction-based), approach for the automatic correction of functional logic programs which is driven by a set of evidence examples which are automatically produced as an outcome by the diagnoser. The resulting program is proven to be correct and complete w.r.t. the considered example sets. Finally, we also provide a prototypical implementation which we use for an experimental evaluation of our system.


Logic Program Functional Logic Program Rule Intended Semantic Springer LNCS 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


  1. 1.
    M. Alpuente, D. Ballis, F. J. Correa, and M. Falaschi. Correction of Functional Logic Programs. Technical report, DSIC-II/23/02, UPV, 2002. Available at URL:
  2. 2.
    M. Alpuente, F. J. Correa, and M. Falaschi. Debugging Scheme of Functional Logic Programs. In Proc. of WFLP’01, vol. 64 of ENTCS, 2002.Google Scholar
  3. 3.
    M. Alpuente, F. J. Correa, M. Falaschi, and S. Marson. The Debugging System buggy. Technical report, UPV, 2001. Available at URL:
  4. 4.
    M. Alpuente, M. Falaschi, G. Moreno, and G. Vidal. Safe folding/unfolding with conditional narrowing. In Proc. ALP’97, pp. 1–15. Springer LNCS 1298, 1997.Google Scholar
  5. 5.
    M. Alpuente, M. Falaschi, G. Moreno, and G. Vidal. A Transformation System for Lazy Functional Logic Programs. In Proc. of FLOPS’99, pp. 147–162. Springer LNCS 1722, 1999.Google Scholar
  6. 6.
    M. Alpuente, F. Correa, and M. Falaschi. Declarative Debugging of Funtional Logic Programs. In Proc. of WRS’01, vol. 57 of ENTCS, 2001.Google Scholar
  7. 7.
    F. Baader and T. Nipkow. Term Rewriting and All That. Cambridge University Press, 1998.Google Scholar
  8. 8.
    H. Bostrom and P. Idestam-Alquist. Induction of Logic Programs by Example-guided Unfolding. Journal of Logic Programming, 40:159–183, 1999.CrossRefMathSciNetGoogle Scholar
  9. 9.
    Henrik Bostrom. Specialization of recursive predicates. In European Conference on Machine Learning, pp. 92–106, 1995.Google Scholar
  10. 10.
    M. Comini, R. Gori, and G. Levi. Assertion based Inductive Verification Methods for Logic Programs. In Proc. of MFCSIT’00, vol. 40 of ENTCS, 2001.Google Scholar
  11. 11.
    M. Comini, G. Levi, and G. Vitiello. Declarative Diagnosis Revisited. In Proc. of ILP’95, pp. 275–287. The MIT Press, 1995.Google Scholar
  12. 12.
    P. Cousot and R. Cousot. Abstract Interpretation: A Unified Lattice Model for Static Analysis of Programs by Construction or Approximation of Fixpoints. In Proc. of POPL’77, pp. 238–252, 1977.Google Scholar
  13. 13.
    N. Dershowitz and U. Reddy. Deductive and Inductive Synthesis of Equational Programs. Journal of Symbolic Computation, 15:467–494, 1993.zbMATHCrossRefMathSciNetGoogle Scholar
  14. 14.
    M. Falaschi, G. Levi, M. Martelli, and C. Palamidessi. Declarative Modeling of the Operational Behavior of Logic Languages. TCS, 69(3):289–318, 1989.zbMATHCrossRefMathSciNetGoogle Scholar
  15. 15.
    M. Fay. First Order Unification in an Equational Theory. In Proc of 4th Int’l Conf. on Automated Deduction, pp. 161–167, 1979.Google Scholar
  16. 16.
    C. Ferri, J. Hernández, and M.J. Ramírez. The FLIP System Homepage. 2000. Available at
  17. 17.
    C. Ferri, J. Hernández, and M.J. Ramírez. Incremental Learning of Functional Logic Programs. In Proc. FLOPS’01, pp. 233–247. LNCS 2024, 2001.CrossRefGoogle Scholar
  18. 18.
    E. Giovannetti, G. Levi, C. Moiso, and C. Palamidessi. Kernel Leaf: A Logic plus Functional Language. JCSS, 42:363–377, 1991.Google Scholar
  19. 19.
    M. Hanus. The Integration of Functions into Logic Programming: From Theory to Practice. Journal of Logic Programming, 19&20:583–628, 1994.CrossRefMathSciNetGoogle Scholar
  20. 20.
    J. Hernández and M.J. Ramírez. Inverse Narrowing for the Induction of Functional Logic Programs. In Proc. of APPIA-GULP-PRODE’ 98, pp. 379–393, 1998.Google Scholar
  21. 21.
    S. Hölldobler. Foundations of Equational Logic Programming. LNAI 353, 1989.Google Scholar
  22. 22.
    J.W. Klop. Term Rewriting Systems. In Handbook of Logic in Computer Science, vol. I, pp. 1–112. Oxford University Press, 1992.MathSciNetGoogle Scholar
  23. 23.
    S. Lucas. Context-Sensitive Rewriting Strategies. Information and Computation, 178(1):294–343, 2002.zbMATHMathSciNetGoogle Scholar
  24. 24.
    S. Lucas. Termination of Canonical Context-Sensitive Rewriting. In Proc. RTA’02, pp. 296–310. Springer LNCS 2378, 2002.Google Scholar
  25. 25.
    M.J. Maher. Equivalences of Logic Programs. In Foundations of Deductive Databases and Logic Programming, pp. 627–658. Morgan Kaufmann, 1988.Google Scholar
  26. 26.
    J.J. Moreno-Navarro and M. Rodríguez-Artalejo. Logic Programming with Functions and Predicates: The language Babel. JLP, 12(3):191–224, 1992.zbMATHCrossRefGoogle Scholar
  27. 27.
    P. Padawitz. Computing in Horn Clause Theories, vol. 16 of EATCS Monographs on Theoretical Computer Science. Springer-Verlag, Berlin, 1988.zbMATHGoogle Scholar
  28. 28.
    A. Pettorossi and M. Proietti. Transformation of Logic Programs. In Handbook of Logic in Artificial Intelligence, vol. 5, pp. 697–787. Oxford University Press, 1998.MathSciNetGoogle Scholar
  29. 29.
    U.S. Reddy. Narrowing as the Operational Semantics of Functional Languages. In Proc. of Second IEEE Int’l Symp. on Logic Programming, pp. 138–151, 1985.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Maria Alpuente
    • 1
  • Demis Ballis
    • 2
  • Francisco J. Correa
    • 3
  • Moreno Falaschi
    • 2
  1. 1.DSIC, Universidad Politécnica de ValenciaValenciaSpain
  2. 2.Dip. Matematica e InformaticaUdineItaly
  3. 3.DIS, U. EAFITMedellínColombia

Personalised recommendations