Answers for "prolog check if predicate exists"

0

prolog check if predicate exists

?- current_predicate(a/1).
false.

?- functor(A,a,1),predicate_property(A,visible).
false.

?- functor(A,a,1),current_predicate(_,A).
false.

?- assert(a(42)).
true.

?- current_predicate(a/1).
true.

?- functor(A,a,1),predicate_property(A,visible).
A = a(_G136).

?- functor(A,a,1),current_predicate(_,A).
A = a(_G122).
Posted by: Guest on October-22-2021

Browse Popular Code Answers by Language