Question: 4. (10%) Consider the following program P in datalog. a(X,Y) par(X,Z), par(Z,Y,) b(X,Y) par(X,Z), par(Z,W), par(W,Y). If b(1,2) and a(0,1) are derived from P, determine

 4. (10%) Consider the following program P in datalog. a(X,Y) par(X,Z),

4. (10%) Consider the following program P in datalog. a(X,Y) par(X,Z), par(Z,Y,) b(X,Y) par(X,Z), par(Z,W), par(W,Y). If b(1,2) and a(0,1) are derived from P, determine the tuples we may initially have had in relation "par". Justify your answer. (ii) Express the above formulas in Relational Algebra. 5. (10%) Recall the notion of safe formulas in DRC discussed in class. (i) Intuitively describe what are safe formulas? (ii) Considering this notion, how can we characterize the safe rules and programs in datalog (and prolog too). In other words, how rules/facts in such programs P should look like so that we can conclude that P is safe 4. (10%) Consider the following program P in datalog. a(X,Y) par(X,Z), par(Z,Y,) b(X,Y) par(X,Z), par(Z,W), par(W,Y). If b(1,2) and a(0,1) are derived from P, determine the tuples we may initially have had in relation "par". Justify your answer. (ii) Express the above formulas in Relational Algebra. 5. (10%) Recall the notion of safe formulas in DRC discussed in class. (i) Intuitively describe what are safe formulas? (ii) Considering this notion, how can we characterize the safe rules and programs in datalog (and prolog too). In other words, how rules/facts in such programs P should look like so that we can conclude that P is safe

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!