The objective of this worksheet is to

  • Write algebraic expressions to solve basic Datalog queries that do not involve rules.
  • Work examples of Datalog queries by hand
  • Design the classes and interfaces needed to support the use of relational algebra to interpret Datalog programs.


  1. Create a Datalog file with at least a 3-ary relation and write queries for the relation that represent the range of queries and outputs that might occur. You need at least 4 queries minimum. Justify your answer (i.e., explain why your set of queries is representative of what may be encountered in an arbitrary Datalog input with just facts).
  2. For each query in the prior problem, write the algebraic expression to solve the query.
  3. Solve each query in the first problem by hand showing the relation created after each unary operation in the algebraic expression.
  4. Design a class to represent a relation and to represent a tuple. Include the member variables and method interface.
  5. Write pseudo-code for the select, rename, and project operations on the relation.
cs-236/project-3-worksheet.txt · Last modified: 2015/01/05 21:11 by egm
Back to top
CC Attribution-Share Alike 4.0 International = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0