Question: Exercise 6: Let L = (V;C;R) with V = fw; yg, C = fd; eg and R = fr; sg where r has arity 1
Exercise 6:
Let L = (V;C;R) with V = fw; yg, C = fd; eg and R = fr; sg where r has arity 1 and s has arity 2. Which of the following are atoms over L? Which are ground atoms? Justify your answers. (a) d(w;w)
(b) r(d; e)
(c) s(w;w)
(d) r(y)
Exercise 8:
Write a Datalog program which captures the following natural language sentences. (a) If somebody is an orphan, then all his parents are dead. (b) Every orphan is a human being. (c) Somebody's father is also that person's parent. (d) Harry Potter is an orphan. (e) James Potter is the father of Harry Potter.
Exercise 9:
Give three distinct Herbrand interpretations for the following Datalog program, where a; b are constants. q(a) p(b) q(x) ! p(x) q(y) ^ p(y) ! r(b) Exercise 10:
Evaluate the following. (a) (p(x; y; x) ^ q(x; y; y) ^ r(y; y) ! t(x))[x=a; y=b] = ... (b) (p(x) ^ q(x) ! r(x))[x=c][x=d] = ... (c) (q(a; x) ^ p(x; y) ^ q(y; a) ! r(y))[x=a][x=b] = ... (d) (p(x; x) ^ q(x; y) ! p(x; y))[y=b][y=c][x=b] = ... Exercise 11 :Which of the substitutions in Exericse 10 are ground substitutions?
Exercise 12: Give the grounding of the Datalog program from Exercise 9. Exercise 13: Give a Herbrand model for the Datalog program in Exercise 9. Exercise 14: Give three distinct Herbrand models for the Datalog program P consisting of the following rules. p(a; b) q(c) p(x; y) ! q(x)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
