Skip to content

Instantly share code, notes, and snippets.

@gilbert
Created January 24, 2020 06:54
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 gilbert/a2afe0e258f3a8059a688286e4165f3f to your computer and use it in GitHub Desktop.
Save gilbert/a2afe0e258f3a8059a688286e4165f3f to your computer and use it in GitHub Desktop.
Prolog learning
dog(rover).
dog(felix).
dog(benny).
has_owner(rover).
has_owner(benny).
is_happy(Dog) :- has_owner(Dog).
is_happy(Dog) :- breed(Dog, poodle).
breed(rover, pug).
breed(felix, poodle).
breed(benny, beagle).
adjacent_to(a, b).
adjacent_to(e, f).
adjacent_to(X, Y) :- adjacent_to(Y, X).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment