Introduction to
Logic Programming
What
versus
How
 

Exercise 7.3 - Stratification


Say whether each of the following logic programs is stratified with respect to negation.

a. r(X,Y) :- p(X,Y) & ~q(Y,X)
r(X,Y) :- p(X,Y) & ~q(X,Y)
 
b. r(X,Z) :- p(X,Z) & q(X,Z)
r(X,Z) :- r(X,Y) & ~r(Y,Z)
 
c. r(X,Z) :- p(X,Z) & ~q(X,Z)
r(X,Z) :- r(X,Y) & r(Y,Z)