Skip to content

Instantly share code, notes, and snippets.

@Logiraptor
Created April 10, 2015 14:28
Show Gist options
  • Save Logiraptor/e636e60a05e41980461c to your computer and use it in GitHub Desktop.
Save Logiraptor/e636e60a05e41980461c to your computer and use it in GitHub Desktop.
Find all predicates satisfied by a value.
sleepy(micah).
sleepy(john).
dumb(micah).
retiring(radle).
has_micah(X) :-
%% Find a predicate of arity 1
current_predicate(X/1),
%% "Call" that predicate with micah
call(X, micah).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment