Skip to content

Instantly share code, notes, and snippets.

@timschonborn
Created June 6, 2018 09:33
Show Gist options
  • Save timschonborn/bd2853064258ddea77d9c11bc56663aa to your computer and use it in GitHub Desktop.
Save timschonborn/bd2853064258ddea77d9c11bc56663aa to your computer and use it in GitHub Desktop.
% greater_than.pl - learnprolognow.org
is_number(0).
is_number(s(X)) :- is_number(X).
% greater_than(X,Y) true if X is greater than Y
greater_than(s(0), 0).
greater_than(s(X), X).
greater_than(s(X), Y) :- greater_than(X, Y).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment