CS345 PROBLEM SET #4
Due in class, Wednesday, November 6, 1996.
4 Questions, 100 pts.
- P:
- p(X) :- q(X,Y) & q(Y,X) & r(Y,Y) & NOT q(X,X) & NOT r(Y,X).
- Q:
- p(B) :- q(A,B) & r(A,A) & NOT r(A,B).
- P:
- p(X) :- q(X,Y,Z) & q(X,Z,Y) & q(Y,Z,X).
- Q:
- p(X) :- q(X,Y,Z) & X<=Z & Y<=Z.
- panic :- p(X,Y) & m(Y,X)
contains the conjunctive query
- panic :- p(X,Y) & p(Y,X).
- panic :- q(X,Y,Z) & m(Y,X) & m(Y,Z)
contains the conjunctive query
- panic :- q(X,Y,X) & q(Y,Z,Y) & q(X,Z,X).
- p(X,Y) :- arc(X,A) & arc(A,Y) & arc(X,B) & arc(B,Y) & X<A & B<Y.
- p(X,Y) :- arc(X,Z) & arc(Z,Y) & X<Z & Z<Y.
Hint: The Gupta test is messy here, since there are a lot of containment mappings after we replace duplicate occurrences of variables. However, in general, and here in particular, when there is implication of the OR over all containment mappings, we can usually identify one or a few of the containment mappings that are really involved in the implication. Try first to understand what the CQ's are saying, and the focus on the containment mappings you really need.