istediğim şey friendNetwork içindekilerin hepsininde ortak olan filmi önermesiç Buna…
- User
istediğim şey friendNetwork içindekilerin hepsininde ortak olan filmi önermesiç Buna göre suggest yazar mısın : Kodum :friend(chris, lee). friend(dale, myrna). friend(chris, spike). friend(pat, chris). friend(myrna, sean).
friends(A, B) :- friend(A, B). friends(A, B) :- friend(A, X), friends(X, B).
wants(pat,comedy). wants(sean,adventure). wants(dale,any). wants(lee,different_than(sean)). wants(myrna, thriller). wants(spike, this_century). wants(chris, comedy_1980s).
movie_genre(the_shining,horror). movie_genre(a_nightmare_on_elm_street , horror). movie_genre(the_ring , horror). movie_genre(the_exorcist, horror). movie_genre(paranormal_activity , horror). movie_genre(get_out, horror). movie_genre(hereditary, horror). movie_genre(the_babadook, horror). movie_genre(scream, horror). movie_genre(it, horror). movie_genre(indiana_jones, adventure). movie_genre(back_to_the_future , adventure). movie_genre(the_matrix , adventure). movie_genre(pirates_of_the_caribbean:_the_curse_of_the_black_pearl, adventure). movie_genre(the_dark_knight , adventure). movie_genre(jurassic_park , adventure). movie_genre(mad_max, adventure). movie_genre(mission_impossible, adventure). movie_genre(the_lord_of_the_rings_trilogy, adventure). movie_genre(the_hunger_games , adventure). movie_genre(airplane, comedy). movie_genre(ferris_bueller_day_off, comedy). movie_genre(the_mask, comedy). movie_genre(dumb_and_dumber , comedy). movie_genre(bridesmaids, comedy). movie_genre(superbad, comedy). movie_genre(the_hangover, comedy). movie_genre(anchorman:_the_legend_of_ron_burgundy , comedy). movie_genre(step_brothers, comedy). movie_genre(mean_girls, comedy). movie_genre(friday_the_13th, thriller). movie_genre(cujo, thriller). movie_genre(silkwood, thriller). movie_genre(die_hard, thriller). movie_genre(uno, thriller). movie_genre(rambo_iii, thriller). movie_genre(betrayed,thriller). movie_genre(fallen, thriller). movie_genre(drive, thriller). movie_genre(romeo_and_juliet, romance). movie_genre(pretty_woman, romance). movie_genre(dirty_dancing, romance). movie_genre(when_harry_met_sally, romance). movie_genre(ghost, romance). movie_genre(issiz_adam, romance). movie_genre(the_notebook, romance). movie_genre(titanic,romance). movie_genre(before_sunrise, romance). movie_genre(blue_valentine, romance). movie_genre(schindler_list,drama). movie_genre(the_shawshank_redemption,drama). movie_genre(the_pianist,drama). movie_genre(american_beauty ,drama). movie_genre(life_is_beautiful ,drama). movie_genre(brokeback_mountain ,drama). movie_genre(the_green_mile ,drama). movie_genre(the_tree_of_life ,drama). movie_genre(a_separation,drama). movie_genre(shrek, animation). movie_genre(lion_king, animation). movie_genre(toy_story, animation). movie_genre(aladdin, animation). movie_genre(beauty_and_the_beast, animation). movie_genre(the_little_mermaid, animation). movie_genre(finding_nemo , animation). movie_genre(wall_e, animation). movie_genre(how_to_train_your_dragon, animation). movie_genre(zootopia, animation). movie_genre(blade_runner,drama). movie_genre(the_silence_of_the_lambs, thriller). movie_year(the_shining, 1980). movie_year(a_nightmare_on_elm_street, 1984). movie_year(the_ring, 2002). movie_year(the_exorcist, 1973). movie_year(paranormal_activity, 2007). movie_year(get_out, 2017). movie_year(hereditary, 2018). movie_year(the_babadook, 2014). movie_year(scream, 1996). movie_year(it, 2017).
- Assistant
Here's the updated and corrected code for your request.
%% define friendships friend(chris, lee). friend(dale, myrna). friend(chris, spike). friend(pat, chris). friend(myrna, sean).
%% define rules for bidirectional friendships friends(A, B) :- friend(A, B). friends(A, B) :- friend(A, X), friends(X, B).
%% define preferences for each friend wants(pat, comedy). wants(sean, adventure). wants(dale, any). wants(lee, different_than(sean)). wants(myrna, thriller). wants(spike, this_century). wants(chris, comedy_1980s).
%% define movie genres and movie years (omitted here for simplicity)
%% define rules for checking if a friend is OK with a specific movie based on preferences ok_with(X, Movie) :- wants(X, G), movie_genre(Movie, G). ok_with(lee, Movie) :- + (ok_with(sean, Movie)). ok_with(dale, Movie). ok_with(spike, Movie) :- movie_year(Movie, Y), Y >= 2000. ok_with(chris, Movie) :- movie_year(Movie, Y), Y >= 1980, Y < 1990, movie_genre(Movie, comedy).
%% define a rule to check if all friends in the list are OK with a specific movie all_friends_ok_with_movie(_,[]). all_friends_ok_with_movie(Movie, [Head|Tail]) :- ok_with(Head, Movie), all_friends_ok_with_movie(Movie, Tail).