Skip to content

Instantly share code, notes, and snippets.

@DonaldKellett
Created December 21, 2018 14:33
Show Gist options
  • Save DonaldKellett/34cbf5c0616c33f0e018b15d11c4d41b to your computer and use it in GitHub Desktop.
Save DonaldKellett/34cbf5c0616c33f0e018b15d11c4d41b to your computer and use it in GitHub Desktop.
Learn Prolog Now! - Chapter 1 - Exercise 1.4 - Possible solution
% Butch is a killer.
killer(butch).
% Mia and Marsellus are married.
married(mia, marsellus).
% Zed is dead.
dead(zed).
% Marsellus kills everyone who gives Mia a footmassage.
kills(marsellus, X) :- gives_footmassage(X, mia).
% Mia loves everyone who is a good dancer.
loves(mia, X) :- good_dancer(X).
% Jules eats anything that is nutritious or tasty.
eats(jules, X) :- nutritious(X); tasty(X).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment