i have received this assignment that i need to complete by wednesday and i havent started.
basically i have a .pl file with a movie database and i am required to answer the following.
1. COURSEWORK: There is a game that can be played whereby people try to work out the “degrees of separation” between two Hollywood actors. This is achieved by working out all of the actors who co-star in films together and thereby connect actor X and actor Y. This project involves writing PROLOG rules to extract information from a database including a test to see if a list of films can be linked in a similar way.
An online movie database is supplied that stores a number of films along with the starring cast. It will be of the form of the following PROLOG rules:
starsin(filmA, actorX).
starsin(filmB, actorX).
starsin(filmB, actorY).
…
starsin(filmC, actorZ).
There is also a list of facts reflecting how much money each film made of the form:
takings(filmA, amount).
Part 1 – Annotated Code (Total marks: 20%)
Given this database, write PROLOG rules to carry out the following tasks:
a) Do actors S1 and S2 costar in any films? If so, return true, otherwise return false [3%]
b) Did film F1 make more money than film F2? If so, return true, otherwise return false [3%]
c) Is there a star that links films F1 and F2 (in other words is there a star who appears in both)? If so, return true, otherwise return false [3%]
d) Given a list of films, are they in order of money they made? If so, return true, otherwise return false [3%]
e) Given a list of films, how much money did they all make? [3%]
f) Given a list of films, can they be linked by a set of stars? For example, Men in Black can be linked to The Cable Guy with through the following stars: [Smith and Jones costar in Men in Black], [Jones and Carrey costar in Batman Forever], [Carrey and Broderick costar in The Cable Guy]. [5%]
[Maximum length: 3 pages for code and annotation].
The marking of your code implementation will be based on three aspects: (i) Code Functionality (ii) Readability; and (iii) Annotation