Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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), 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started