Introduction to
Logic Programming
What
versus
How
 

Exercise 13.3 - Database Update


Assume that the q relation is defined as shown below. Define add and delete to update the r relation properly when a user requests the system to add or delete a p or q factoid.

r(X,Y) :- p(X,Y) & ~q(Y,X)