0

I know that in Prolog every file defining a module should start with the instruction

:- module(module_name, [pred1/arity, ...]).

How can I retrieve the list of public predicates exported by a module at runtime?

SOLVED.

?- all(X, [module]:current_predicate(X),CX).

Alvin Wong
  • 12,210
  • 5
  • 51
  • 77
ameyer
  • 13
  • 4
  • 2
    You should submit the answer yourself and then accept it. And format it properly (four leading spaces). – Daniel Lyons May 30 '13 at 19:52
  • The same question popped here some days ago. Note that hen using Prolog compilers such as SWI-Prolog and (maybe also YAP), the module/2 directive may preceded by an encoding/1 directive (which, when present, should be the first term in the first line of the file). – Paulo Moura May 30 '13 at 20:10

0 Answers0