Skip to content

Instantly share code, notes, and snippets.

@brikis98
Created February 9, 2012 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brikis98/1778586 to your computer and use it in GitHub Desktop.
Save brikis98/1778586 to your computer and use it in GitHub Desktop.
Seven Languages in Seven Weeks: Prolog, Day 1
book(a_game_of_thrones).
book(a_clash_of_kings).
book(the_road).
book(flatland).
book(the_adventures_of_sherlock_holmes).
book(one_flew_over_the_cuckoos_nest).
book(the_hitchhikers_guide_to_the_galaxy).
book(the_restaurant_at_the_end_of_the_universe).
book(life_the_universe_and_everything).
author(george_rr_martin).
author(cormac_mccarthy).
author(edwin_abbott).
author(aurthur_conan_doyle).
author(ken_kesey).
author(douglas_adams).
wrote(george_rr_martin, a_game_of_thrones).
wrote(george_rr_martin, a_clash_of_kings).
wrote(cormac_mccarthy, the_road).
wrote(edwin_abbott, flatland).
wrote(aurthur_conan_doyle, the_adventures_of_sherlock_holmes).
wrote(ken_kesey, one_flew_over_the_cuckoos_nest).
wrote(douglas_adams, the_hitchhikers_guide_to_the_galaxy).
wrote(douglas_adams, the_restaurant_at_the_end_of_the_universe).
wrote(douglas_adams, life_the_universe_and_everything).
| ?- wrote(george_rr_martin, What).
What = a_game_of_thrones ? a
What = a_clash_of_kings
?- wrote(douglas_adams, What).
What = the_hitchhikers_guide_to_the_galaxy ? a
What = the_restaurant_at_the_end_of_the_universe
What = life_the_universe_and_everything
musician_plays(eric_clapton, guitar).
musician_plays(yo_yo_ma, cello).
musician_plays(jim_brickman, piano).
musician_plays(paul_mccartney, piano).
musician_plays(paul_mccartney, guitar).
musician_plays(jimi_hendrix, guitar).
musician_plays(slash, guitar).
musician_plays(ringo_starr, drums).
musician_genre(eric_clapton, rock).
musician_genre(eric_clapton, blues).
musician_genre(yo_yo_ma, classical).
musician_genre(jim_brickman, contemporary).
musician_genre(paul_mccartney, rock).
musician_genre(paul_mccartney, pop).
musician_genre(jimi_hendrix, rock).
musician_genre(jimi_hendrix, hard_rock).
musician_genre(slash, hard_rock).
musician_genre(ringo_starr, rock).
musician_genre(ringo_starr, pop).
| ?- musician_plays(Who, guitar).
Who = eric_clapton ? a
Who = paul_mccartney
Who = jimi_hendrix
Who = slash
@brikis98
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment