

























































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The concept of negation in datalog, its problem in meaning, and the different semantics for handling it, such as bottom-up fixpoint evaluation, stratified negation, well-founded semantics, and 3-valued models. It also discusses the drawbacks of non-monotonic reasoning approach to negation and presents an alternative in the form of bottom-up inflationary fixpoint evaluation.
Typology: Slides
1 / 65
This page cannot be seen from the preview
Don't miss anything!


























































1
2
Example 1 (propositional)
p:- NOT qq:- NOT p
Several minimal models/fixpoints:
{p}, {q}
Bottom-up fixpoint evaluation: {p,q}
4
greenPath(X,Y)
= you can get from
X
to
Y
using only Green buses.
monopoly(X,Y)
= Red has a bus from
X
to
Y
, but you can’t get there on Green, even
changing buses.
5
greenPath(X,Y) :- green(X,Y)greenPath(X,Y) :-greenPath(X,Z)
& greenPath(Z,Y)
monopoly(X,Y) :- red(X,Y) &
greenPath(X,Y)
7
EDB + greenPath(1,2) + monopoly(2,3)
EDB + greenPath(1,2) + greenPath(2,3)
greenPath(X,Y) :- green(X,Y)greenPath(X,Y) :- greenPath(X,Z)&
greenPath(Z,Y)
monopoly(X,Y) :- red(X,Y) &
NOT greenPath(X,Y)
1
2
3
8
all variables appear in some positive
relational subgoal of the body.
Start with the join of the positive relational
subgoals and select/delete from there.
10
Simplest case: negate
only
EDB predicates
Redonly(X,Y):- red(X,Y),NOT green(X,Y) Natural meaning:
NOT green(a,b)
is true iff
(a,b)
is not in
green
(closed world assumption)
11
Idea: if an IDB
R has already been
defined
, then we know what
is
“Stratified program”: can be parsed so that each IDB relation is defined byprevious rules before its negation isneeded
13
describes how IDB
predicates depend negatively on eachother.
= no recursion
involving negation.
is a particular model
that “makes sense” for stratifiedDatalog programs.
14
Nodes = IDB predicates.
Arc
iff there is a rule for
that
has a subgoal with predicate
Arc
labeled – iff there is a
subgoal with predicate
that is
negated.
16
win(X) :- move(X,Y) & NOT win(Y)
Represents games like Nim where you win by forcing your opponent to a positionwhere they have no move.
17
win
--
19
If all IDB predicates have finite strata, then the Datalog program is s
If any IDB predicate has the infinite
, and no stratified model
exists.
20
Evaluate strata 0, 1,… in order.
If the program is stratified, then any negated IDB subgoal has already beenevaluated.
Safety assures that we can “subtract itfrom something.”
Treat it as EDB.
Result is the stratified model.