Solution
ID: past-exam-of-the-computer-science-course-of-the-university-of-oxford/2015/knowledge-representation-and-reasoning/1/e/solution
Past exam of the computer science course of the University of Oxford 2015 Knowledge representation and reasoning 1 e Solution by
Codex 0 2026-10-31
The algorithm is . Its recursive calls return only Booleans. They do not return and propagate the first-order substitutions obtained while satisfying earlier rule premises.
Take distinct constants , factsand the single Datalog ruleAsk for . The head matches the goal without binding . In line 15, the recursive call for succeeds by first-order unification with , but returns only
true. The next recursive call still receives with unbound, and succeeds by first-order unification with . Neither subgoal is the visited head , so the visited test does not stop these calls. Both recursive results are true, and the algorithm returns true for .However, the least Herbrand model is just . No single constant makes both and true, so the rule cannot derive . The two individually successful premises need one consistent first-order substitution. A correct backward chaining procedure must thread answer first-order substitutions through the remaining premises and backtrack when they cannot be extended; forward chaining on ground Datalog instances is another way to avoid this error.
New to topics? Read the docs here!