Consider a deductive database with the following rules: DESCENDANT(X, Y) :- PARE
ID: 3751968 • Letter: C
Question
Consider a deductive database with the following rules:
DESCENDANT(X, Y) :- PARENT(X, Y)
DESCENDANT (X, Y) :- DESCENDANT (X, Z), PARENT (Z, Y)
Notice that PARENT (X, Y) means that X is the (biological) parent of Y; DESCENDANT(X, Y) means that Y is the descendant
of X.
Consider the following fact base:
PARENT(john, steve), PARENT(john, olivia), PARENT(olivia, emma), PARENT(olivia, sophia).
(a) Construct a model theoretic interpretation of the above rules using the given facts.
Consider that a database contains the following relations PERSON(X), PARENT(X, Y), and a third relation BIRTH(X, B),
where B is the birth date of a person X.
The following information is used for question (b), (c) and (d).
Assume that we have the following family tree:
john
steve olivia
michael isabella emma sophia
david anthony sarah christopher
With given fact defined predicates:
PERSON(john).
PERSON(steve).
PERSON(olivia).
PERSON(michael).
PERSON(isabella).
PERSON(emma).
PERSON(sohia).
PERSON(david).
PERSON(anthony).
PERSON(sarah).
PERSON(christopher).
PARENT(john, steve)
PARENT(john, olivia)
PARENT(olivia, emma)
PARENT(olivia, sophia)
PARENT(steve, michael)
PARENT(steve, isabella)
PARENT(michael, david)
PARENT(michael, anthony)
PARENT(emma, sarah)
PARENT(emma, christopher)
BIRTH(john, 01/01/1930).
BIRTH(steve, 01/01/1950).
BIRTH(olivia, 01/01/1952).
BIRTH(michael, 01/01/1974).
BIRTH(isabella, 01/01/1977).
BIRTH(emma, 01/01/1972).
BIRTH(sohia, 01/01/1975).
BIRTH(david, 01/01/2000).
BIRTH(anthony, 01/01/2002).
BIRTH(sarah, 01/01/1995).
BIRTH(christopher, 01/01/1999).
(b)
1. Construct a proof theoretic interpretation of DESCENDANT(steve, X) to find all descendants of Steve.
2. State a rule named as SIBLING(X, Y) and construct a proof theoretic interpretation of this rule to find all siblings
(c)Given the following rules:
FIRST_COUSIN(X, Y) :- PARENT(Z, X), PARENT(T, Y), SIBLING(Z, T)
COUSIN(X, Y) :- FIRST_COUSINS(X, Y)
COUSIN(X, Y) :- PARENT(Z, X), PARENT(T, Y), COUSIN(Z, T)
Note: Two people are first cousins if their parents are siblings. Cousins means any kind of cousins. Cousins can be
second cousins who are the children of the two first cousins or third cousins who are the children of two second cousins
etc.
1. Prove that FIRST_COUSIN(isabella, emma) is true.
2. Prove that COUSIN(david, christopher) is true.
(d) State a rule named as COUSIN_BORN_BEFORE_2000 that computes a pair of cousins such that both of them were
born before the year 2000. You may use “<” (less than) as a built-in predicate.
Explanation / Answer
Answer for question a: DESCENDANT( PARENT(JOHN,(steve,olivia)) , (emma,sophia) )
Since emma and sophia are the grand children they will become the descendants of john. And John is the parent of steve amd olivia.
Answer for question b: Since the family tree is not clearly given, I assume this to be the family tree.
1.John
1.1 Steve
1.2 olivia
1.1.1 Michael
1.1.2 isabella
1.2.1 emma
1.2.2 sophia
1.1.1.1 david
1.1.1.2 anthony
1.2.1.1 sarah
1.2.1.2 christopher
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.