
72
Chapter
3.
Normal Programs
73
§12. Negative Information
infer
-A.
This inference rule, introduced by Reiter [86], is called the closed world
assumption
(CWA). (Because
of
the approach taken here to the CW
A,
we
would
have preferred it to have been called the closed world rule.) Under this inference
rule,
we
are entitled to infer -student(mary) on the grounds that student(mary) is
not a logical consequence
of
the program.
The CWA is often a very natural rule to use in a database context.
In
relational databases, this rule is usually applied - information not explicitly present
in the database is taken to
be
false. Of course, in logic programs, the situation is
complicated by the presence
of
non-unit clauses. The information content
of
a
program is not determined by mere inspection. It is now the set
of
all things which
can be deduced from the program. Whether or not use
of
the CWA is justified
must be determined for each particular application. While it is often natural to use
the CWA, its use may not always be justified.
The CWA is
an
example
of
a non-monotonic inference rule. Such rules are
currently
of
great interest in artificial intelligence. (See, for example, [57] and the
references therein.) An inference rule is non-monotonic
if
the addition
of
new
axioms can decrease the set
of
theorems that previously held.
As
an
example,
if
we
add sufficient clauses to the above program so as to be able to deduce
student(mary), then
we
will no longer be able to use the CWA to infer
-student(mary).
Now let
us
consider a program P for which the CWA is applicable. Let AEB
p
and suppose we wish to infer
-A.
In
order
to
use the CWA, we have to show that
A is not a logical consequence
of
P.
Unfortunately, because
of
the undecidability
of
the validity problem
of
first order logic, there is
no
algorithm which will take an
arbitrary A
as
input and respond in a finite amount
of
time with the answer
whether A is or is not a logical consequence
of
P.
If
A is not a logical
consequence, it may loop forever. Thus, in practice, the application
of
the CWA is
generally restricted to those AEB
p
whose attempted proofs fail finitely. Let
us
make this idea precise.
For a definite program
P,
the
SW
finite failure set
of
P is the set
of
all AEB
p
for which there exists a finitely failed SLD-tree for P U {f-A}, that is, one which
is finite and contains no success branches. By proposition 13.4 and corollary 7.2,
if
A is in the SLD finite failure set
of
P,
then A is not a logical consequence
of
P
and every SLD-tree for P U {f-A} contains only infinite or failure branches.
Now let us return to the CW
A.
In
order
to
show that
AE
Bp is not a logical
consequence
of
P, we can try giving
f-A
as a goal to the system. Let us assume
that A is not,
in
fact, in the success set
of
P.
Now there are two possibilities:
either A is in the SLD finite failure set or it is not.
If
A is in the SLD finite
failure set, then the system can construct a finitely failed SLD-tree and return the
answer
"no".
The CWA then allows us to infer
-A.
In
the other case, each
SLD-tree has
at
least one infinite branch. Thus, unless the system has a
mechanism for detecting infinite branches, it will never be able to complete the
task
of
showing that A is not a logical consequence
of
P.
These considerations lead us to another non-monotonic inference rule, called
the negation as failure rule. This rule, first studied in detail by Clark [15], is also
used to infer negative information. It states that if A is in the
SLD
finite failure
set
of
P, then infer
-A.
Since the SLD finite failure set is a subset
of
the complement
of
the success set, we see that the negation
as
failure rule is less powerful than the
CW
A.
However, in practice, implementing anything beyond negation
as
failure
is
difficult. The possibility
of
extending negation
as
failure closer to the CWA
by
adding mechanisms for detecting infinite branches has hardly been explored.
Negation as failure is easily and efficiently implemented by "reversing" the
notions
of
success and failure. Suppose
AEB
p
and we have the goal
f-
-A.
The
system tries the goal
f-A.
If
f-A
succeeds, then
f-
-A
fails, while
if
it fails
finitely, then
f-
-A
succeeds.
Next
we
note that definite programs lack sufficient expressiveness for many
situations. The problem is that often a negative condition is needed in the body of
a clause. As
an
example, consider the definition
different(x,y)
f-
member(z,x), -member(z,y)
different(x,y)
f-
-member(z,x), member(z,y)
which defines when two sets are different. Practical PROLOO programs often
require such extra expressiveness. Thus it is important to extend the definition
of
programs to include negative literals in the bodies of clauses. This is done in §14,
where normal programs are introduced. These
are
programs for which the body
of
a program clause is a conjunction
of
literals.
However, even though normal programs allow negative literals in the bodies of
program clauses, we still cannot deduce negative information from them.
As
before, the reason is that a normal program only contains the
if
halves
of
the