Skip to main content
Log in

The Prolog not-predicate and negation as failure rule

  • Regular Papers
  • Published:
New Generation Computing Aims and scope Submit manuscript

Abstract

Clark’s query evaluation procedure for computing negative information in deductive databases using a “negation as failure” inference rule requires a safe computation rule which may only select negative literals if they are ground. This is a very restrictive condition, which weakens the usefulness of negation as failure in a query evaluation procedure. This paper studies the definition and properties of the “not” predicate defined in most Prolog systems which do not enforce the above mentioned condition of a safe computation rule. We show that the negation in clauses and the “not” Predicate of Prolog are not the same. In fact a Prolog program may not be in clause form. An extended query evaluation procedure with an extended safe computation rule is proposed to evaluate queries which involve the “not” predicate. The soundness and completeness of this extended query evaluation procedure with respect to a class of logic programs are proved. The implementation of such an extended query evaluation procedure in a Prolog system can be implemented by a preprocessor for executing range restricted programs and requires no modification to the interpreter/compiler of an existing Prolog system. We compare this proposed extended query evaluation procedure with the extended program proposed by Lloyd and Topor, and the negation constructs in NU-Prolog. The use of the “not” predicate for integrity constraint checking in deductive databases is also presented.

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. Clark, K. L., “Negation as failure”, inLogic and Databases (H. Gallaire and J. Minker, eds.), Plenum Press, New York, pp. 293–322, 1978.

    Google Scholar 

  2. Clocksin, W. F. and Mellish, C. S.,Programming in Prolog, 2nd ed., Springer-Verlag, 1984.

  3. Lloyd, J. W. and Topor, R. W., “Making Prolog more expressive”,J. Logic Programming, 3, pp. 225–240, 1984.

    Article  MathSciNet  Google Scholar 

  4. Lloyd, J. W.,Foundation of Logic Programming, Springer-Verlag, 1984.

  5. Ling, T. W., “Integrity constraint checking in deductive databases using Prolog notpredicate”,Data & Knowledge Enginnering 2, pp. 145–168, 1987.

    Article  Google Scholar 

  6. Kowalski, R., “Logic for data description”, inLogic and Databases (H. Gallaire and J. Minker, eds.), Plenum Press, New York, pp. 77–103, 1978.

    Google Scholar 

  7. Naish, L.,MU-Prolog Reference Manual, Melbourne University, 1983.

  8. Naish, L., “Negation and Quantifiers in NU-Prolog”,The 3rd International Conference on Logic Programming, pp. 624–634, 1986.

  9. Shepherdson, J. C., “Negation as failure: A comparison of Clark’s completed data base and Reiter’s closed world assumption”,J. of Logic Programming, pp. 51–79, 1984.

  10. Reiter, R., “On closed world data bases”, inLogic and Databases (H. Gallaire and J. Minker, eds.), Plenum Press, New York, pp. 55–76, 1978.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Additional information

The paper was written when the author was on sabbatical leave at the Department of Computer Science, University of Maryland, College Park, MD 20742.

About this article

Cite this article

Ling, T.W. The Prolog not-predicate and negation as failure rule. New Gener Comput 8, 5–31 (1990). https://doi.org/10.1007/BF03037511

Download citation

  • Received:

  • Revised:

  • Issue Date:

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

Keywords

Navigation