In all cases, show the canonical databases needed to prove or disprove
the hypothesis. Please be very careful about directionality, both in
terms of what you're proving and in terms of what's being frozen and
queried where; it's *very* easy to screw that up. Also please
note that "contains" is the inverse of "e;is contained
in"e;...

Questions 1-5 are worth 19% each, and question 5 is worth 5%.

- (For Section 1.1)
Q1: p(X,Y):-r(X,Z) & g(Z,Z) & r(Z,Y)

Q2: p(A,B):-r(A,C) & g(C,D) & r(D,B)Does Q2 contain Q1? Why or why not?

- (For Section 1.2)
Q1: p(X,Y) :- a(X,Z) & a(Z,Y) & NOT a(X,Y)

Q2: p(X,Y) :- a(X,Y) & NOT a(Y,X)Does Q2 contain Q1? Why or why not?

- (For Section 1.3)
Q1: p(X,Y) :- q(X,Y) & r(U,V) & r(V,U)

Q2: p(X,Y) :- q(X,Y) & r(U,V) & U <= VDoes Q2 contain Q1? Why or why not?

- (For Section 1.4)
Q: p(X,Y) :- a(X,Z) & a(Z,W) & a(W,Y)

P: p(X,Y) :- a(X,Y)

p(X,Y) :- p(X,Z) & p(Z,Y)Does P contain Q? Why or why not?

- (For Section 2.1)
Given query q and views v1 and v2:

q(X):-e1(X,Y),e2(Y,Z),e3(Z,X)

v1(A,B,C,D):-e1(A,B),e2(C,D)

v2(D,E):-e3(D,E)Use v1 and v2 to create an equivalent query to q that does not access e1, e2, or e3. There is no need to show that they are equivalent.

Bonus thought experiment (no need to turn this in for credit): if the definition of V1 was v1(a,d), could you create an equivalent query for q using only v1 and v2? Why or why not?

- Please answer the following questions:
- How long did it take you to complete this assignment?
- What did you like the best about this assignment?
- What did you like the least about this assignment?
- What helped you learn the best in this assignment?
- What distracted from your learning in this assignment?

The Department of Computer Science

University of British Columbia

201-2366 Main Mall

Vancouver, B.C. V6T 1Z4

Canada