Skip to content

Instantly share code, notes, and snippets.

@jomontanari
Created December 4, 2011 07:00
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 jomontanari/1429466 to your computer and use it in GitHub Desktop.
Save jomontanari/1429466 to your computer and use it in GitHub Desktop.
Prolog Day 1
book('Charlie and the chocolate factory', 'Roald Dahl').
book('Boy', 'Roald Dahl').
book('Oliver Twist', 'Charles Dickens').
book('A Christmas Carol', 'Charles Dickens').
book('1984', 'George Orwell').
['books-knowledge-base'].
book(What, 'Charles Dickens').
plays(harry, guitar).
plays(jo, piano).
plays(rachel, drums).
plays(alex, guitar).
plays(alex, drums).
plays(chelsea, keyboard).
plays(matt, drums).
instrument_genre(guitar, alternative).
instrument_genre(drums, rock).
instrument_genre(keyboard, pop).
instrument_genre(piano, classical).
plays_genre(P,G) :- plays(P, I), instrument_genre(I, G).
['music-knowledge-base'].
plays(Who, guitar).
plays_genre(Who, rock).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment