Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Language= Prolog Database: actor(jonny, depp, gender(male)). actor(bruce, willis, gender(male)). actor(glenn, close, gender(female)). actor(orlando, bloom, gender(male)). actor(jennifer, lawrence, gender(female)). actor(sean, bean, gender(male)). actor(angelina, jolie, gender(female)). actor(keira,

Language= Prolog

Database:

actor(jonny, depp, gender(male)). actor(bruce, willis, gender(male)). actor(glenn, close, gender(female)). actor(orlando, bloom, gender(male)). actor(jennifer, lawrence, gender(female)). actor(sean, bean, gender(male)). actor(angelina, jolie, gender(female)). actor(keira, knightley, gender(female)). actor(benedict, cumberbatch, gender(male)). actor(james,mcavoy, gender(male)). actor(robin, williams, gender(male)). actor(emilia, clarke, gender(female)). actor(ryan, reynolds, gender(male)). actor(chris, pratt, gender(male)). actor(ryan, gosling, gender(male)). actor(robin,wright, gender(female)). actor(karen, gillan, gender(female)). actor(kirsten, dunst, gender(female)). actor(dwayne, johnson, gender(male)). actor(jack, black, gender(male)). actor(tobey, maguire, gender(male)). actor(keanu, reeves, gender(male)). movie(year(2003), title([pirates,of,the,carribean]), cast([actor(jonny, depp), actor(keira, knightley), actor(orlando, bloom)])). movie(year(2014), title([guardians, of, the, galaxy]), cast([actor(chris, pratt), actor(karen,gillan) ])). movie(year(1988), title([die,hard]), cast([actor(bruce, willis)])). movie(year(2001), title([lord,of,the,rings]), cast([actor(orlando, bloom), actor(sean, bean)])). movie(year(2016), title([xmen, apocalypse]), cast([actor(jennifer,lawrence), actor(james, mcavoy)])). movie(year(2014), title([the,imitation,game]), cast([actor(benedict, cumberbatch), actor(keira, knightley)])). movie(year(2012), title([the,hunger,games]), cast([actor(jennifer,lawrence)])). movie(year(2016), title([deadpool]), cast([actor(ryan, reynolds)])). movie(year(1995), title([jumanji]), cast([actor(robin, williams), actor(kirsten, dunst)])). movie(year(2017), title([jumanji,welcome,to,the,jungle]), cast([actor(dwayne,johnson),actor(karen,gillan),actor(jack,black)])). movie(year(2003), title([spider,man]), cast([actor(tobey, maguire), actor(kirsten,dunst)])). movie(year(2017), title([blade,runner,2049]), cast([actor(ryan,gosling), actor(robin,wright)])).

Write prolog queries that answer the following questions:

a.What movies share one or more common actor(s)?

b.Who has worked with Orlando Bloom in a movie?

Hints & Tips:

You may want to use the built-in member predicate in some of your answers.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Security

Authors: Alfred Basta, Melissa Zgola

1st Edition

1435453905, 978-1435453906

More Books

Students also viewed these Databases questions

Question

Why is silicon often used with MEMS and MEMS devices?

Answered: 1 week ago

Question

Should the organization resist or encourage such activities? lop589

Answered: 1 week ago

Question

Discuss cross-cultural differences in perception

Answered: 1 week ago

Question

Compare and contrast families and family roles across cultures

Answered: 1 week ago

Question

Compare and contrast sex and gender roles across cultures

Answered: 1 week ago