Logic Programming

Assignment - Narrow and Wide

This goal of this problem is to give you some experience mapping data between different representations. To get started, click on the following URL to view a dataset of university information.

Ideal University Data

Create a Sierra window in your browser, then copy and paste this data into Lambda. You will notice that the data is in triple representation. There is a unary predicate faculty that holds of faculty members, and each faculty member has properties captured using various attributes. The attribute faculty.rank relates a faculty member and his academic rank. The attribute faculty.affiliation relates a faculty member and his department. The attribute faculty.office relates a faculty member and his office.

Your job on this assignment is to write a query that outputs the information about faculty members using a single 4-ary relation, i.e. there should be just one 4-ary predicate in the resulting dataset and no unary or binary predicates.

Repeat the exercise but this time start with the following initial data.

Realistic University Data

You will notice that one of the faculty members has two departments, and one has no office. What happens if you apply your query to this dataset? Write additional queries to extract information about these faculty members. Note that you will need several queries to extract all of the data. Hint: You will need to represent the values for department and office in a different way in order to make this happen. Be creative.

Submission details: Head to Gradescope.