What does this query print out you keep typing semicolons
http://www.cs.nps.navy.mil/people/faculty/rowe/book/chap3.html
because he is still married to Stacey, but Zack is romantically inclined toward Phoebe. He's in competition with Lane, who also loves Phoebe despite being married to Eulalie, whom Jason is feeling romantic about.
?- a(X,Y), b(X,Y).
with the database
b(1,2).
b(1,3).
(b) Without using a computer, what does this query print out (as you keep typing semicolons)?
?- a(X,Y), b(X,Y), a(Y,Y).
with this database:
r(a,b).
r(a,c).
r(b,a).
r(a,d).
s(b,c).
s(b,d).
s(c,d).
s(c,c).
s(d,e).
Now consider this Prolog query, without actually using a computer:
?- u(X,Y), u(Y,Z), not(u(X,Z)).
http://www.cs.nps.navy.mil/people/faculty/rowe/book/chap3.html (20 of 22) [23/04/2002 17:38:38]