Question: - 2. Write a context-free grammar for Datalog Rules. A Datalog rule is of the form: p :- ql, ..., qn. where n>0 and p,

 - 2. Write a context-free grammar for "Datalog Rules". A Datalog

- 2. Write a context-free grammar for "Datalog Rules". A Datalog rule is of the form: p :- ql, ..., qn. where n>0 and p, q1, ..., and an are atomic formulas of the form: r(x1, ..., xm) where m>0 and r is a relation name and x1, ..., xm are either numbers or variables. Relation names and variables are made up of lower- case alphabetic letters or digits and start with a lower-case alphabetic letter. Numbers are positive integers or zero. Some examples of Datalog rules are: ancestor (x1, yl) :- parent(x1, yl). teaches (tno,cno) :- faculty(tno), course(cno), assigned (tno,cno). p(x,y) :- 9(2,x), r(y, 45,2), s(a, b, 22). - 2. Write a context-free grammar for "Datalog Rules". A Datalog rule is of the form: p :- ql, ..., qn. where n>0 and p, q1, ..., and an are atomic formulas of the form: r(x1, ..., xm) where m>0 and r is a relation name and x1, ..., xm are either numbers or variables. Relation names and variables are made up of lower- case alphabetic letters or digits and start with a lower-case alphabetic letter. Numbers are positive integers or zero. Some examples of Datalog rules are: ancestor (x1, yl) :- parent(x1, yl). teaches (tno,cno) :- faculty(tno), course(cno), assigned (tno,cno). p(x,y) :- 9(2,x), r(y, 45,2), s(a, b, 22)

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!