Skip to main content
Log in

A New Technique for Verifying and Correcting Logic Programs

  • Published:
Journal of Automated Reasoning Aims and scope Submit manuscript

Abstract

A significant extension to a model-building method that we have beendeveloping for several years is presented. A quite complete, albeitreasonably short, description of the previous method is given in order tomake this article self-contained. The extension enables the handling ofPresburger arithmetic and the deducing of inductive consequences from setsof Horn clauses. For a large class of logic programs the extension alsopermits the deduction of negative facts and the detection of nontermination.It is shown how the extended method can be used in verifying and correctingprograms. The proposed method verifies programs w.r.t. formalspecifications, but its fundamentals (i.e., model building) make it usefulfor pointing out errors and for suggesting a way of correcting wrongprograms also w.r.t. informal specifications, such as specifications byexamples or specifications using implicit knowledge (the latter features areespecially useful when dealing with beginners’ programs). Theoreticalproperties of the extended method (e.g., soundness and refutationalcompleteness) are proven. The greater power of the extensions to logicprogramming enabled by our method relative to existing methods and withrespect to other standard features (like negation as failure) is alsoproven. Several nontrivial examples illustrate error detection andcorrection as well as the broadening of inference capabilities that can beobtained in logic programming by using the rules of this method. Thesedetailed examples show evidence of the interest of our approach. Maindirections for future research are given.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Krzystof, R. Apt and Roland, N. Bol.: Logic programming and negation: A survey, J. Logic Programming 19, 20(1994), 9–71.

    Google Scholar 

  2. Bourely, Ch., Caferra, R. and Peltier, N.: A method for building models automatically. Experiments with an extension of OTTER, in Proc. CADE-12, LNAI 814, Springer, 1994, pp. 72–86.

  3. Bourely, Ch. And Peltier, N.: Disc_atinf: a system for implementing strategies and calculi, in Proc. DISCO’96.Springer, 1996. To appear.

  4. Caferra, R. and Peltier, N.: Extending semantic resolution via automated model building: applications, in Proc. IJCAI’95, Morgan Kaufmann, 1995, pp. 328–334.

  5. Caferra, R. and Peltier, N.: Model building and interactive theory discovery, in Proc. Tableaux’95, LNAI 918, Springer, 1995, pages 154–168.

  6. Caferra, R. and Peltier, N.: Decision procedures using model building techniques, in Proc. Computer Science Logic, CSL’95, LNCS 1092, Springer, 1996, pp. 130–144.

  7. Caferra, R. and Peltier, N.: A significant extension of logic programming by adapting model buildings rules, in Proc. Extensions of Logic Programming 96, LNAI 1050, Springer, March 1996, pp. 51–65.

  8. Caferra, R. and Zabel, N.:. Extending resolution for model construction, in Logics in AI, JELIA’90, LNAI 478, Springer, 1990, pp. 153–169.

  9. Caferra, R. and Zabel, N.: A method for simultaneous search for refutations and models by equational constraint solving, J. Symbolic Computation 13(1992), 613–641.

    Google Scholar 

  10. Caferra, R. and Zabel, N.: Building models by using tableaux extended by equational problems, J. Logic and Computation 3(1993), 3–25.

    Google Scholar 

  11. Clark, K. L.: Negation as failure, in Hervé Gallaire and Jack Minker (eds), Logic and Data Bases, Plenum Press, 1978, pp. 293–322.

  12. Clark, K. L. and Tarnlund, S.-A.: A first order theory of data and programs, in Proc. of IFIP-77, North-Holland, 1977, pp. 939–944.

  13. Comon, H. and Lescanne, P.: Equational problems and disunification, J. Symbolic Computation 7(1989), 371–475.

    Google Scholar 

  14. Cooper, D. C.: Theorem proving in arithmetic without multiplication, in Bernard Meltzer and Donald Michie (eds), Machine Intelligence 7, Ch. 5, Edinburgh University Press, 1972, pp. 91–99.

  15. Davis, M.: A computer program for Presburger arithmetic, in J. Siekmann and G. Wrighston (eds), Automation of Reasoning 1, Springer, 1983, pp. 41–48.

  16. Deville, Y. Lau, K-K.: Logic program synthesis, J. Logic Programming 19(20) (1994), 321–350.

    Google Scholar 

  17. Enderton, H.: A Mathematical Introduction to Logic, Academic Press, 1972.

  18. Fermüller, Ch, and Leitsch, A.: Hyperresolution and automated model building, J. Logic and Computation(1996), to appear.

  19. Fermüller, Ch, Leitsch, A., Tamet, T. and Zamov, N.: Resolution Methods for the Decision Problem, LNAI 679. Springer, 1993.

  20. Flener, P.: Logic Program Synthesis from Incomplete Information, Kluwer Academic Publishers, 1995.

  21. Fujita, M., Slaney, J. and Bennett, F.: Automatic generation of some results in finite algebra, in Proc. IJCAI93, Morgan Kaufmann, 1993.

  22. Gottlob, G. and Leitsch, A.: On the efficiency of subsumption algorithms, J. ACM 32(2) (1985), 280–295.

    Google Scholar 

  23. Hogger, C. J.: Derivation of logic programs, J. ACM 28(1981), 372–422.

    Google Scholar 

  24. Hogger, Ch. J.: Introduction to Logic Programming, Academic Press, 1984.

  25. Huntbach, M. M.: An improved version of Shapiro’s model inference system, in Proc. Third Int. Conf. on Logic Programming, LNCS 225, Springer, 1986, pp. 180–187.

  26. Kawamura, T.: Logic program synthesis from first order logic specification, Theor. Computer Science 122(1994), 69–96.

    Google Scholar 

  27. Kowalski, R.: The relation between logic programming and logic specification, in C. A. R. Hoare and J. C. Shepherdson (eds), Mathematical Logic and Programming Languages, Prentice-Hall, 1985, pp. 11–27.

  28. Kunen, K.: Negation in logic programming, J. Logic Programming 8(1987), 289–308.

    Google Scholar 

  29. Lloyd, J. W.: Foundations of Logic Programming, second edition, Springer, 1987.

  30. Lloyd, J. W.: Declarative error diagnosis, New Generation Computing 5(1987), 133–154.

    Google Scholar 

  31. Loveland, D. W.: Automated Theorem Proving: A Logical Basis, Fundamental Studies in Computer Science, Vol. 6, North Holland, 1978.

  32. Lloyd, J. W. and Topor, R. W.: Making prolog more expressive. J. Logic Programming 1(3) (1984), 225–240.

    Google Scholar 

  33. Lugiez, D.: A deduction procedure for first order programs, in F. Levi and M. Martelli (eds), Proc. Sixth Int. Conf. Logic Programming, The MIT Press, July 1989, pp. 585–599.

  34. Mal’cev, A. I.: The Metamathematics of Algebraic Systems: Collected Papers 1936–1967, chapter Axiomatizable classes of locally free algebra of various type, Benjamin Franklin Wells III (ed.), Ch. 23, North Holland, 1971.

  35. Manthey, R. and Bry, F.: SATCHMO: A theorem prover implemented in Prolog, in Proc. CADE-9, LNCS 310, Springer, 1988, pp. 415–434.

  36. McCune, W. W.: OTTER 2.0 Users Guide, Argonne National Laboratory, 1990.

  37. Peltier, N.: Increasing the capabilities of model building by constraint solving with terms with integer exponents, 1997, preprint.

  38. Pereira, L-M.: Rational debugging in logic programming, in Proc. Third Int. Conf. Logic Programming, LNCS 225, Springer, 1986, pp. 203–210.

  39. Plaisted, D. A.: An efficient bug location algorithm, in Proc. Second Int. Logic Programming Conference, 1984, pp. 151–157.

  40. Plaisted, D. A.: Non-Horn clause logic programming without contrapositives, J. Automated Reasoning 4(3) (1988), 287–325.

    Google Scholar 

  41. Presburger, M.: Über die Vollständigkeit eines gewissen Systems der Arithmetik ganzer Zahlen, in welchen die Addition als einzige Operation hervortritt, in Comptes Rendus du I Congrés de Mathématiciens des Pays Slaves, 1029, pp. 92–101.

  42. Shapiro, E. Y.: Algorithmic Program Debugging, MIT Press, 1983.

  43. Sterling, L. and Shapiro, E.: The Art of Prolog, The MIT Press, 1986.

  44. Sato, T. and Tamaki, H.: First order compiler: A deterministic logic program synthesis algorithm, J. Symbolic Computation 8(1988), 605–627.

    Google Scholar 

  45. Stickel, M. E.: Automated deduction by theory resolution, J. Automated Reasoning 1(4) (1985), 333–355.

    Google Scholar 

  46. Stuckey, P.: Negation and constraint logic programming, Information and Computation 118(1995), 12–33.

    Google Scholar 

  47. Warren, D. S.: Memoing for logic programs, Comm. ACM 35(3) (1992), 93–111.

    Google Scholar 

  48. Winker, S.: Generation and verification of finite models and counter-examples using an automated theorem prover answering two open questions, J. ACM 29(2) (1982), 273–284.

    Google Scholar 

  49. Wos, L., Overbeek, R., Lusk, E. and Boyle, J.: Automated Reasoning: Introduction and Applications, second edition, McGraw-Hill, 1992.

  50. Wos, L.: The kernel strategy and its use for the study of combinatory logic, J. Automated Reasoning 10(1993), 287–343.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Caferra, R., Peltier, N. A New Technique for Verifying and Correcting Logic Programs. Journal of Automated Reasoning 19, 277–318 (1997). https://doi.org/10.1023/A:1005878609884

Download citation

  • Issue Date:

  • DOI: https://doi.org/10.1023/A:1005878609884

Navigation