Question: 7. Consider the following knowledge base: has_access(X, library) student(X) . has_access(X, library) faculty(X) . has_access(X, library) has_access(Y, library) parent(Y, X) .
7. Consider the following knowledge base:
has_access(X, library) ← student(X) .
has_access(X, library) ← faculty(X) .
has_access(X, library) ← has_access(Y, library) ∧ parent(Y, X) .
has_access(X, office) ← has_keys(X) .
faculty(diane) .
faculty(ming) .
student(william) .
student(mary) .
parent(diane, karen) .
parent(diane, robyn) .
parent(susan, sarah) .
parent(sarah, ariel) .
parent(karen, mary) .
parent(karen, todd) .
(a) Provide an SLD derivation of the query has_access(todd, library).
(b) The query has_access(mary, library) has two SLD derivations. Give both of them.
(c) Does there exist an SLD derivation for has_access(ariel, library)? Explain why or why not.
(d) Explain why the set of answers to the query has_access(X, office) is empty.
(e) Suppose the following clause is added to the knowledge base:
has_keys(X) ← faculty(X) .
What are the answers to the query has_access(X, office)?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
