Slide 8
Slide 8 text
Safety Properties of Datalog
• All variables that appear in the head must also appear in the body in the rule as non-arithmetic
positive literal.
• All variables that appear in the body as negative literal must also appear in other positive
literals.
• Example of non-Safety rules
– q(X, Y, Z) :- r1(X,Y), X < Z.
– q(X, Y, Z) :- r1(X,Y), not r2(X, Y, Z).
• Example of Safety rules
– q(X, Y, Z) :- r1(X, Y), r2(Y, Z), X < Z.
– q(X, Y, Z) :- r1(X,Y), not r2(X, Y, Z), r3(Y, Z).
8