Predicates Defined in a Module

The built-in predicate current_predicate/2 can be used to find the predicates that are defined in a particular module.

To backtrack through all of the predicates defined in module m, use

     | ?- current_predicate(_, m:Goal).
     

To backtrack through all predicates defined in any module, use

     | ?- current_predicate(_, M:Goal).
     

This succeeds once for every predicate in your program.