Академический Документы
Профессиональный Документы
Культура Документы
N g ti iin L
Negation Logic
gi PProgramming
g i g Example:
E l
An object is above a second object if it is
either
ith on ttop off it or on ttop off a thi
third
d
object which is above the second object.
The object c
c is on top of b
b which is on
top of a
1 2
Definite program:
ABOVE(x,( , y) ON(x,
( , y)
ABOVE(x, y) ON(x, z), ABOVE(z, y)
ON(c,
( , b))
ON(b, a)
5 6
7 8
Definition (SLDNF-resolution for definite programs)
Let P be a definite program,
program G0 a general goal,
goal R a
computation rule. An SLDNF-derivation of G0 (using P
Note:
N t
and R) is a finite or infinite sequence of general goals Each step of an SLDNF-derivation produces
G0
C0
G1
C1
G 2 G n 1 C
n 1
Gn a substitution an mgu in case of (i) and
empty substitution in case of (ii)
where
h Gi
Ci
Gi 1 if either
ih
(i) R-selected literal in Gi is positive and Gi+1 is
Negative literal ~A succeeds if A has
d i d ffrom Gi and
derived d Ci by
b one step
t off SLD
SLD- a finitely failed SLD-tree.
SLD tree
resolution
~A finitelyy fails if A succeeds
(ii) R-selected
R l t d lit literall iin Gi is
i off the
th form
f A goall A
~A, A
has a finitely failed SLD-tree and Gi+1 is obtained
from Gi by removing ~A (in which case Ci is a
speciall marker
k FF)
9 10
11 12
Theorem:
SLDNF d i i off ON(x,
SLDNF-derivation ON( y),
) ~ON(z,
ON( x))
SLDNF-resolution is sound, but not
complete
Example (Previous):
Are there any blocks x and y such that x
is not on top of y?
~ ON(x, y)
Note that a is not on top of any block
ON(x, y), ~ON(z, x) has an SLDNF-refutation
Computed
p answer substitution = {{c/x,, b/y}
y} SLDNF derivation of ~ON(x,
SLDNF-derivation ON(x, y) fails
13
since ON(x, y) succeeds 14