projog

3.94. current_predicate(X) - unifies with defined predicates.

current_predicate(X) attempts to unify X against all currently defined predicates.

Examples

?- current_predicate(!/0).

yes;

no

?- current_predicate(!/X).
X = 0

yes;

no

?- current_predicate(!/1).

no

?- current_predicate(doesnt_exist/1).

no

?- current_predicate(call/X).
X = 1

yes;
X = 2

yes;
X = 3

yes;
X = 4

yes;
X = 5

yes;
X = 6

yes;
X = 7

yes;
X = 8

yes;
X = 9

yes;
X = 10

yes;

no