Logic Programming WhatversusHow

 Assignment - Triples

 In the lecture on Datasets, we saw that it is possible to represent data in the form of triples. In this assignment, you are asked to illustrate this by encoding information of various sorts in a triple-based representation. (1) Consider a vocabulary that includes the predicates shown below. movie.instance(x) means that x is a movie. actor.instance(x) means that x is an actor. director.instance(x) means that x is a director. year.instance(x) means that x is a year. title.instance(x) means that x is a title. movie.star(x,y) means that movie x stars actor y. movie.director(x,y) means that movie x was directed by y. movie.year(x,y) means that movie x was released in year y. movie.title(x,y) means that movie x has the title y. Choose symbols for a few movies, actors, directors, years, and titles, and encode the relevant data about these entities using this vocabulary. (2) Consider a vocabulary where the symbols include (a) the types of entities described above, i.e. movie, actor, director, year, title, (b) the booleans yes and no, (c) the unary type predicates from part (1), and (d) the binary attributes from part (1). (Yes, the predicates in our movie vocabulary are symbols in this vocabulary. It is, in effect, a metavocabulary.) The predicates for this vocabulary are listed below. type.instance(x) means that x is a type of entity. For example, type.instance(movie) is true. type.predicate(x,y) means that type x has a unary predicate y that is true of entities of type x. type.attribute(x,y) means that type x has an attribute y that applies to entities of type x. predicate.instance(x) means that x is a unary relation. predicate.domain(x,y) means that predicate x has domain y. (It is the inverse of type.predicate.) attribute.instance(x) means that x is a binary relation. attribute.domain(x,y) means that attribute x has domain y. attribute.range(x,y) means that attribute x has range y. attribute.total(x,b) means that attribute x is total (i.e. it has at least one value) if b is yes and is not total if b is no. attribute.unique(x,b) means that attribute x is unique (i.e. it has at most one value) if b is yes and is not unique if b is no. Use this vocabulary to describe the types and relations in our movie vocabulary. (3) Consider a vocabulary where the symbols consist of (a) the types of entities described in part (2), i.e. type, predicate, attribute, boolean, (b) the booleans yes and no, (c) the unary type predicates from part (2), and (d) the binary attributes from part (2). (Yes, the predicates in our vocabulary are symbols in this vocabulary as well as predicates!) Use the relations described in part (2) to describe these types and predicates and attributes. Submission details: When you are done, head to Gradescope to submit your answers for parts (1), (2), and (3).