Question
GNU Prolog (Not SWI Prolog) Do: #6 only And the facts: novel(the_lord_of_the_rings, 1954). novel(the_hitchhikers_guide_to_the_galaxy, 1979). novel(enders_game, 1985). novel(frankenstein, 1818). novel(the_way_of_kings, 2010). novel(the_dune_chronicles, 1965). novel(a_song_of_ice_and_fire_series, 1996).
GNU Prolog (Not SWI Prolog)
Do: #6 only
And the facts:
novel(the_lord_of_the_rings, 1954). novel(the_hitchhikers_guide_to_the_galaxy, 1979). novel(enders_game, 1985). novel(frankenstein, 1818). novel(the_way_of_kings, 2010). novel(the_dune_chronicles, 1965). novel(a_song_of_ice_and_fire_series, 1996). novel(the1984, 1949). novel(fahrenheit451, 1953). novel(the_foundation_trilogy, 1951). novel(brave_new_world, 1932). novel(american_gods, 2001). novel(the_princess_bride, 1973). novel(the_time_machine, 1895). novel(the_wheel_of_time_series, 1999). novel(animal_farm, 1945). novel(neuromancer, 1984). novel(i_robot, 1950). novel(stranger_in_a_strange_land, 1961). novel(the_kingkiller_chronicles, 2007). novel(slaughterhouse_five, 1969). novel(the_dark_tower_series, 1982). novel(the_20000_leagues_under_the_sea, 1870). novel(the2001_space_odyssey, 1968). novel(the_stand, 1978). novel(the_silmarillion, 1977). novel(the_martian_chronicles, 1950). novel(the_caves_of_steel, 1953). novel(the_sandman_series, 1988). novel(the_journey_to_the_center_of_the_earth, 1864). novel(neverwhere, 1996). novel(stardust, 1999). novel(starship_troopers, 1959). novel(cats_cradle, 1963). novel(rendezvous_with_rama, 1973). novel(childhoods_end, 1953). novel(the_moon_is_a_harsh_mistress, 1966). novel(the_war_of_the_worlds, 1898). novel(mistborn_trilogy, 2006). novel(something_wicked_this_way_comes, 1962). novel(the_illustrated_man, 1951). novel(little_women, 1868).
fan(amy, [the_lord_of_the_rings, the_way_of_kings]). fan(barry, [cats_cradle, the_war_of_the_worlds]). fan(chandler, [stranger_in_a_strange_land, neuromancer, the_moon_is_a_harsh_mistress, the2001_space_odyssey, i_robot, a_song_of_ice_and_fire_series]). fan(david, [the_wheel_of_time_series, the_caves_of_steel]). fan(emma, [animal_farm, brave_new_world]). fan(frank, [childhoods_end, the_dune_chronicles, neverwhere]). fan(gunther, [rendezvous_with_rama, the_lord_of_the_rings]). fan(heckles, [slaughterhouse_five, cats_cradle, enders_game, mistborn_trilogy]). fan(joey, [little_women]). fan(kathy, [the_moon_is_a_harsh_mistress, neuromancer]). fan(leonard, [starship_troopers, stardust, mistborn_trilogy]). fan(monica, [the_lord_of_the_rings, fahrenheit451, the_martian_chronicles, the_princess_bride, something_wicked_this_way_comes, the_illustrated_man, the_kingkiller_chronicles, mistborn_trilogy, the_wheel_of_time_series]). fan(nora, [neuromancer, the_dark_tower_series, the_stand, the_way_of_kings]). fan(phoebe, [the2001_space_odyssey, stranger_in_a_strange_land, the_hitchhikers_guide_to_the_galaxy, the_time_machine, the_wheel_of_time_series]). fan(ross, [the_20000_leagues_under_the_sea, the_princess_bride, the_journey_to_the_center_of_the_earth, something_wicked_this_way_comes, the_time_machine]). fan(susie, [the_silmarillion, the_journey_to_the_center_of_the_earth]). fan(tag, [a_song_of_ice_and_fire_series, the_way_of_kings]). fan(ursula, [american_gods, the_sandman_series, neverwhere, stardust, the_lord_of_the_rings]). fan(will, [the1984, frankenstein, the_20000_leagues_under_the_sea]). fan(zelner, [the_lord_of_the_rings, american_gods, the_sandman_series]).
author(jrr_Tolkien, [the_lord_of_the_rings, the_silmarillion]). author(douglas_adams, [the_hitchhikers_guide_to_the_galaxy]). author(orson_scott_card, [enders_game]). author(frank_herbert, [the_dune_chronicles]). author(george_rr_martin, [a_song_of_ice_and_fire_series]). author(george_orwell, [the1984, animal_farm]). author(ray_bradbury, [fahrenheit451, the_martian_chronicles, something_wicked_this_way_comes, the_illustrated_man]). author(isaac_asimov, [the_foundation_trilogy, i_robot, the_caves_of_steel]). author(aldous_huxley, [brave_new_world]). author(neil_gaiman, [american_gods, the_sandman_series, neverwhere, stardust]). author(william_goldman, [the_princess_bride]). author(robert_jordan, [the_wheel_of_time_series]). author(william_gibson, [neuromancer]). author(robert_heinlein, [stranger_in_a_strange_land, starship_troopers, the_moon_is_a_harsh_mistress]). author(patrick_rothfuss, [the_kingkiller_chronicles]). author(kurt_vonnegut, [slaughterhouse_five, cats_cradle]). author(mary_shelley, [frankenstein]). author(stephen_king, [the_dark_tower_series, the_stand]). author(arthur_clarke, [the2001_space_odyssey, rendezvous_with_rama, childhoods_end]). author(hg_wells, [the_time_machine, the_war_of_the_worlds]). author(jules_verne, [the_20000_leagues_under_the_sea, the_journey_to_the_center_of_the_earth]). author(brandon_sanderson, [mistborn_trilogy, the_way_of_kings]). author(louisa_alcott, [little_women]).
Part 1: Simple Queries (30 points) You are given a set of facts of the following form 1. novel (name, year). Here name is an atom denoting the name of the novel and year denotes the year that the novel has been published For example, the fact novel (the-kingkiller-chronicles, 2007) . says that the novel named the_kingkiller.chronicles was published in the year 2007 2. fan (name, novels.liked) Here name is an atom denoting the name of the character (in some imaginary world!) and novels.liked denotes the list of novels liked by that character For example, the fact fan (joey, [little.women]). says that the character named joey is a fan of the novel named little-women 3. author (name, novels written). Here name is an atom denoting the name of the author and novels written de- notes the list of novels written by that author. For example, the fact author (george.rr martin, [a.song.of.ice.and.fire.series]). says that the author named george.rr martin has written the novel named a song.of.ice.and fire series Write the following separate queries: 1. Find all the names of the novels that have been published in either 1953 or 1996 2. Find all the names of the novels that have been published during the period 1800 to 1900 3. Find all the names of the characters who are fans of the.lord of.the.rings 4. Find all the names of the authors whose novels chandler is a fan of 5. Find all the names of the characters who are fans of the novels authored by brandon.sanderson 6. Find all the names of the novels that are common between either of phoebe, ross and monicaStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started