## Artificial Intelligence: Problem Set 3: Solutions

Assigned: Oct. 3
Due: Oct. 10

### Problem 1

Let U be a universe containing people and songs. Let L be a language with the following primitives.
c(P,S) --- Person P composed song S.
l(P,S) --- Person P likes song S.
s(P,S) --- Person P sings song S.
m(S) --- Song S is in a major key.
Constants: a --- Amy; b --- Barry; d --- David; y -- Yankee Doodle.
Express the following statements in L:
• A. Amy has composed a song.
exists(S) c(a,S).
• B. Barry only sings songs that he himself wrote.
forall (S) s(b,S) => c(b,S).
• C. David likes some of the songs that Amy has written (i.e. at least one song).
exists(S) c(a,S) ^ l(d,S).
• D. David does not like any of the songs that Amy has written in a major key.
not exists (S) l(d,S) ^ c(a,S) ^ m(S)
• E. Anyone who likes any songs at all likes Yankee Doodle.
forall(P) [exists(S) l(P,S)] => l(P,y).
• F. There is someone who likes all the songs that Barry sings.
exists(P) forall(S) s(b,S) => l(P,S).
• G. Everyone likes all the songs that they themselves composed.
forall(P,S) c(P,S) => l(P,S).
• H. None of the songs that Amy likes were composed by either David or Barry.
not exists(S) l(a,S) ^ [c(d,S) V c(b,S)].