Skip to main content
Log in

N-Prolog and equivalence of logic programs

(Part 1)

  • Published:
Journal of Logic, Language and Information Aims and scope Submit manuscript

Abstract

The aim of this work is to develop a declarative semantics for N-Prolog with negation as failure. N-Prolog is an extension of Prolog proposed by Gabbay and Reyle (1984, 1985), which allows for occurrences of nested implications in both goals and clauses. Our starting point is an operational semantics of the language defined by means of top-down derivation trees. Negation as finite failure can be naturally introduced in this context. A goal-G may be inferred from a database if every top-down derivation of G from the database finitely fails, i.e., contains a failure node at finite height.

Our purpose is to give a logical interpretation of the underlying operational semantics. In the present work (Part 1) we take into consideration only the basic problems of determining such an interpretation, so that our analysis will concentrate on the propositional case. Nevertheless we give an intuitive account of how to extend our results to a first order language. A full treatment of N-Prolog with quantifiers will be deferred to the second part of this work.

Our main contribution to the logical understanding of N-Prolog is the development of a notion of modal completion for programs, or databases. N-Prolog deductions turn out to be sound and complete with respect to such completions. More exactly, we introduce a natural modal three-valued logic PK and we prove that a goal is derivable from a propositional program if and only if it is implied by the completion of the program in the logic PK. This result holds for arbitrary programs. We assume no syntactic restriction, such as stratification (Apt et al. 1988; Bonner and McCarty 1990). In particular, we allow for arbitrary recursion through negation.

Our semantical analysis heavily relies on a notion of intensional equivalence for programs and goals. This notion is naturally induced by the operational semantics, and is preserved under substitution of equivalent subexpressions. Basing on this substitution property we develop a theory of normal forms of programs and goals. Every program can be effectively transformed into an equivalent program in normal form. From the simple and uniform structure of programs in normal form one may directly define the completion.

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

  • Apt, K.R., Blair, H.A., and Walker, A., 1988, “Towards a theory of declarative knowledge,” in Foundations of Deductive Databases and Logic Programming, J. Minker, ed., Morgan Kaufmann.

  • Apt, K.R. and Blair, H.A., 1989, “Arithmetic classification of perfect models of stratified programs” (extended version), Technical Rep., CS-R8928, Amsterdam: Centre for Mathematics and Computer Science.

    Google Scholar 

  • Balbiani, P., 1990, “Modal logic and negation as failure,” Journal of Logic and Computation 3, 331–356.

    Google Scholar 

  • Boolos, G., 1979, The Unprovability of Consistency, Cambridge: University Press.

    Google Scholar 

  • Bonner, A.J. and McCarty, L.T., 1990, “Adding negation-as-failure to intuitionistic logic programming,” in Proc. of the North American Conference on Logic Programming (NACLP), Austin, Texas.

  • Bonner, A.J., McCarty, L.T., and Vadaparty K., 1989, “Expressing database queries with intuitionistic logic,” in Proc. of the North American Conference on Logic Programming (NACLP), Cleveland, Ohio.

  • Bonner, A.J., 1988, “Hypothetical Datalog: Complexity and Expressibility,” in Proc. of 2nd Int. Conference on Database Theory, Berlin: Springer-Verlag, vol. 326 of LNCS.

    Google Scholar 

  • Cignoli, R., 1972, “Representation of Lukasiewicz and Post algebras by continuous function,,” Coll. Math. 24, 127–138.

    Google Scholar 

  • Clark, K., 1978, “Negation as failure,” in Logic and Databases, New York: Plenum Press.

    Google Scholar 

  • Fitting, M., 1985, “A Kripke-Kleene semantics for logic programs,” Journal of Logic Programming 2, 295–312.

    Article  CAS  PubMed  Google Scholar 

  • Harland, J., 1989, “A Kripke-like model for negation as failure,” in Proc. of the North American Conference on Logic Programming (NACLP), Cleveland, Ohio.

  • Gabbay, D.M. and Reyle, N., 1984, “N-prolog: An extension of prolog with hypothetical implications, I,” Journal of Logic Programming 4, 319–355.

    Google Scholar 

  • Gabbay, D.M., 1985, “N-prolog: An extension of prolog with hypothetical implications, II: Logical foundations and negation as failure,” Journal of Logic Programming 4, 251–283.

    Google Scholar 

  • Gabbay, D.M., 1989, “Modal provability foundations for negation as failure,” in Extensions of Logic Programming, P. Schroeder-Heister, ed., Springer-Verlag, vol. 475 of LNCS.

  • Gelfond, M. and Lifschitz, V., 1988, “The stable model semantics for logic programming,” in Proc. of 5th Int. Conference and Symposium on Logic Programming, R. A. Kowalski et al., eds., Seattle, Washington.

  • Giordano, L., Martelli, A., and Rossi, G.F., 1988, “Local definitions with static scope rules in logic programming,” in Proc. of 5th Int. Conference on Fifth generation Systems, ICOT.

  • Kunen, K., 1987, “Negation in logic programming,” Journal of Logic Programming 4, 289–308.

    Google Scholar 

  • Kunen, K., 1989, “Signed data dependencies in logic programming,” Journal of Logic Programming 7, 231–245.

    Google Scholar 

  • Lloyd, J.W., 1984, Foundations of Logic Programming, Berlin: Springer Verlag.

    Google Scholar 

  • Lukasiewicz, J., 1970, Selected Works, L., Borkowski ed., Amsterdam: North-Holland.

    Google Scholar 

  • Miller, D.A., 1989, ‘A logical analysis of modules in logic programming,” Journal of Logic Programming 6, 79–108.

    Google Scholar 

  • Olivetti, N. and Terracini, L., 1991, “A logic for negation as failure”, preprint.

  • Przymusinski, T., 1987, “On the declarative semantics of deductive databases and logic programs,” in Proc. Workshop on Foundations of Deductive Databases and Logic Programming, J., Minker, ed., Los Altos, CA: Morgan Kaufmann.

    Google Scholar 

  • Przymusinski, T., 1989, “Three-valued formalizations of non-monotonic reasoning and logic programming,” in Proc. of 1st Int. Conference on Principles of Knowledge Representation and Reasoning, Brachman et al., eds., Toronto, Ontario, Canada.

  • Rasiowa, H., 1974, “An algebraic approach to non-classical logics,” Studies in Logic and Foundations of Mathematics, Amsterdam: North-Holland.

    Google Scholar 

  • Shepherdson, J.C., 1984, “Negation as failure — a comparison of Clark's completed database and Reiter's closed world assumption,” Journal of Logic Programming 1, 51–79.

    Google Scholar 

  • Shepherdson, J.C., 1985, “Negation as failure II,” Journal of Logic Programming 3, 185–202.

    Google Scholar 

  • Smoryinski, C., 1985, Self-reference and Modal Logic, New York: Springer-Verlag.

    Google Scholar 

  • Tarski, A. and Lukasiewicz, J., 1956, “Investigations into the sentential calculus,” in Logic — Semantics and Metamathematics, Oxford Univ. Press, Reprinted by Hackett Pub. Company, 1981.

  • Urquhart, A., 1986, “Many valued logic,” in Handbook of Philosophical Logic, Vol. III, D. M., Gabbay et al., eds., Dordrecht: D. Reidel Publishing Company.

    Google Scholar 

  • Van Gelder, A., Ross, K., and Schlipf, J. S., 1988, “Unfounded sets and well-founded semantics for general logic programs,” in Proc. of 7th ACM-Symposium on Principle of Databasese Systems, to appear in JACM.

  • Wajsberg, M., 1931, “Aksjomatyzacja trojwartsciowego rachnku zdam,” (“Axiomatization of the 3-valued propositional calculus”), Comptes rendus des seances de la Societedes Sciences et Letteres de Varsovie, Classe iiii 24, 125–148, English translation in: S. McCall, ed., Polish Logics 1920–1939, Oxford University Press, 1967.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Olivetti, N., Terracini, L. N-Prolog and equivalence of logic programs. J Logic Lang Inf 1, 253–340 (1992). https://doi.org/10.1007/BF00172059

Download citation

  • Received:

  • Accepted:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF00172059

Key words

Navigation