Make up a simple knowledge base of atomic sentences about movies (not necessarily real ones) using the

Question:

Make up a simple knowledge base of atomic sentences about movies (not necessarily real ones) using the following predicates:

acted_in(person,movie) the person acted in the movie directed(person,movie) the person directed the movie released(movie,year) the movie came out that year You can use numbers like 2011 as constants. You may also find it convenient to use quoted strings like ’The Big Lebowski’ as constants.

Save your knowledge base as a Prolog program in a file, and load it into Prolog.

Then pose the following questions as queries to Prolog, and obtain Prolog’s answers:

1. Did Leonardo DiCaprio act in Babel?

2. Who directed District 9?

3. Did anyone act in both Click and The Aviator?
4. Was there a movie released in 2010 that did not star Jennifer Anniston?
5. Who directed movies released in 2009?
Using the ; command, have Prolog list all such movies and their directors.
6. Has anyone directed more than one movie?
7. Does any movie have more than one director?
8. Has anyone acted in more than one movie released in 2008?
9. Has anyone acted in more than two movies in the same year?
10. Who has worked with the same director in different years?
Using the ; command, have Prolog list all such actors, directors, the movies they worked on together, and the years the movies were released .
Note: There’s nothing wrong with getting failure answers from Prolog. But to be sure you have formulated the queries correctly, you may want to change some of the names in the queries, or include some additional movies in your knowledge base.

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: