CS2710 ISSP 2160 Foundations of Artificial Intelligence Fall 2015 Assignment 3: Knowledge Representation and Reasoning This must be your own individual work. Hand in a hardcopy of your solutions at the beginning of lecture. Type your answers into this file and hand in a printout. YOUR NAME (typed): REQUIRED FOR CREDIT: You must sign the following honesty and integrity statement, by hand. I attest that I carried out all of the work below, that I did it alone, and that I did it without using resources outside of those provided by class (CS2710 ISSP 2160 Foundations of Artificial Intelligence, Fall 2015), unless you explicitly state otherwise (in which case exactly what must be clearly indicated). SIGNED:___________________________________________ =========================================================== 1 (24 points). Convert the following sentences to clausal form and state whether the result is a Horn Clause. Note that a form is given for each one, listing the steps. On the exam, however, you will not have this form. 1.a ------ **all Y exists X ((person(Y) or dog(Y)) --> (food(X) and likes(Y,X))) 1) Replace A --> B by ~A or B 2) Move ~ inwards 3) Standardize variables 4) Skolemize 5) Drop universal quantifiers 6) Distributive law 7) Create separate clause for each conjunct 8) Standardize apart so same variable doesn't appear in 2 clauses 9) Convert to Prolog 1.b ----- ** all X,Y ((r(X) and s(X)) --> (t(Y) or u(Y))). 1) Replace A --> B by ~A or B 2) Move ~ inwards 3) Standardize variables 4) Skolemize 5) Drop universal quantifiers 6) Distributive law 7) Create separate clause for each conjunct 8) Standardize apart so same variable doesn't appear in 2 clauses 9) Convert to Prolog 1.c ------ ** all X,Y ((r(X) and s(X)) --> (t(Y) --> u(Y))) 1) Replace A --> B by ~A or B 2) Move ~ inwards 3) Standardize variables 4) Skolemize 5) Drop universal quantifiers 6) Distributive law 7) Create separate clause for each conjunct 8) Standardize apart so same variable doesn’t appear in 2 clauses 9) Convert to Prolog ============================================================ 2 (21 points). Resolution Given the following three sentences: all X (intelligent(X) and prepareInAdvance(X)) -> (succeed(X) and not worry(X)). intelligent(sally). ~succeed(sally). Prove that sally did not prepare her lessons in advance. Specifically, prove "~prepareInAdvance(sally)" using resolution refutation. We have converted the premises to clausal form for you: A1. ~intelligent(X) or ~prepareInAdvance(X) or succeed(X). A2. ~intelligent(Y) or ~prepareInAdvance(Y) or ~worry(Y). B. intelligent(sally). C. ~succeed(sally). Show the results of unification, as well as the resolutions. You will lose credit if your answer is not clear. ============================================================ 3 (15 points) Unification Feel free to check your answers with unify.py. But to get credit for doing this question, you must show your work. Compute the most general unifier (mgu) of each of the following pairs, or, if there isn't one, say why no mgu exists. Uppercase letters are variables. 4.a ---------------- f(X,X), f(a,b) 4.b ---------------- r(f(X,X),a), r(f(Y,f(Y,a)),a) 4.c --------------------- f(g(V),h(U,V)), f(g(W),h(W,j(X,Y))) =================================================================== 5. (40 points). Devise a representation scheme in first-order predicate calculus that allows you to represent things like the things listed below. You should be able to represent that events have instruments, durations (how long they took), locations (where they took place), agents (who performed the action), and themes (what the action was done to). For example: "Mary cleaned the floor with a towel" This refers to a cleaning event, with agent Mary, theme the floor, and instrument a towel. --- Sentences to represent. Assume that each sentence must be represented before the system reads the next sentence. You can use constants for entities and items. Jim painted a picture using a paint brush (a specific picture and a specific paint brush). It took him 3 days (i.e., the event had duration of 3 days). Sally bought a paint brush (a specific paint brush, different from the one that Jim used). Sally washed the paint brush she bought. Anyone who painted anything is artistic. Sally did something using a hammar (a specific hammar). Everyone did something using a hammar (not all the same hammar). Your representation scheme should be consistent, meaning that the same types of knowledge should be represented in the same way. We are not just trying to handle these isolated sentences, but devising a scheme that will work for other similar things as well. If your scheme is not consistent, then you would not be able to write axioms that will give you the proofs you want. Assume that, over time, you will add many different types of actions, with many different types of properties; we are not limited simply to those above. Make sure that your representation will allow inference of the obvious things we want, for example, that Jim is artistic. Also, make sure the system could not infer things we don't want it to infer. For example, the system should not be able to infer that Jim painted a paint brush. Start by listing the functions, and predicates you will use. Here is a simple example of how to do this: function: favoriateFood(X): designates person X's favorite food predicates: person(X): means X is a person eats(X,Y): means person X eats food Y food(X): means X is food Then, represent the sentences listed above using your knowledge representation scheme.