




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





Write your answers on these pages and show your work. If you feel that a question is not fully specified, state any assumptions you need to make in order to solve the problem. You may use the backs of these sheets for scratch work. Write your name on this and all other pages of this exam. Make sure your exam contains seven problems on eight pages.
Name ________________________________________________ Student ID ________________________________________________
Problem Score Max Score 1 _____ 25 2 _____ 10 3 _____ 15 4 _____ 10 5 _____ 15 6 _____ 15 7 _____ 10 Total _____ 100
Convert the following English sentences to first-order predicate calculus. Be sure to use reasonable predicates and functions.
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Squares have three sides.
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
John is Mary’s brother.
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Growing flowers makes one content.
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Someone owes Susan money.
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Alice is younger than all of Bill’s children.
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Currently, apples cost more per pound than any other fruit.
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Getting a speeding ticket increases one’s insurance rates. [You must use situation calculus here, where the action is gotTrafficTicket(?ticketType, ?person) .]
Consider the Prolog program below. a(1, 3). a(2, 2). a(3, 1). b(2, 4). b(3, 6). b(4, 8). r(X, Y) :- a(X, Z), b(Z, Y). r(X, Y) :- a(X, X). What would Prolog return if given the following queries? (Report all the answers returned, in the order Prolog would return them.) hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
?- r(2, 2).
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
?- r(V, W).
hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
Show below the search tree that Prolog explores when given the r(2, 2) query. Number the nodes to indicate the order they were visited.
Draw a semantic network that captures the following (hypothetical) world knowledge.
There are three kinds of computers: mainframe, mini, and personal (PCs). All computers run Unix. Windows95 only runs on personal computers. The price of mainframes is high, of minicomputers is moderate, and of PCs is low. The XYZ brand of personal computers has a very low price, but does not run Windows95.
(A) Starting with the following givens, formally prove (for simplicity, the predicate state() and some additional frame axioms are not used here): ∃ s color(Box1, Red, s) WFF Justification hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh
1 box(Box1) ∧ box(Box2) ∧ (Box1 != Box2) ∧ paint(Red) ∧ given location(Loc1) ∧ location(Loc2) ∧ (Loc1 != Loc2) 2 at(Box1, Loc1, S0) ∧ at(Box2, Loc2, S0) ∧ given color(Box1, Blue, S0) ∧ color(Box2, Red, S0) 3 ∀ b,p,s box(b) ∧ paint(p) ∧ at(b, Loc2, s) given ⇒ color(b, p, result(Paint(b, p), s)) 4 ∀ b1,b2,p1,p2,s box(b1) ∧ (b1 != b2) ∧ color(b1, p1, s) given ⇒ color(b1, p1, result(Paint(b2, p2), s)) 5 ∀ b,x,y,s location(y) ∧ at(b, x, s) ∧ (x != y) given ⇒ at(b, y, result(Move(b, y), s)) 6 ∀ b1,b2,x,y,s at(b1, x, s) ∧ (b1 != b2) given ⇒ at(b1, x, result(Move(b2, y), s)) 7 ∀ x,y (x != y) ⇒ (y != x) given
(B) Circle one (1) frame axiom in the above (just circle its identifying number).
Devise an interpretation that shows that the following predicate calculus does not capture the accompanying English sentence. Justify your answer by calculating the truth value of the logical sentence in the interpretation you devised.
Every person can see someone. ∀ x { ∃ y [ person(x) ∧ person(y) ⇒ sees(x, y) ] }