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.
[1]
Justin Zobel,et al.
Nu-prolog reference manual
,
1990
.
[2]
J. W. LLOYD,et al.
Making Prolog more Expressive
,
1984,
J. Log. Program..
[3]
Lee Naish,et al.
Negation and Quantifiers in NU-Prolog
,
1986,
ICLP.
[4]
Tok Wang Ling.
Integrity Constraint Checking in Deductive Databases Using the Prolog Not-Predicate
,
1987,
Data Knowl. Eng..
[5]
Raymond Reiter.
On Closed World Data Bases
,
1977,
Logic and Data Bases.
[6]
Keith L. Clark,et al.
Negation as Failure
,
1987,
Logic and Data Bases.
[7]
John C. Shepherdson,et al.
Negation as Failure: A Comparison of Clark's Completed Data Base and Reiter's Closed World Assumption
,
1984,
J. Log. Program..
[8]
Robert A. Kowalski.
Logic for Data Description
,
1977,
Logic and Data Bases.